Posts Tagged ‘Arduino’

    AVR Synthesizer

    Sunday, March 29th, 2009

    So there are a couple AVR based synthesizers out there already.  But they are all either written in (ew) ASM or want to talk to SID chips (don’t own one) or are otherwise not interesting.

    IMG_2605.JPG So a couple months ago I got one of the AVR Pocket Piano shields from Critter and Guitari.  This is an entertaining little Arduino shield with 25 buttons, three sampled pots, a volume control, an LED, and a microchip 12-bit DAC.  There are a few firmwares around to help the thing make some interesting (or not) sounds.   However they are all quite limited.  And interest in the thing seems to have deteriorated.  I took the (to me) most interesting firmware, a monophonic 1 operator DDS FM synthesizer and promoted it to three voices.  However, only having three pots was cramping my ‘creativity’, so I needed to find something else.

    IMG_2602.JPG IMG_2603.JPG Then a couple weeks ago I saw mention of the newish KORG nanoKONTROLER series. These are very small usb-midi controllers. There are three: a keyboard, a controller, and a drum pad. I went into Guitar Center to look at the keyboard and ended up walking out $120 poorer with both it and the controller. The included software from KORG sucked but was good for one evening’s entertainment. Then getting the linux synths like bristol kept me entertained for a few evenings more.

    But then I was bored again.

    So what to do?

    If A is fun, and B is fun, then A+B must be superfun! So I ended up with this pile of USB cables, some perl, and some more changes to the FM AVR code.  And ended up with this thing:

    IMG_2600.JPG

    Due to the extra controls, I was able to add a second FM operator and an LFO.  So you have three ‘true’ sounds to play with, plus the LFO.

    Like so:

    1. ‘carrier’ frequency.  This is the key you hit and the setting of Slider 1.  Slider one is the pitch of the whole keyboard.
    2. FM Modulator One. This is controlled by Slider and Knob 2 on the controller.  The slider is the amount of modulation, the knob is the frequency relative to the note being played.
    3. FM Modulator Two.  Same as above.
    4. PLUS the LFO goes just into the audible range if you bump it up that high.  It is controlled by Slider and Knob 9.

    Whew.

    To make this simpler I went back to the original monophonic FM code.  At some point I will probably try to add back a second or third voice.  Though given the extra processing required for the second operator and the LFO, i’m not sure there is time available.

    The AVR speaks a very limited dialect of MIDI.  I use a small perl program to shuffle midi data from the ALSA midi inputs (the AVR can’t talk straight to the USB midi devices, of course) to the AVR and also print out its console.

    Looking for something?

    Use the form below to search the site:

    Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

    Visit our friends!

    A few highly recommended friends...

    Archives

    All entries, chronologically...