Random frequency modulation (was [sdiy] Interesting f vs. t graphs of pitch instability)
Scott Gravenhorst
music.maker at gte.net
Tue Oct 7 16:36:13 CEST 2008
Tom Wiltshire <tom at electricdruid.net> wrote:
>Scott,
>
>On 7 Oct 2008, at 14:21, Scott Gravenhorst wrote:
>
>> The sample rates of the GateMan synths are 1.0MHz for the monosynth
>> and 250KHz for
>> the poly. The NCOs are based on a phase accumulator design, so
>> they emulate linear
>> CV for pitch. Because of this I had to compensate for the control
>> voltage's action
>> as it moves through it's range. This is done by multiplying the
>> noise amplitude by
>> the "CV" (in quotes because it's digital, and the pitch control
>> signal is an
>> emulation of CV, linear) so that it is scaled properly. This gives
>> a consistent
>> effect across the entire pitch range of the synth.
>
>This makes the pitch fluctuation a constant percentage of the pitch,
>rather than constant number of Hertz, doesn't it?
That is correct.
>My own digital osc design is based on the Korg DWGS oscillators, a
>phase accumulator followed by a series of bandlimited wavetables. I
>have a 16-bit "Pitch" variable which represents 8 octaves of
>frequency, represented logarithmically (A V/Oct CV, if you like).
>This is then converted via a lookup table into a linear frequency
>increment.
>So I can add the noise modulation to either the pitch variable
>(logarithmic) or the frequency increment (linear).
>
>> What I did was to filter the noise through a simple single stage
>> IIR filter to roll
>> off more and more high frequency energy in the noise waveform to
>> control whether it's
>> just slow drift (very low Fc) or jumpy drift (medium Fc) or audible
>> noise (high Fc).
>> The lower the Fc, the slower the noise signal moves. Lower Fc
>> also lowers the
>> overall amplitude of the noise, so there's a multiplier value to
>> amplify it when
>> needed.
>
>This sounds good. Single-stage IIR is something that even a dsPIC
>should be able to handle! Will I find filter details in the Gateman
>notes in any form I can understand?
I got the information to implement the filter from:
http://www.dspguide.com/pdfbook.htm
Chapter 19 on recursive filters gives the details. It's very simple and while the
"standard" form uses 2 multiply operations, it can be done without multiplies
(shifts are used instead, but there is a sacrifice in tuning resolution when doing
that.) Be aware that the total amplitude will decrease as the bandwidth is
constricted. In order to use the really low end, I had to use wider arithmetic for
that piece of the design. I don't remember how much, that is also in the source,
probably somewhat cryptically.
I'm not sure how easily the Verilog will translate to assembly or C for you, but all
of the source code is on http://www.fpga.synth.net/ in the Wiki.
>> What I have can do drift times in the 10s of seconds which causes
>> the NCOs
>> to drift slowly in and out of tune and exhibit the characteristic
>> slow phasing we all
>> love (the monosynth has 4 NCOs, the poly has 4 NCOs per voice).
>
>How much accuracy does the filter need to be able to cope with such
>long times? 10's of seconds at the sample rates you mentioned is a
>LOT of samples. I'd have expected noise to build up in an IIR after
>so long, but I'm not well versed in digital filtering.
As I mentioned above, when using a very low Fc, (or small bandwidth) the filter
won't work well if the arithmetic width is too small. I use 18 bit signed for the
rest of the synth, but that piece is wider. (I _think_ it's 24 bit for the noise
filter, but it could be more - it's been awhile since I've been "in" the design
code). I originally tried just multiplying the value, but when the actual numbers
use only the lower 3 or 4 bits, you get "chunky" action, not what I wanted. Using
more bits gives more resolution and smooths out the changes, even when the amplitude
is multiplied to "amplify" if.
>> The system stays in tune within the bounds of the noise signal
>> because the noise
>> causes the pitch to drift back and forth across "perfect tune" by
>> even amounts on
>> both sides of it.
>
>Yeah, isn't that a handy property of a good-quality noise signal?!
(c; 64 bit LFSR.
>> I just get a very nice in-tune, but randomly wandering phase change
>> sound.
>
>Sounds lovely, Scott. Good work.
>
>Thanks for the useful comments too.
You're quite welcome.
-- ScottG
______________________________________________________________
-- Scott Gravenhorst
-- GateManPoly - FPGA-based Polyphonic MIDI LA/FM Synthesizer
-- GateMan-III - FPGA-based Monophonic MIDI LA/FM Synthesizer
-- PolyDaWG/8 - FPGA-based 8 Voice Polyphonic MIDI Synthesizer
-- FatMan: home1.gte.net/res0658s/fatman/
-- NonFatMan: home1.gte.net/res0658s/electronics/
-- When the going gets tough, the tough use the command line.
More information about the Synth-diy
mailing list