Circuitbenders Forum

Circuitbenders Forum => Circuitbending discussion => DIY Synths => Topic started by: Gordonjcp on October 23, 2010, 03:27:28 PM

Title: AVR-based hybrid synth
Post by: Gordonjcp on October 23, 2010, 03:27:28 PM
I thought I'd take a moment from enjoying the late October sunshine to post some pictures of a thing I'm working on:

http://www.gjcp.net/media/avrsynth.jpg (http://www.gjcp.net/media/avrsynth.jpg)
http://www.gjcp.net/media/filter.jpg (http://www.gjcp.net/media/filter.jpg)

and some audio, featuring a well-known bubbly synth riff:
http://www.gjcp.net/media/filtertest.ogg (http://www.gjcp.net/media/filtertest.ogg)

Levels are a bit odd and there's a lot of background noise because I'm using a crappy soundcard.  Reverb is from an Alesis Nanoverb, on the second half of the recording.

It's a simple hybrid synth with an AVR microcontroller providing the envelopes and oscillators, and a Steiner Synthacon-style voltage-controlled filter.  In the pictures above the AVR is on an Arduino board (although I'm not using the bloody awful Arduino IDE) and the filter section is built "dead bug Manhattan-style" on a bit of unetched PCB material.  I haven't constructed the output VCA yet, either - not totally sure it needs one, although the filter in its current configuration can be driven into self-oscillation as you'll hear from the audio clip.

Circuit diagram will be available just as soon as I can be bothered to draw it, code will be available just as soon as I can be bothered putting it on github.
Title: Re: AVR-based hybrid synth
Post by: Circuitbenders on October 23, 2010, 05:47:36 PM
jayzus, the resonance on that filter is a bit on the brutal side!

Looks promising though. What kind of controls are you planning for the AVR side, if any?
Title: Re: AVR-based hybrid synth
Post by: Gordonjcp on October 23, 2010, 06:56:45 PM
I should really be using a 22k pot instead of a 100k pot for the resonance.  I'm not sure how I'm going to implement the UI.  The plan is to have the resonance and cutoff manual controls replaced with digital controls so I can save and restore patches entirely on the AVR.  This also raises the possibility of stacking boards for polyphony.
Title: Re: AVR-based hybrid synth
Post by: Gordonjcp on October 25, 2010, 01:30:57 PM
Annoyingly the serial port interrupt causes a noticable glitch in the audio.  Bugger.  Maybe I need a faster AVR...
Title: Re: AVR-based hybrid synth
Post by: electoyd on October 25, 2010, 08:18:25 PM
good to see someone using some hybrid, and the dead bug style circuit.  think this has good potential though i would like to hear some crunchier noises, and the rez is pretty fierce, though i'm sure the smaller pot will add better contol.   I'm presuming that is what you were building in the photo of your work.
Title: Re: AVR-based hybrid synth
Post by: Gordonjcp on October 28, 2010, 11:03:46 PM
I had a fiddle about with the filter alone based on some things in an article I read about the synth design

http://www.gjcp.net/media/hilow.ogg (http://www.gjcp.net/media/hilow.ogg)

This is my Juno feeding into the highpass input and my Xiosynth feeding into the lowpass input.  As I rotate the cutoff it kind of half mixes half filters between them, giving a very cool and unusual effect.
Title: Re: AVR-based hybrid synth
Post by: electoyd on November 02, 2010, 07:02:22 PM
nice, sounding good! u got any other plans for it?
Title: Re: AVR-based hybrid synth
Post by: Gordonjcp on November 02, 2010, 08:44:17 PM
Still working on the software, trying to make it not glitch when it receives serial data.
Title: Re: AVR-based hybrid synth
Post by: Gordonjcp on December 07, 2010, 01:23:55 AM
Those of you with an Arduino and a PC running Linux might like to play with:

http://www.gjcp.net/blog/2010/dec/06/simple-arduino-based-synth/ (http://www.gjcp.net/blog/2010/dec/06/simple-arduino-based-synth/)

The only real reason for the PC running Linux is that the converter software that passes MIDI out the serial port to the Arduino is written for Linux.  If you adapt the Arduino code to run at 31250 baud and hook an optocoupler to it so you can use a "proper" MIDI input it should work just fine.

Follow the instructions in the linked article about DDS sine generation to see how to hook up the PWM output.
Title: Re: AVR-based hybrid synth
Post by: Gordonjcp on December 07, 2010, 10:38:52 PM
Turns out, it's just about fast enough to do 4-op FM synthesis.  Not *quite* enough using the Arduino libs to get 6-op out of it.
Title: Volunteers needed!
Post by: Gordonjcp on December 09, 2010, 12:19:51 AM
I need people to test the (early, prototype, *buggy*) voice generation code.  You'll need an Arduino with an Atmega 168 or better, a PC running Linux (for the interface software) and some electronics ability - well, about as much as you need to use an Arduino effectively.

A bit later on you'll need to be able to build a fairly complex filter circuit on Veroboard, if you want to add the proper analogue filter.
Title: Re: AVR-based hybrid synth
Post by: Circuitbenders on December 09, 2010, 12:27:43 AM
Linux might be the issue there, though can't it be run from a usb stick? What would you recommend linux wise?

Title: Re: AVR-based hybrid synth
Post by: Gordonjcp on December 09, 2010, 07:33:39 AM
Well, you can run Ubuntu from a live CD although I don't know how that will be for compiling the interface proggy, or running the Arduino IDE.  The alternative would be to test it with the MIDI interface running at 31250 baud and fitting an opto-isolator so it can accept MIDI directly, which is part of the plan but something I wanted to try later rather than sooner ;-)  The other tricky bit is that the voice editing software is unlikely to work in Windows...

To get the speed up enough I've had to ditch a lot of Arduino baggage so the "full spec" version of the software needs to be built outside the Arduino IDE.  I've got a working prototype that *does* work in the IDE.
Title: Re: AVR-based hybrid synth
Post by: Gordonjcp on December 10, 2010, 01:21:34 PM
Can somebody try this software out?

http://www.spikenzielabs.com/SpikenzieLabs/Serial_MIDI.html (http://www.spikenzielabs.com/SpikenzieLabs/Serial_MIDI.html)

Alternatively, I think MIDI-OX does MIDI-to-Serial conversion on Windows.
Title: Re: AVR-based hybrid synth
Post by: Circuitbenders on January 11, 2011, 09:25:02 PM
Ok, well i have an arduino duemilanove board but i have to admit that i have no idea what i'm doing with it at the moment. I got it to build a bitcrusher project i found on the net and never got around to it.

You'd probably be better finding someone who knows how this is meant to work, but i'm willing to give anything a go if you let me know what i should be doing  ;)