[sdiy] Detuning in Digital
Scott Gravenhorst
music.maker at gte.net
Mon Apr 2 16:37:34 CEST 2012
Tom Wiltshire <tom at electricdruid.net> wrote:
>
>On 2 Apr 2012, at 13:27, Scott Gravenhorst wrote:
>
>> Portamento is easy for phase accumulator systems. The pitch is described by the phase
>> accumulator's increment value (which remains constant for a constant pitch). Simply
>> pass the phase increment value stream through a single pole lowpass IIR filter before
>> using it to update the phase accumulator. The single pole lowpass IIR filter models a
>> single pole RC passive lowpass filter which is what is used to do "glide" or
>> portamento on an analog synth.
>
>One caveat I'd like to add;
>Portamento on an analog synth is usually done on the 1V/Oct CV,
>which is exponential. Doing portamento on the frequency (phase)
>increment is equivalent to doing the portamento on a Linear CV.
>There probably are linear CV analogs with RC portamento (early
>Korg?), but it's not exactly the commonest set up. More accurate
>(if "VA" is what you're after) would be to do the portamento on
>the pitch word before you convert it to a frequency increment
>using the table discussed already.
>
>Still, Scott's tried it, and if it sounds good, it's a fairly
>simple method, although arithmetic accuracy becomes an issue on
>cheap processors. I remember looking at it and it only became
>efficient if I reduced the calculation to shifts. This gave good
>results, but only 8 different portamento settings (one for each
>position of bitshift). There may well be a better way that I
>missed, or better options on other architectures.
Quite true that using the method I described is what happens in analog synths using linear pitch
control. But a phase accumulator and phase increment method of pitch control does, in fact, model
linear pitch control (which is why portamento done this way works in a phase accumulator
oscillator). This is borne up by looking at the phase increment values themselves. If the phase
increment for a given pitch is say 1000, then the octave below it would be 500 and the octave below
that 250. So if, for example, you tried the typical expo technique to LFO modulate the pitch of
simply adding the LFO output to the pitch signal, you'd hear larger adjustments at the low end than
at the high end. This is the same thing that happens if you try using that method with analog
linear pitch control - an LFO output added to the pitch control signal doesn't work as one would like.
It does work, and it sounds quite natural. Tom's comment about the arithmetic is correct, I had to
expand the arithmetic bit width of the IIR filter when I first tried it. The symptom was pitch
inaccuracy (because of quantization I believe), especially at the low end. In my case, using an
FPGA, the solution was an easy expansion of the bit width and the result is a portamento system
that has many thousands of portamento time settings.
As Tom cites, there is a method to do a lowpass single pole IIR filter without using a multiply
(shifts are used instead), but I eventually replaced it with a multiply version because the shift
method's control over portamento time is too low resolution (in my case, 64 settings). I too, am
unaware of other/better methods to do this, and the lowpass IIR filter method just seemed too
natural in it's modeling of an RC lowpass passive filter to dismiss.
-- ScottG
________________________________________________________________________
-- Scott Gravenhorst
-- FPGA MIDI Synth Info: jovianpyx.dyndns.org:8080/public/FPGA_synth/
-- FatMan Mods Etc.: jovianpyx.dyndns.org:8080/public/fatman/
-- Some Random Electronics Bits: jovianpyx.dyndns.org:8080/public/electronics/
-- When the going gets tough, the tough use the command line.
More information about the Synth-diy
mailing list