MIDI using soundfont: adjustment in cents per MIDI note?

I'm currently using the following to determine the cents to move the sample of the soundfont, played in the resulting speed factor based upon it's supplied frequency (e.g. 44100Hz times 1.5 = 66150Hz with factor 1.5).


1. Default: no cents applied (=0 cents).

.. Relative MIDI Tone selection ..
2. Get the sample's MIDI tone by:
2.1: Sample's Original Pitch value by default.
2.2: If Instrument Overriding Root Key generator is specified use this instead of above value.
3. Substract the used MIDI tone number from the sample's MIDI tone (to get the relative tone). Hereby this result is called RootMIDITone.

.. Accumulating the cents ..
4. Coarse tune specified? Add the value multiplied by 100 to the ammount of cents.
5. Fine tune specified? Add the value speicified to the ammount of cents.
6. Scale Tuning specified?
6.1. Multiply the cents calculated with the value specified.
5.2. Multiply the resulting cents by 0.01 to use the Scale Tuning as a percentage to take of the ammount of cents.

.. Calculate the speedup factor ..
This is calculated by the following formula:
factor=pow(2,(cents/1200))


Anyone can tell me if this is correct and what needs to be changed for it to work, if needed?

Edit: Fixed. The scale tuning is the amount of cents to be applied to every change in RootMIDITone, not a percentage of the other calculations. So multiply it with RootMIDITone and add to the calculated cents.
Anyone can confirm this?
Last edited on
Topic archived. No new replies allowed.