[Pd] Pd to CV for a Moog (OT)

Martin Peach martin.peach at sympatico.ca
Tue Sep 12 05:49:03 CEST 2006


Chuckk Hubbard wrote:
> On 9/11/06, chris clepper <cgclepper at gmail.com> wrote:
>> Pitch to CV, Envelope Followers and Gates might be of use.
>
> I saw something about envelope followers online.  It seems like that
> ought to do it, with some manual adjustments as always.  Pitch to CV I
> would love to do, I have no idea how.
> Also, a friend suggested generating PWM from my serial port and
> filtering it.  I don't know exactly how a Moog's PWM works, but from
> his description I thought I might just as well generate sine, ramp,
> square, triangle and pulse waves in Pd and run them through the
> filters and envelopes on the synth.  And where's the fun in that?  But
> if no other possibilities work out, I can use that.
You can generate control voltage from a pulse-width modulated square 
wave in pd. Put an envelope follower circuit on the soundcard output and 
probably some more gain. You can do that with a quad op-amp. Problem is 
ripple in the output that can be mitigated at the cost of more portamento.
The more resolution you want the lower the PWM frequency has to be for a 
fixed sample rate.
That's maybe not a problem for 12 notes per octave but microtonality 
needs more precision, so the base frequency will drop and so your 
lowpass filter needs to go lower still and then your notes tend to glide 
a bit going from one to the next or else you get FM from the PWM frequency.
Another way to do it is to output something like 22kHz constant 
frequency wave but vary the volume. Then the low-pass filter can be 
around 1kHz and you can get thousands of levels with a 16bit soundcard. 
You might be able to do the envelope follower with just a diode and a 
capacitor but a better solution would use op-amps to buffer the voltage.
If you're doing something that relies on precise tuning you ought to 
make a good cv generator. I built my own MIDI to CV (and gate and trig, 
don't forget) converters that use a PIC16F628 and a 16bit DAC for 65536 
levels on 0-10V for my analog synths, for less than $50 parts. You could 
also interface a serial DAC to an arduino.
But I bet you could do it with a cheapo soundcard as well if you can 
find the output of the dac before it passes through any capacitor. You 
need to pass that through a simple op-amp amplifier to add gain and 
offset to get from +-1V  to the 0-10V range. Then write a dc external 
for pd that outputs a constant value instead of a signal (maybe line~ 
already does that).

Martin




More information about the Pd-list mailing list