electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
go to the radio page Live at electro-music.com radio 1 Please visit the chat
poster
 Forum index » DIY Hardware and Software » Microcontrollers and Programmable Logic
PIC-based fraktal synth
Post new topic   Reply to topic Moderators: State Machine
Page 5 of 8 [195 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Goto page: Previous 1, 2, 3, 4, 5, 6, 7, 8 Next
Author Message
monokinetic



Joined: Aug 01, 2006
Posts: 100
Location: prague

PostPosted: Sat Mar 21, 2009 5:46 am    Post subject: Reply with quote  Mark this post and the followings unread

Hi,
I'm just in the process of laying this out on breadboard and I'm a bit confused about the output section. There's 3 schematics in this thread, two from catweazle and one other. Each has a different output section!

The resistors change every time and sometimes the caps are polarised, sometimes not Smile Confusing....

So, my guess would be that the latest schematic from here:

http://www.reprolabs.com/fraktal_synth.sch

Is probably the most clear. But it still has a polarised 100n cap, which seems strange to me. I'm used to 100n being a ceramic cap!

Can anyone clarify for me please?

TIA

David
Back to top
View user's profile Send private message
hanley



Joined: May 24, 2006
Posts: 27
Location: London

PostPosted: Sat Mar 21, 2009 8:59 am    Post subject: Reply with quote  Mark this post and the followings unread

i think the final resistor value doesnt matter so much, i had to leave it out in mine cause the output was low
i think if your using a mixer or something you dont want the output power being too high

the cap on the output section is for a lp filter i think
reckon go with catweasels value to start but seeming your doin it on breadboard you can try different values and hear the difference yourself
Back to top
View user's profile Send private message
yerpa58



Joined: Mar 08, 2008
Posts: 57
Location: Wisconsin
Audio files: 4

PostPosted: Mon Mar 23, 2009 12:49 pm    Post subject: Reply with quote  Mark this post and the followings unread

A ceramic cap should work fine. I used a different amplifier IC, so I had to tweak some values. It isn't very loud, but loud enough for the small speaker I am using. Incidentally, I have added another algorithm that uses wavetables and a delay line, it sounds pretty cool. I will post the files in the next couple of days. I also fixed a bug in the 8-step sequencer so that the tones ring out instead of a sequence of clicks.

I might think of doing a run of boards if there is any interest. It has been a fun project, thanks to catweazle's excellent ideas.
Back to top
View user's profile Send private message Visit poster's website
monokinetic



Joined: Aug 01, 2006
Posts: 100
Location: prague

PostPosted: Mon Mar 23, 2009 2:27 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hi,
thanks for the replies. Progress is going a bit slower than I expected due to a looming University deadline. grrrr

But yerpa58, it sounds like you have got quite deep into the code! I have had a read through and I was contemplating trying to implement a sync function. Basically I would like to try and integrate this into my modular set up. Ideal would to receive a clock signal and sync the PIC synth. I found the place in the code which generate the timing clocks.

In your opinion, as someone who's obviously been tinkering with the code, is this doable?

TIA

David
Back to top
View user's profile Send private message
yerpa58



Joined: Mar 08, 2008
Posts: 57
Location: Wisconsin
Audio files: 4

PostPosted: Tue Mar 24, 2009 9:14 am    Post subject: Reply with quote  Mark this post and the followings unread

There is a lot of space left for code, but the chip is running full speed all the time. Any additional instructions affect the loop timing, which is OK since this thing is not really "tuned" to any particular pitch. I think that a sync signal could be applied to a pin of the PIC chip (within 0-5 volt signal level) and used to generate an interrupt. In the interrupt, the various pointers and counters used by each algorithm could be reset. I have no idea how that might sound! Probably very glitchy, but maybe that would be a good sound.

Are you talking about syncing at audio rates to lock oscillators together, or at slow rates to sync the sequencer?
Back to top
View user's profile Send private message Visit poster's website
State Machine
Janitor
Janitor


Joined: Apr 17, 2006
Posts: 2809
Location: New York
Audio files: 24

PostPosted: Tue Mar 31, 2009 9:32 am    Post subject: Reply with quote  Mark this post and the followings unread

Hi Guys !

If anyone would like to submit their PIC based synthesizer music for a radio show "The Soldering Musician" right here on Electro Music radio hosted by me, please jump over to this thread and take a peek at the details. Show times are being worked out and I am in the gathering mode.

Also, spread the word for submissions to others that would be inetersted in having their music played over our radio station ....

Make your music be heard .... Cool

http://electro-music.com/forum/post-236524.html#236524

Thanks for your participation !
Bill
Back to top
View user's profile Send private message Send e-mail
monokinetic



Joined: Aug 01, 2006
Posts: 100
Location: prague

PostPosted: Tue Mar 31, 2009 1:56 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hi yerpa58,
Sorry I missed your reply, I must have accidentally unsubscribed to this thread and thought no one had answered.

I was thinking about the possibility of sync the sequencer which is in the PIC synth (mainly used in the FM synth patch as far as I can tell). Cat weazle mentions some free pins so I was thinking about wiring one up to a clock signal on the modular, then modifying the current code to take the PIC synth sequencer advance from clock pulses on this pin.

Don't know if that makes sense, it's pretty late Smile

I think I'm gonna try it, as soon as my lunetta is boxed Wink

David
Back to top
View user's profile Send private message
jksuperstar



Joined: Aug 20, 2004
Posts: 2503
Location: Denver
Audio files: 1
G2 patch files: 18

PostPosted: Tue Mar 31, 2009 11:12 pm    Post subject: Reply with quote  Mark this post and the followings unread

I'd love to hear samples!
Back to top
View user's profile Send private message Visit poster's website
nickca



Joined: May 02, 2009
Posts: 1
Location: Austin, TX

PostPosted: Sat May 02, 2009 11:41 am    Post subject: Reply with quote  Mark this post and the followings unread

Hi,
I've built the PICsynth and it mostly works great, except I'm having the same problem as someone earlier in the thread: the FM sequencer mode doesn't seem to work at all. All I get are clicks. If I turn the volume way up, I can barely hear some tones and affect them with the knobs, but other than that nothing. All the other modes work fine, and there's no problem with the wiring, etc. that I can determine. I did use the proper PIC (18F4620) so for the other guy that was having the same problem, it isn't because he used a different model of PIC. I'm using the latest available firmware (PICsynth.hex, dated 4-01-0Cool.
Back to top
View user's profile Send private message
catweazle



Joined: Feb 25, 2008
Posts: 28
Location: germany
Audio files: 3

PostPosted: Mon May 04, 2009 1:44 am    Post subject:   Reply with quote  Mark this post and the followings unread

I recommend to use yerpa58 latest Firmware hex, because it is the most up to date one.

About the Step-Sequencer, you have to select a step (with pot2, the display shows the step number), then turn the pitch knob (i think it was pot3) from left limit to right limit (you have to catch the old value with the pot).
then it should make some noise.

hope that helped
gtz eric
Back to top
View user's profile Send private message
yerpa58



Joined: Mar 08, 2008
Posts: 57
Location: Wisconsin
Audio files: 4

PostPosted: Tue May 05, 2009 7:15 pm    Post subject: Reply with quote  Mark this post and the followings unread

Here is a sample from a new algorithm #6 using wavetables and delay in the fraktal synth. I have two wave tables, one is sine and the other is triangle. I use two 16-bit pointers into the tables, one for each voice. Then there are 16-bit tables of note values that are related by the 12th root of 2. There are eight of these tables with the same notes in various orders and octaves. One voice is the lead voice (triangle) and the 2nd voice (sine) follows behind with a delay that can be adjusted (knob) from zero to about 20 seconds. A 2nd knob determines which note table the lead voice uses, and a third knob determines which note table the delayed voice uses. Finally, a 4th knob moves the lead voice back and forth thru its selected note table. A simple slow decay envelope is used for amplitude. That is the only multiply instruction used here. I have three unused knobs in this patch, so I might add envelope control. I like "backwards" envelopes.

I'll post the code soon, but my ISP just locked me out because I mis-typed my passowrd three times! Argggh.


fraktal_6.MP3
 Description:

Download
 Filename:  fraktal_6.MP3
 Filesize:  1 MB
 Downloaded:  906 Time(s)

Back to top
View user's profile Send private message Visit poster's website
monokinetic



Joined: Aug 01, 2006
Posts: 100
Location: prague

PostPosted: Tue May 05, 2009 10:16 pm    Post subject: Reply with quote  Mark this post and the followings unread

Nice demo sample Yerpa58 Smile

And wow great that you have been working on another new algorithm!

Hope you get the ISP problem sorted out and let me know when the new firmware is available for testing, I'll happily try flashing it into my new box Very Happy

David
Back to top
View user's profile Send private message
yerpa58



Joined: Mar 08, 2008
Posts: 57
Location: Wisconsin
Audio files: 4

PostPosted: Sun May 10, 2009 9:41 pm    Post subject: Reply with quote  Mark this post and the followings unread

Thanks monokinetic! Here is the code, including the hex file all in one zip folder. I restored the original display cryptics and made a bunch of mods to the sequencer portion, too. Now, you don't have to re-fetch old values to change a sequencer steps, it is always reading the 3rd and 4th pots for step and value info. Combined with the reverse switch, you can quickly put some nice little live forwards/backwards sequences together.
Back to top
View user's profile Send private message Visit poster's website
yerpa58



Joined: Mar 08, 2008
Posts: 57
Location: Wisconsin
Audio files: 4

PostPosted: Sun May 10, 2009 9:43 pm    Post subject: Reply with quote  Mark this post and the followings unread

Sorry, I forgot to include the code:


picsynth6.zip
 Description:

Download
 Filename:  picsynth6.zip
 Filesize:  73.93 KB
 Downloaded:  381 Time(s)

Back to top
View user's profile Send private message Visit poster's website
oootini



Joined: Oct 15, 2007
Posts: 80
Location: ireland

PostPosted: Mon May 11, 2009 2:37 am    Post subject: Reply with quote  Mark this post and the followings unread

wow! can't wait to load this up tonight. thanks yerpa!
Back to top
View user's profile Send private message MSN Messenger
yerpa58



Joined: Mar 08, 2008
Posts: 57
Location: Wisconsin
Audio files: 4

PostPosted: Mon May 11, 2009 8:40 pm    Post subject: Reply with quote  Mark this post and the followings unread

Here is an example of what it sounds like. I'd like to find a better amplifier circuit, like a class D amp, to save battery and make it LOUDER. Must be cheap and simple, though. Have fun!


fraktal_seq.MP3
 Description:
frAktal synth fm sequencer

Download
 Filename:  fraktal_seq.MP3
 Filesize:  1.78 MB
 Downloaded:  817 Time(s)

Back to top
View user's profile Send private message Visit poster's website
oootini



Joined: Oct 15, 2007
Posts: 80
Location: ireland

PostPosted: Tue May 12, 2009 2:56 am    Post subject: Reply with quote  Mark this post and the followings unread

Weird. Loaded this up last night and to the best of my knowledge, the synths remained the same from my previous version. After the hex loaded I got an error similiar to: "error at line x 00000" message.

Does that mean the hex didn’t load properly?

i definately haven't got anything sounding even remotely like your samples yerpa...
Back to top
View user's profile Send private message MSN Messenger
catweazle



Joined: Feb 25, 2008
Posts: 28
Location: germany
Audio files: 3

PostPosted: Tue May 12, 2009 6:22 am    Post subject: Reply with quote  Mark this post and the followings unread

@thrush
it seems that the new hex file wasn't uploaded.
Maybe you have choosen the wrong controller in your upload
Try erasing the chip before programming

@yerpa
wow, thanks a lot for debugging the stepsequencer and inventing
new algorithms. Nice work!
I had implementet the catch the value thing in the stepsequencer because my pots where a bit unstable so the steps changed unwanted.

I hope I'll get my picsynth back soon ... or built a new one if I had some time.
I'm thinking of a arpeggiator alg (often used in chiptunes, well known on many C64 SID tunes).
Back to top
View user's profile Send private message
monokinetic



Joined: Aug 01, 2006
Posts: 100
Location: prague

PostPosted: Tue May 12, 2009 7:20 am    Post subject: Reply with quote  Mark this post and the followings unread

(Note, this is a continuation of a question I asked earlier in the thread, apologies it's such a delayed reply, school took over for the last month!)

yerpa58 wrote:

Are you talking about syncing at audio rates to lock oscillators together, or at slow rates to sync the sequencer?


My idea was syncing the sequencer section to external gear....

Today I have been looking into the PICSynth code (again!) to try and find a way to do some basic syncing. The original description at circuitbenders.co.uk mentioned MIDI and various other tempting ideas! I'm pretty new to C on Microchips, but I thought I'd try at least....

My plan was to initially just test slaving the PICSynth sequencer to a +5 trigger being sent to a free PIC pin. I can generate these triggers using my MIDIBOX Sequencer. For initial experiments I was going to send a highspeed clock because it seems that the CLOCK variable is being updated every cycle, I guess this is why it is being divided down by 127 internally....

One problem I have is identifying exactly where in the source code I should declare a PIC pin to be an input which I can read for triggers. Any suggestions?

My guess in terms of using the trigger as a clock is that I can put a conditional in the application.c file, section void APP_Task (void) which updates the CLOCK variable each time the sync input pin goes high. Then comment out the CLOCK++ parts under the conditional switch(ALGORITHM).

Does anyone more knowledgeable than me think I'm at least heading down the right path? Smile

Thanks in advance

David
Back to top
View user's profile Send private message
yerpa58



Joined: Mar 08, 2008
Posts: 57
Location: Wisconsin
Audio files: 4

PostPosted: Tue May 12, 2009 8:22 am    Post subject: Reply with quote  Mark this post and the followings unread

Hello all,

@monokinetic,

I think you are heading down the right path. You will have to look for the transition on the trigger input and use that to advance to the next step. I'd like to take the part of the code where the input pins are read, and move it to the routine where the a/d converter is read so that the pin values are available at any time from other parts of the program.

I don't have much external gear so I'm trying to keep everything self-contained, but I could help you debug and test your idea. I would probably use one of the extra switches to select Trigger Internal/Trigger external.

@thrush:
Like catweazle said, I don't think your hex file loaded. I hope the file is not corrupted, I will try when I get home.

@catweazle:
It has been a pleasure working with this project. Thank you for making the original code and schematics available. I will do the same. For my next experiment on the fraktal synth for algorith #7, I would like to use a timer interrupt to set a precise sample rate to make chromatic tuned notes, probably using the fm algorithm, with a knob for pitch bend. If I find a better audio amp, I'd lay out a new PC board.
Back to top
View user's profile Send private message Visit poster's website
monokinetic



Joined: Aug 01, 2006
Posts: 100
Location: prague

PostPosted: Tue May 12, 2009 8:35 am    Post subject: Reply with quote  Mark this post and the followings unread

Hi yerpa58,
Thanks for the speedy reply and offer of help Smile I guess by now you are pretty knowledgeable about the code!

I'm just throwing ideas around at the moment to be honest, I've got 2 days downtime now before next round of Uni exams, so I won't have much time to do this straight away. But I'll get the trigger out hardware working from the MB Seq this weekend at least. Code experiments to follow after that, expect more questions Wink

In the meantime I'm going to upload your new .hex for some more noises!

David
Back to top
View user's profile Send private message
catweazle



Joined: Feb 25, 2008
Posts: 28
Location: germany
Audio files: 3

PostPosted: Wed May 13, 2009 6:15 am    Post subject: Reply with quote  Mark this post and the followings unread

@yerpa
If you layout a new board maybe the simple lowpass filter mentioned from gmeredith in the circuitbenders.co.uk forum
http://www.circuitbenders.co.uk/forum/forums.html/topic,494.0.html
it sounds good and is very small.

@monokinetic
I recommend a look in the PIC datasheet
http://ww1.microchip.com/downloads/en/DeviceDoc/39626b.pdf

You can use a MIDI-to-DinSYNC Box to convert MIDI to simple control Clock, Start, Stop Signals
http://www.doepfer.de/faq/gen_faq.htm#Sync

All Pins on Port B (PB0..7) can be set up to trigger an interrupt on change. So you can connect the Clock signal to PB2 for example and setup a interrupt service routine that increments the step counter.
But DIN Sync clock is 24pulses per quarter note so that have to be divided by 24

Maybe a switch to select internal/external sync were useful then.
Back to top
View user's profile Send private message
catweazle



Joined: Feb 25, 2008
Posts: 28
Location: germany
Audio files: 3

PostPosted: Wed May 13, 2009 6:30 am    Post subject: Reply with quote  Mark this post and the followings unread

In the "DSP_Sequencer.c"

Function void DSP_SEQ_Do (int1 reverse)

this part could be replaced
Code:
   // sequencer timer
   SEQ_clockdiv--;
   if (SEQ_clockdiv != 0) return;
   SEQ_clockdiv = 0x7f;
   //


by this (without using a interrupt service routine)

Code:
  static int1 triggerflag = false;
  static int8 triggercnt = 0;

  // external trigger
  if (input(PIN_B2) && !triggerflag )
   {
      triggerflag = true;
      triggercnt++;
    }

  if (!input(PIN_B2)) triggerflag = false;

  if (triggercnt<24) return;

  triggercnt  = 0;

  //
 



Not shure if this work correctly, more an idea than a complete solution
Back to top
View user's profile Send private message
monokinetic



Joined: Aug 01, 2006
Posts: 100
Location: prague

PostPosted: Wed May 13, 2009 6:49 am    Post subject: Reply with quote  Mark this post and the followings unread

@catweazle:

you are a gentleman, thanks for the pointers Smile

Eventually I'd like to think about sync24, but for the time being I'll just focus on the +5v triggers from my MIDIBOX Seq (which can be configured to do Sync 24 later!)

As I mentioned, I won't get much time to play with this for a few weeks, but those tips already help me to investigate further.

If/when I come up with something useful I'll be sure to post it here for others to share....

David
Back to top
View user's profile Send private message
yerpa58



Joined: Mar 08, 2008
Posts: 57
Location: Wisconsin
Audio files: 4

PostPosted: Sun Aug 30, 2009 12:11 pm    Post subject:
Subject description: Added vibrato to the fraktal synth code
Reply with quote  Mark this post and the followings unread

There is a register in the PIC chip that can be used to adjust the clock frequency up and down. It is called OSCTUNE. I use the second switch (used to be "PLAY") to turn the vibrato on and off. It only sounds good on the "Birds" and "Plucked String" algorithms. Also this version uses the REVERSE switch to invert the envelopes for "Birds".

I made a little video to demonstrate:

http://www.youtube.com/watch?v=8QzSL3Nc2Qk

and the code is attached below.

Eight bits is fun, and I still have space for lots more algorithms. The next one will be an ambient harmonic pad algorithm.


vibrato.zip
 Description:
All the source and hex that you need.

Download
 Filename:  vibrato.zip
 Filesize:  74.35 KB
 Downloaded:  339 Time(s)

Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Moderators: State Machine
Page 5 of 8 [195 Posts]
View unread posts
View new posts in the last week
Goto page: Previous 1, 2, 3, 4, 5, 6, 7, 8 Next
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Microcontrollers and Programmable Logic
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use