poly synth - how to handle modulation?

From circuitbending to homebrew stompboxes & synths, keep the DIY spirit alive!

Moderators: Kent, Joe., luketeaford, lisa

Post Reply
User avatar
Dimitree
Veteran Wiggler
Posts: 667
Joined: Mon Aug 01, 2011 9:59 am

poly synth - how to handle modulation?

Post by Dimitree » Thu Mar 26, 2020 7:49 am

so I’m trying to design my own polyphonic synth, just for fun, not a design I intend to produce.
I designed the basic voice board, so two VCOs, a VCF and a VCA. Each of those section have its CV input for every parameter I want to control (0V to 5V). There will be a microcontroller for each voice, a DAC (I still haven’t decided how many channels) and probably a multiplexer (to multiplex the DAC outputs to all the CV inputs). The LFO and EGs will be generated by the microcontroller, and the pitch information too.
Now I’m wondering how I should implement the modulation scheme. I mean, I don’t have any VCA on the CV inputs, so how should I set the amount of modulation for each:

1. add some VCA on every CV input I want to modulate, so the amount of modulation would be controlled by a voltage from the DAC
2. do the math inside the microcontroller, so the CV inputs will get a modulated voltage instead of a steady voltage. For example, cutoff CV point will get a single voltage that is calculated by the microcontroller like this: [(LFO*amount)+(EG*amount)+cutoff control]

first option would require more parts and more CV lines (those feeding the VCAs), second option would probably need more resolution on the DAC than usual to get good results. Am I wrong?

what do you think?

JanneI
Wiggling with Experience
Posts: 385
Joined: Mon Oct 19, 2015 3:28 am

Re: poly synth - how to handle modulation?

Post by JanneI » Thu Mar 26, 2020 7:53 am

All in microcontroller, except vco1->vco2 FM and VCO1->VCF FM.

User avatar
guest
Super Deluxe Wiggler
Posts: 4716
Joined: Mon Aug 19, 2013 11:49 am

Re: poly synth - how to handle modulation?

Post by guest » Thu Mar 26, 2020 7:55 am

personally, i would do it with the DACs. this allows it be saved and recalled. voice consistency is important for a polysynth, and its much easier to be consistent in digital. 16b audio DACs are pretty cheap, and have plenty of resolution for most things.
openmusiclabs.com

User avatar
Dimitree
Veteran Wiggler
Posts: 667
Joined: Mon Aug 01, 2011 9:59 am

Re: poly synth - how to handle modulation?

Post by Dimitree » Thu Mar 26, 2020 9:34 am

thank you both!
JanneI wrote:
Thu Mar 26, 2020 7:53 am
All in microcontroller, except vco1->vco2 FM and VCO1->VCF FM.
I don't have those two FM planned on this synth, so I guess I can skip that.. My only source of modulation are LFO, EG and keyboard/velocity/aftertouch, and the control potentiometers of course
guest wrote:
Thu Mar 26, 2020 7:55 am
personally, i would do it with the DACs. this allows it be saved and recalled. voice consistency is important for a polysynth, and its much easier to be consistent in digital. 16b audio DACs are pretty cheap, and have plenty of resolution for most things.
I was thinking about chaining 2x 12bit DAC, like the MCP4822 (cheap dual 12bit DAC in a single package) to get almost 24bit, at least for the VCO pitch and VCF. Does it sound reasonable, or overkill?

User avatar
guest
Super Deluxe Wiggler
Posts: 4716
Joined: Mon Aug 19, 2013 11:49 am

Re: poly synth - how to handle modulation?

Post by guest » Thu Mar 26, 2020 12:14 pm

Dimitree wrote:
Thu Mar 26, 2020 9:34 am
I was thinking about chaining 2x 12bit DAC, like the MCP4822 (cheap dual 12bit DAC in a single package) to get almost 24bit, at least for the VCO pitch and VCF. Does it sound reasonable, or overkill?
i recently did a really thorough anlaysis of DACs for the exact purpose. i should post it up at some point. the idea was to compare the cost to effective bit depth of various control options. the conclusion i came to, was that using a lower resolution DAC followed by an exponential converter was a pretty good option, depending upon your auto-calibration routine. i dont have my notes handy, but the general gist is:

1. for non-frequency things, a 12b DAC is usually plenty (your LFO, EG, etc). the ear isnt so sensitive to amplitude, so as long as there isnt zipper noise, and as long as its consistent, its probably fine. and i would suggest, that within reason, zipper noise is more of a sample rate issue.

2A. for frequency things, you need to be precise. ideally, you would like to be able to tune to under 3cents. so, you can either tune digitally, or in analog. if doing the tuning in analog, then you just need a very stable, linear circuit, and 120 very equally spaced digital steps (if you want the full range of human hearing). so the DAC requirements become easy, but the circuit requirements become pretty stiff, and there isnt room for auto-tuning, or switching to different tunings digitally. so digital tuning is probably preferred.

2B. for digital tuning, you need a 12-14b DAC if using an expo converter, or 18-20b if using a linear core. the main problem with most of the schemes i could come up with the linear cores, was that the noise floor was too high. by the time you get over 14b, the noise really starts to dominate for any reasonable frequency response of the DAC. so you can tune just fine, but there will be noticeable jitter and maybe powersupply related modulation of the frequency. for higher frequencies this isnt an issue, but the lower bass notes are really effected. so the cost of the DAC goes up. if you have a 20:20k frequency range you want to cover, and your DAC is 0-5V, then 20Hz is 5mV. that doesnt sound so bad, but a drift of 300uV (or noise or whatever) puts you up at the next note, which means 3uV is 1 cent. i built up a VCO to test it out, using a 24b audio DAC, and it worked, but the low notes werent great. i think it could be made to work, but a lot of attention would need to be paid to layout.

3. building high order DACs out of 2 or more low order DACs has very quickly diminishing returns. the first thing to do, is to check the accuracy and linearity of the DACs youre thinking of using. the cheap 12b DACs are often only good to 10b or so. and, if you want to stack your DACs up, you will need to resistor mix them with resistors that have accuracy better than the resolution of the DACs. so 2x10b DACs need 0.1% or better resistors. and the output impedance of the DAC starts to come into play really quickly, as 1:1000 ratio resistors span quite a range, and you cant use >~1M resistors without worrying about capacitive and leakage effects, so the other resistor is around 1k, which needs to be accurate to within 1ohm.

4. you can always use better digital or analog techniques to tradeoff the precision of each subsystem. for example, the more linear your VCO can be, the less tolerance you need on the DACs. or, you can completely calibrate your DACs, and figure out what their relative offsets/linearities are, and then playback from a lookup table or model of the DAC. this latter technique could be used with resistor mixing, where one DAC does the rough notes, and the other does fine tuning and modulation (as long as modulation is within the range of the fine DAC - once you have to use the main DAC in conjunction with it, you have calibration issues again). also, if using a linear core, the fine tune range is very different at the high end versus the low end.
openmusiclabs.com

User avatar
Dimitree
Veteran Wiggler
Posts: 667
Joined: Mon Aug 01, 2011 9:59 am

Re: poly synth - how to handle modulation?

Post by Dimitree » Thu Mar 26, 2020 2:36 pm

I also found this in about the Oberheim Xpander

Image

Image

User avatar
guest
Super Deluxe Wiggler
Posts: 4716
Joined: Mon Aug 19, 2013 11:49 am

Re: poly synth - how to handle modulation?

Post by guest » Thu Mar 26, 2020 3:06 pm

this only gives a 3x increase, which is not even an extra 2bits, so slightly less than 16b. the tolerance on the mixing resistors is a function of their ratio, so if you just want an extra 6bits, lets say, then standard 1% would be fine. one advantage to resistor mixing, is that a lot of the error terms on the very low bits get scaled back into a reasonable range, helping to get a little better accuracy than a straight up 20b converter might do. this sample and hold scheme, though, adds a number of error terms. the leakage on the capacitor, the offset in the opamp, the resistance in the switch, etc.
openmusiclabs.com

User avatar
Dimitree
Veteran Wiggler
Posts: 667
Joined: Mon Aug 01, 2011 9:59 am

Re: poly synth - how to handle modulation?

Post by Dimitree » Thu Mar 26, 2020 3:17 pm

ok I see,
then I'd say I will use 16 bit DAC for everything, if I understand well, is good enough for the task (the VCO is exponential, a classic design).
If so, now I need to understand how many channel I need, if I can multiplex a single DAC or use more than 1.. I will do some math

User avatar
guest
Super Deluxe Wiggler
Posts: 4716
Joined: Mon Aug 19, 2013 11:49 am

Re: poly synth - how to handle modulation?

Post by guest » Thu Mar 26, 2020 3:29 pm

14b gives better than 1cent resolution, so 16b will be plenty. 8 channel audio DACs can be had for a few dollars, but they vary in DC accuracy. ive found cirrus to have the best specs in this regard. they are more difficult to work with than a normal DAC.
openmusiclabs.com

User avatar
Dimitree
Veteran Wiggler
Posts: 667
Joined: Mon Aug 01, 2011 9:59 am

Re: poly synth - how to handle modulation?

Post by Dimitree » Thu Mar 26, 2020 4:11 pm

looks like I may need 12 cv each voice..do you think a pair of ATMEGA328P+DAC for each voice could handle that?
I think I need to find the right balance between DAC channels / microcontroller resources / multiplexing / fastest sample rate I need

the CVs:
1, 2) vco1/vco2 pitch
3) vco 2 beat frequency
4, 5) pwm
6,7,8) vco1/vco2/sub level
9) vcf cutoff
10) vcf mode (blends between HPF, LPF and BPF)
11) vcf resonance
12) vca

User avatar
guest
Super Deluxe Wiggler
Posts: 4716
Joined: Mon Aug 19, 2013 11:49 am

Re: poly synth - how to handle modulation?

Post by guest » Thu Mar 26, 2020 6:51 pm

the atmega cant handle the 8 channel audio DACs at full audio rate. what is the max frequency you think you might need for the various DACs? what differentiates 3 from the difference of 1 and 2? 4-8,10,11 could be pretty low resolution, at least if 6-8,10 are exponential VCAs. so maybe a combo approach would be good of a few 16b and a few 12b.
openmusiclabs.com

User avatar
Dimitree
Veteran Wiggler
Posts: 667
Joined: Mon Aug 01, 2011 9:59 am

Re: poly synth - how to handle modulation?

Post by Dimitree » Fri Mar 27, 2020 8:59 am

yeah you're right, I can probably do without (3) if I do some math (that CV is linear detuning - constant beat rate).
I don't think I need audio rate for the CVs, afterall I'm not doing any audio FM, the fastest transient should probably be the one from the EG (to get snappy attack), so all the others could probably be updated slowly (and filtered to avoid excessive aliasing of course). I once coded a DDS EG/LFO with an Arduino Uno, and it was pretty good, if I remember well the sample rate was 10KHz, and the LUT were quite small, and with no interpolation, so actually the effective sample rate was less.

User avatar
guest
Super Deluxe Wiggler
Posts: 4716
Joined: Mon Aug 19, 2013 11:49 am

Re: poly synth - how to handle modulation?

Post by guest » Fri Mar 27, 2020 9:28 am

you can sometimes run the audio DACs at lower sample rates. ive done this with the WM8731, which i ran with an atemga. you can also run it at 44ksps, but it doesnt leave a whole lot of time for doing calculations and such, and its just 2 channels. you could probably get away with doing one atmega running a 4 channel audio DAC at 4-8ksps, and the other atmega doing 4x dual 12b dacs (or 2x quad - which is cheaper and easier to use).
openmusiclabs.com

User avatar
Dimitree
Veteran Wiggler
Posts: 667
Joined: Mon Aug 01, 2011 9:59 am

Re: poly synth - how to handle modulation?

Post by Dimitree » Fri Mar 27, 2020 11:08 am

yes, or I could just copy what they used to do in the 80's, using a single DAC and a multiplexer.. Probably not the best quality but I don't have to worry about studying/testing new uC/DAC that I haven't used before

User avatar
guest
Super Deluxe Wiggler
Posts: 4716
Joined: Mon Aug 19, 2013 11:49 am

Re: poly synth - how to handle modulation?

Post by guest » Fri Mar 27, 2020 11:13 am

very true. in that case, one of those quad DACs could have a few channels dedicated to more precision/higher bandwidth work, while the other channels are multiplexed with S/H circuits.
openmusiclabs.com

User avatar
Dimitree
Veteran Wiggler
Posts: 667
Joined: Mon Aug 01, 2011 9:59 am

Re: poly synth - how to handle modulation?

Post by Dimitree » Fri Mar 27, 2020 12:39 pm

another clever explaination from the Oberheim Xpander service manual!
looks like it uses a really low sample rate, and bypass the antialias filter when required

Image

User avatar
Dimitree
Veteran Wiggler
Posts: 667
Joined: Mon Aug 01, 2011 9:59 am

Re: poly synth - how to handle modulation?

Post by Dimitree » Sat Mar 28, 2020 11:35 am

I gave a look to some service manuals of famous old poly synths,
looks like the rate for multiplexing is always quite low..and they control a lot of CV,
for example:
Juno 106 = 4mS loop, 23CVs
Oberheim Xpander = 10mS loop
Prophet 5 = 6mS / 11mS loop, 38CVs

everyone love those synths,
so I'd say, with an ATMEGA328p + single 16bit DAC, and only 12 CVs (at most) and no need for audio rate modulation, I think I can be even faster than that, if needed.
I'll follow this route for now

omniaurasynths
Learning to Wiggle
Posts: 2
Joined: Mon Oct 26, 2020 12:30 pm

Re: poly synth - how to handle modulation?

Post by omniaurasynths » Mon Oct 26, 2020 7:14 pm

Dimitree, how is your project going? I'm creating a polysynth using the AS3394 synth voice-on-a-chip, and 16bit DAC and mux method (CD4051). 8 CVs per voice. From your prophet 5 example, then we could control 4 voices with one DAC. Or would you recommend one DAC per voice?

Post Reply

Return to “Music Tech DIY”