
Originally Posted by
Nantonos
Nice!
Unless you really do need double, it would be faster to declare your floating point variables as float (and use the single precision math calls like sinf, logf rather than sin, log). Then the hardware FPU in Teensy 3.5 and 3.6 will be used.
In Dexed::ProcessMidiMessage your NoteOn code does not take account of MIDI running status. Given that your input is DIN MIDI, you are likely to encounter that in practice. Check for a NoteOn velocity of zero and if found, treat as a NoteOff (and if using release velocity, assign a release velocity of 64).
Many thanks for your comments!!!
I replaced the doubles with a macro in synth.h (
Code:
#define FRAC_NUM float
), so only floats are used now. I also replaced all sin() and log() to their float variants. But mostly this does not affect anything while playing, because it seems that this all is mainly used in the initialization functions for the lookup tables (AFAIK the real DX7 also works with LUTs).
The NoteOn with a velocity of 0 is recognized in the underlying keydown() function:
Code:
void Dexed::keydown(uint8_t pitch, uint8_t velo) {
TRACE("Hi");
TRACE("pitch=%d, velo=%d\n", pitch, velo);
if ( velo == 0 ) {
keyup(pitch);
return;
}
And release velocity is ignored in keyup().
Again: many thanks! It is really a big help if someone else is looking at my code...
Regards, Holger