0
\$\begingroup\$

I am collaborating with a friend on a synthesizer project, but I am very new to embedded systems design. I have a solid background in software engineering but am a greenhorn when it comes to embedded design.

A little description of the project: my friend has built an analog synthesizer that has ~20 potentiometers that control the same amount of synthesis parameters. Being an analog synthesizer, these pots directly control the voltage that goes to the various parameters. We want to put a microcontroller between these pots and their parameters that will enable us to save and recall patches, effectively bypassing the voltage that the pots are set at. The basic flow for one of these pot/parameter combos with a microcontroller involved would look as such:

Potentiometer -> ADC -> Microcontroller -> DAC -> Analog synth parameter 

There will effectively be two modes of operation: realtime control (the analog value read in from the pot is outputted to the parameter unmodifed) and recall mode (the user recalls a saved patch, and instead of the potentiometer's value a recalled value would be outputted to the parameter. If the pot is moved, then the pot's value is used.)

I have been able to build a prototype that can demonstrate this functionality on an MSP430 board for one pot/parameter pair, but the problem is that the board has very limited ADCs and DACs. My question is, how do I go about finding a board that can support the number of ADCs and DACs that I need? Would I have to use multiple microcontrollers? Is there such a thing as an ADC/DAC multiplexer? What is the best practice for this type of scenario? This is where the world of embedded systems alludes me.

Another thing to add is that we are also concerned with sampling rate, as anything that is too low might sound too "jagged" when turning the pots, but we figure this is something we will have to test with our ears before settling on a number. We have, however, decided that we want to have at least 10 bit resolution for the ins and outs.

Any advice would be greatly appreciated.

\$\endgroup\$
5
  • \$\begingroup\$ You might consider using an "optical encoder" instead of the pots (yes, they also come in mechanical, but I'd recommend optical.) Such an encoder can rotate freely in either direction (with or without stops to prevent continuous rotation) and provides a quadrature output that lets you tell the direction. No ADC required for this. And this way, you can use it to adjust things "relatively" instead of "absolutely." You can also get them gray coded for absolute position, too. But I suspect you may be happier with the regular quad-coded devices. Some have a "home" pulse, too. \$\endgroup\$
    – jonk
    Commented Nov 14, 2017 at 20:46
  • \$\begingroup\$ As always, you can make PWM in software, you will most likely have a timer available on your µC, if you use the timer in a clever way you can easily turn every pin on your µC to a PWM output. Then add a low pass filter to every individual pin and you'll be set DAC wise. Or just get a shift register and make an 8 bit R-R2 ladder for every DAC. Less noise, physically larger. Or make 8 PWM's out of one shift register, with a huge RC constant. \$\endgroup\$ Commented Nov 14, 2017 at 20:47
  • 1
    \$\begingroup\$ There are also programmable nonvolatile digital pots to examine, as well. Have you considered these? \$\endgroup\$
    – jonk
    Commented Nov 14, 2017 at 20:48
  • \$\begingroup\$ Master clock can generate accurate frequencies but you have to consider multiple digits with N key roll-over , modulation and VCO's and VCA with attack/decay usually best done in analog. Although early Japanese synth's were pure digital and sounded this way too. I concur with Jonk's suggestion of `miniature rotary ' quadrature encoders for adjustments to digital values. I bought a keyboard with all these features for $10 used and 100 synth sounds for each mode \$\endgroup\$
    – D.A.S.
    Commented Nov 14, 2017 at 21:14
  • 2
    \$\begingroup\$ I believe I already answered your question on Reddit. :) \$\endgroup\$
    – user39382
    Commented Nov 15, 2017 at 2:34

2 Answers 2

1
\$\begingroup\$

If I had to do it this way I would consider something like the Dallas DS2450 1-Wire Quad A/D Converter. These feature a very simple data-bus and you can daisy chain more than enough for your synth application.

The big problem - and it could render the system useless - is that it will be very difficult to edit a patch. If you recall a patch then your pots are no longer in control and don't show you the settings. (The pointer positions won't bear any relationship to the settings.) To change a patch you would have to activate the knobs again and re-enter the patch.

One small possibility is that you reload a patch and then monitor the pots. If you sense that one is being adjusted you switch to live mode for that pot. This would require that you create a deadband so that random ADC noise does not falsely trigger reversion to the knob. It would be a little weird: if the patch is at 80% and the pot at 20% with a 5% deadband then adjusting to > 25% would make the pot take over and that parameter would jump from 80 to 25%. You would then adjust back to 80% by ear and start the adjustment from there.

Interface modules are available for the Dallas 1-wire system. I recommend these as they remove the critical timing requirements from the CPU to an external device.

\$\endgroup\$
-1
\$\begingroup\$

There are certainly microcontrollers available with 20 analog inputs. That's not really that hard. Since humans are turning the pots, you only need to respond to new values in human time.

I'd set up the A/D to scan all the channels with maybe a 10 µs period. That means any one channel gets scanned every 200 µs. That's much faster than you need, but allows you to do some low pass filtering on each signal. That can be quite aggressive, since the only downside is a perceived lag to a human user. For example, two poles of low pass filtering per channel with a filter fraction of 1/26 each pole gets you a 90% settling time in just under 50 ms. That's still instantaneous in human time, but will attenuate random noise and give a smooth feel to the pots.

At this point you have 20 live pot values inside the microcontroller with most of the cycles still available. Instead of outputting these to the existing analog system, I'd implement the synthesis in the microcontroller too. If you want a new value to output to a D/A at 40 kHz, for example, then you have 25 µs to compute each new sample. That's 1750 instructions on a 33EP series dsPIC, for example. Even after the cycles to handle the A/D readings, you still have well over 1000 instructions left. That's a lot to add up a bunch of sine waves.

Thinking about this more, I'd probably sync the A/D sampling with the computation and outputting of new samples. That still leaves you with over 60 samples per channel within the 50 ms human instantaneous time.

\$\endgroup\$
1
  • \$\begingroup\$ Whoever downvoted this, what do you think is wrong? \$\endgroup\$ Commented Nov 17, 2017 at 22:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.