Category Archives: newsynth

Building an exponential converter

In this article I’ll describe the steps I took to design an exponential converter. YMMV of course, but I think this article is a good start and may provide some useful guidelines.

The following table shows the relation between Hertz and wavelength. These are the MIDI C notes per octave, in Hz with their corresponding wavelength in ms

8.1757989156 hz
122.312205856 ms

16.3515978313 hz
61.156102927 ms

32.7031956626
30.578051464

65.4063913251
15.289025732

130.8127826503
7.644512866

261.6255653006
3.822256433

523.2511306012
1.911128216

1046.5022612024
0.955564108

2093.0045224048
0.477782054

The required wavelength a capable VCO should be able to deliver thus lays between 122ms and 0.47ms. Experimenting with a slightly customised sawtooth generator (design below) shows the following relation between the (ideal) current source and the wavelength.

0.1ua -> 470ms
1ua -> 47ms
10ua -> 4.7ms
100ua -> 0.47ms (470us)
1000ua (1ma)-> 0.047ms

First, the slightly customised sawtooth VCO. The inverting Schmitt trigger in the sawtooth reset circuit guarantees a long enough reset pulse and thus a clean reset of the sawtooth waveform. The capacitor is too large, leading to a small distortion in the waveform. Will be fixed in updates.

sawtoothVCO600
sawtoothvco in PDF

The current source (exponential converter) must deliver a steady current between 0.1ua and 1000ua to the VCO to have to VCO achieve interesting musical abilities (enough octaves, very low frequencies, MIDI controllable). The deployment of an exponential converter in this current source is almost inevitable. Linear control, preferable digital through DAC’s or such, of a current source with such a bandwidth (0.1ua -> 1000ua) is very difficult.

The circuit of the exponential converter:

expcurrentsource

The formula for the exponential part of the converter is iout = iref * exp(-Vb/Vt) where vt = 26mV.

iref runs over R1 => iref = Vref / Rref = 15V / 1000000ohm = 0.000015A = 15uA. To achieve an output current of 0.1ua (the VCO will generate a 470ms waveform) => 0.1 = 15 * exp(-Vb/26) => Vb = 130mV. Some calculations of Vb in the required bandwidth of 0.1ua and 1000ua:

wavelength: current -> required voltage
470: 0.1ua -> 130mV
235: 0.2ua -> 111mV
118: 0.4ua -> 94mV
59: 0.8ua -> 76mV
30: 1.6ua -> 58mV 
15: 3.2ua -> 40mV
8: 5.9ua -> 24mV
4: 11.75ua -> 6mV
2: 24ua -> -12mV
1: 47ua -> -30mV
0.5: 94ua -> -48mV
0.25: 188ua -> -66mV

This leads to a relation between linear voltage and exponential current! Required to translate a difference of 1 volt to a musical difference of 1 octave (which is a exponential scale).

The voltage into the exponential converter will thus have a 1V/octave scaling and start at 0 volts (130mV) up to 12 volts (-66mV). The base voltage will be 130mV. The voltage scaling opamp will have to scale the incoming voltage (0-12V) to a -18mV per Volt. This voltage is buffered by an opamp follower and a voltage summer then combines the base voltage and the voltage scaler voltage (note to self: make the 1k in the summer smaller for a more precise summer).

voltagescaler

The exponential converter takes this voltage (in V4) and transforms it into a current source following calculations above. Temperature drifting and transistor matching have not been explored in full. For now the CA3046 is deployed. Temperature compensation is probably achievable by driving the other transistors in the CA3046 to a certain temp (like in the Moog Prodigy).

Sawtooth VCO design

Time for a new post and I have an interesting prototype to share with you. Tom Wiltshire over at electric druid (http://www.electricdruid.net/) made a great writeup about the Roland Juno DCO workings (a true must read). Based upon the diagram I decided to give it a go.

from http://www.electricdruid.net/, used with permission.

I did some redesign work, since an Arduino is a very handy a capable device for such applications. So, in general the circuit looks and works like this:

The opamp integrator “fills” the capacitor to generate the upwards ramp. Reset pulses aren’t coming from a 8253 (although I have used those in the past) but from an Arduino generating a PWM wave with a very short “on” time, an almost 0% duty cycle. This results in a direct usable reset pulse for the integrator. This reset pulse is executed by the 4066 switch. When the switch is on, the integrator is set to ground and resets to 0V. The switch is turned off again and the integrating starts again.

Compare both solutions. The Roland DCO uses a programmable divider and a capacitor / resistor / transistor network for the reset pulses (left). My solution uses a PWM signals generated by an Arduino to trigger a 4066 switch ic to reset the integrator (right)

Because the speed of integration varies, the current supplied to the integrator has to vary with that speed. A higher speed (a higher frequency sawtooth wave eg more sawtooths per second) requires more current to nicely reach the upper limit. A lower frequency has to rise slowly towards the upper limit. I solved this with a DAC also controlled by the Arduino. This corresponds to the Roland solution, although the “range switch” is not needed anymore because of the range of the DAC.

The Roland solution had a certain DCO CV which is fed into the integrator via a 4052 switch and a capacitor. My solution uses an Arduino driven DAC (MCP4921) and a opamp buffer to add the required current to the integrator.

In LTSpice, the following circuit was developed and simulated:

click to enlarge. Grab pdf

Simulation results in a nice looking, and more important very raw sounding sawtooth waveform.

Look at it

Listen to it (same example as in a previous post)

I even build a prototype of this design. The PCB design was made in Eagle.

click to enlarge

Unfortunately I cannot find the Arduino code. The idea is that upon a note change (through midi) the new note frequency gets translated to a PWM frequency with duty cycle as close to 0% as possible. This PWM wave is used to trigger the 4066 switch. Furthermore, the DAC needs to be supplied with a value also depended on the requested frequency. This last ratio was experimentally found by me and put in a reference array.

Work is also needed at the “fix” stage: the level shifters (sawtooth should nicely fold around 0V) and the peak to peak voltage. Upon finding the best values for a certain frequency range, the fix stage can be build around that.

Thanks to everybody on the internet for inspiration for this design. Probably used a lot more sources then the ones mentioned in this article!

Impressed by Thor!

Wow! I decided to give Reason 6 a good try. First of all I wanted to recreate the sound of my last analog prototype (see and listen to the previous post). Oh, here’s a picture of that prototype btw:

In Thor I recreated the sound of a single analog oscillator like so:

A single Analog Osc generating a sawtooth waveform, no filters, enveloppe only sustain. Sounds… the same! Listen for yourself:

ReasonanalogFLAC by sinneb

This recording was made via the buildin soundcard of my MacBook. Sound quality will improve when better audio interface hardware equipment is being used. The soundcloud conversion didn’t work out, not in PCM nor FLAC…

My soundcloud comment:

Tough upload, still sounds horrible. It’s not that important, just wanted to let you hear the hard-to-hear difference between my own VCO prototype and a construction in Propellerhead Reason’s Thor synthesizer.

New synth in the works

and here’s an audiofile with a sneak preview of one of the VCO’s.

vco1_test1

This sawtooth is generated through an orange drop capacitor (sounded better then its wima counterpart) in a 100% analog sound path. Reset pulses are generated by an Arduino and the rise of the sawtooth waveform is controlled by a MCP4921 DAC. Each frequencies requires an exact voltage to level out the sawtooth. I haven’t calibrated these voltages yet so the sawtooth isn’t very precise yet. I like the raw sound though!

Progress…

Long time no post. Sorry, real-life is sometimes getting in the way ;)

Recently I bought a Leaflabs Maple R5 to replace my Arduino’s. I really like it. Eventually I ported ChibiOS (realtime OS) to it and tried some software filter algorithms from musicdsp.org. Didn’t make me happy; 72Mhz isn’t enough to do serious audio filtering (at least not using my prototype coding).

New plan: use the Maple for the VCO’s (kind of DCO). Number of voices to be determined. Anti-aliasing virtual analog oscillator code will be constructed using research by Valimaki and Huovilainen. The first hardware voltage controlled versions of the VCF(s) and VCA(s) will be based on my own research regarding the VCF/VCA filter chip in the Roland Juno series. These original Roland chips last usually 15 to 20 years. Right now I’m working on a to be open sourced hardware version of these filterchips. The VCA part is solved using a BA6110 voltage controlled opamp. These aren’t in production anymore (as I know of) but easily obtainable via ebay. I used mooger5’s very valuable research to construct a BA6110 based VCA. His solution (using an SSM2044 for the VCF part):

mooger5, http://www.electro-music.com/forum/topic-17995-25.html, 15 march 2011

The VCA part like drawn by mooger5 is working perfectly! In the next few weeks (busy, busy) I’m going to start working on a VCF part using the LM13700 OTA. Fingers crossed! Resources are the great courses of Aaron Lanterman (Georgia Tech) and, ofcourse, the 80017 VCF/VCA teardown from obsoletetechnology. When the VCF part is working, my plan is to replace the BA6110 with, probably, a LM13700 OTA. This solution will be the base on which I’ll build my own hardware filter and amplifier.

To be continued!

waveshaping 101

Time to start work on waveshaping. My synth is now able to generate 6 voices of musically tuned square waves. Nice, but pretty boring ;). First step is to shape the square wave to a sawtooth wave. This is the square wave from 1 voice:

Inspired by the following waveshaping schematic from the Roland Juno 6,

I came up with the following solution:

The OpAmp is a LM324N, suitable for single +5V power (remember my USB requirement). The transistor is a 2N3904 NPN instead of the PNP used in the Roland schematics. All resistor and capacitor values are determined by the parts I have in my stock. The minus voltage on the capacitor integrator loop is generated via an ICL7660 IC (transforms + voltages into – voltages). Result:

Tada: a sawtooth wave. The peak of the wave is not at 5v because of the maximum output swing of the LM324N OpAmp (+V – 1.5V).

Now I have to find the best values for all the components to generate a normalised saw wave (peak at 3.6v) for all frequencies. My synth should be able to handle all frequencies between 8Hz (midinote 0) and 4000Hz (around midinote 107).

the 5v idea

mmmm what if the entire synth could run on 5v? Just power it over USB. It would make a perfect companion for your laptop but also very easy to install with your desktop PC. The development is also a lot more “portable”. Now I have to work with my own bulky +/-15V power supply. It would be fantastic to just work with an USB cable connection. My MacBook can charge my iPad (1A) so the USB power connection should be powerful enough to drive a (tiny) synthesizer.

Leading to this idea was also the fact that I received my sample MAX7403 8th order lowpass filter chips from Maxim today. These operate at a single 5V power supply  and I think they’ll make great audio filters! Cutoff is addressed via square wave so the Arduino PWM can operate this…

re-welcome at sinneb.com ehhh sinneb.net

Hi all and welcome back,

Because I did not pay in time for my .com domain (I do have some excuses but won’t bore you with them ;) ), it got cancelled and I had to switch to a .net domain. Thinking about it, a .net does actually fit perfectly for this website about the build of a synthesizer. So from now on it’s sinneb.net!

Sorry for the downtime. Let’s get to work!