Topic: MIDI RPN fine tuning not recognized
Hello
When I send MIDI RPN message, for fine and/or coarse tuning, Pianoteq does not react ( the 440Hz tuning is not changed )...
In the MIDI standard ( http://www.midi.org/techspecs/midimessages.php ), RPN is use to set the tuning.
Is it possible to implement it ?
I can't see a way to set this RPN message in the Painoteq MIDI settings.
Regards
Franck
Example of calculation used to convert freq in Hz to these RPN values ( if useful .. ) :
int coarse, coarsemsb , finemsb ;
float fine;
// convert Hertz to cents
float cents = 1200.0 * log2f(freq / 440.0);
if (cents >= 0)
{
coarse = (int)((cents + 50.0)/100.0); // semitone
fine = cents - 100.0 * (float)(coarse); // cents
}
else
{
cents = (-1.0)*cents;
coarse = (int)((cents + 50.0)/100.0);
fine = cents - 100.0 * (float)(coarse);
coarse *= -1;
fine *= -1.0;
}
coarsemsb = coarse + 0x40; // RPN coarse tuning
finemsb = (int)((float)(0x20) * fine / 50.0 ) + 0x40; // RPN fine tuning