grame-cncm / faustlibraries

The Faust libraries
https://faustlibraries.grame.fr
188 stars 61 forks source link

pm.flute_ui_MIDI is not in tune #79

Open prithviKantanAAU opened 3 years ago

prithviKantanAAU commented 3 years ago

While experimenting with this function, I found that the synthesized fundamental frequency is only correct at 440 Hz and shows increasing error with increasing frequency input.

I managed to manually tune it by adding the following transformation using some crude polynomial fitting, so it is approximately in tune from 440 Hz to 1320 Hz. It would be great if a more robust fix were possible.

// f_Hz is the original input frequency // freqFactor is a transformation applied to correct the final output freqDiff = f_Hz - 440; freqFactor = 0.999999999999 + freqDiff 0.0080951 - freqDifffreqDiff 0.00002777 + freqDifffreqDifffreqDiff 0.00000004097; tubeLength = 440 + (f_Hz - 440) * freqFactor : pm.f2l; // from original function