[sdiy] Detuning in Digital
Scott Gravenhorst
music.maker at gte.net
Mon Apr 2 14:27:11 CEST 2012
"Detune" I will take to mean what happens for pitch wheel and for portamento. And I'm
also going to assume a MIDI synth.
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.
As for pitch wheel, in several of my FPGA synths (that use phase accumulators), I use
two tuning tables and linear interpolate between the two. Picking the table values is
important because that defines the range over which the wheel works. If you want 24
semitones of range, then one tuning table has values for an octave above the chosen
pitch and the other has values for an octave below the chosen pitch. The values in
these tables amount to phase increment values. If the pitch wheel is centered (or
value 0x2000), the interpolator will pick a value that represents an octave above the
low ROM and an octave below the high ROM. Other interpolator values define the other
values between the high and low ROMs. Changing the wheel range is a matter of
changing the values in the two tables.
As for different numbers of pitches per octave, you can do anything you like - just
don't expect the white and black keys to make much sense anymore. I'm currently
working on an FPGA synth that uses 32 inharmonic sinewave partials (that is, the
partials are _not_ harmonics, their frequencies are not integer multiples of the
fundamental frequency). This gives nice bells and gongs when used with an
exponentially decaying EG. On top of that, the patch editor calculates the tuning RAM
by using the inharmonic partial frequencies as a basis for scale pitches. As such,
each scale pitch is related to a partial frequency or an octave of it. Not equally or
evenly tempered at all. It is indeed odd, you'll never play Chopin on it, but it can
be quite interesting.
Matthew Smith <matt at smiffytech.com> wrote:
>Wondering if anyone can give me the Magic Formula for calculating a
>de-tuned frequency. I understand (rightly or wrongly!) that a cent above
>a note is one hundredth of one twelfth of twice that original frequency
>and ditto with half the original frequency for one cent down.
>
>My mathematical ability, unfortunately, does not stretch to getting this
>into a simple formula where I plug in a frequency and detune value and
>come out with a new frequency. (Or even one formula for up and one for
>down, so I don't have to muck around with signed numbers.)
>
>Ideally, I'd like to do this with the simplest of operations (shift,
>add, subtract, *possibly* multiply,) and avoid use of floating points,
>if possible. I'm not after precision, only something that sounds right
>to the average ear. Or sounds right to an ear that is happy with
>acoustic instruments, where perfect tuning is an impossibility. (Saw
>something about Lionel Ritchie on the news last night - his piano was
>WAY out of tune!)
>
>If the math is too onerous for simple operations, what increment of
>cents detune is clearly audible? Quite happy to use a frequency lookup
>table, but don't see any point in creating a 14,400-entry LUT for a 72
>note range, if only eight divisions per semitone are readily
>distinguishable.
>
>Oh, and whilst we're at it, can we dump the 12-semitone octave in favour
>of 16, and have 128 cents to the semitone (hey, no more stupid than the
>Imperial measurement system) so we're working only in powers of 2? ;-)
>
>Cheers
>
>M
>
>--
>Matthew Smith
>
>Business: http://www.smiffytech.com
>Blog: http://www.smiffysplace.com
>Linkedin: http://www.linkedin.com/in/smiffy
>Flickr: http://www.flickr.com/photos/msmiffy
>Twitter: http://twitter.com/smiffy
>_______________________________________________
>Synth-diy mailing list
>Synth-diy at dropmix.xs4all.nl
>http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
>
-- 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