[sdiy] Detuning in Digital

Veronica Merryfield veronica at merryfield.ca
Mon Apr 2 07:54:42 CEST 2012


I think you might have the cent definition wrong. As 12 semitones divide an octave in a logarithmically in an equal tempered scale, so there are 100 cents dividing each semi tone.

Depending on your application, you could have a look up table with 7200 entries or you could have a table with an entry per note that has two entries, one that is the increment that 'sounds' good to you and a count of the number increments needed to get between notes. If your UI has to have a fixed number of 'cents' between notes, then you could just divide the note range by that fixed number and use that. 

Of course you dump the equal tempered scale in favour of a power of 2 scale if you want. Getting others to use might be a marketing challenge.



On 2012-04-01, at 10:30 PM, Matthew Smith 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
> 




More information about the Synth-diy mailing list