Aren't we missing a conversion here


Aren't we missing a conversion here between float velocity [0.0 1.0] and int velocity [0  127]?
Or perhaps better a MidiMessage::noteOff function that takes a float velocity in analogy with noteOn?

    void handleNoteOff (MidiKeyboardState*, int midiChannel, int midiNoteNumber, float velocity) override
        if (! isAddingFromMidiInput)
            MidiMessage m (MidiMessage::noteOff (midiChannel, midiNoteNumber, velocity));
            m.setTimeStamp (Time::getMillisecondCounterHiRes() * 0.001);
            postMessageToList (m);



Damn! Yes, thanks for spotting that, I assumed I was calling a float version of the method - will add one right away!


Out of curiosity: Why would you have "velocity" in a handleNoteOff function? I mean: what exactly does velocity mean for a note off event? How fast you released the key?




Yes, it's the speed of the release. In the midi spec, all note-offs have a velocity, which is mainly why it's been added here, it's not very commonly used.


Be great for some modelled partial muting ... maybe the sound of a string coming to rest against a metal block slowly ... twang ...buzzzzz ... silence... 


Yeah, we use it as a modulation source for some of our sounds in Equator - works nicely with the new Seaboard RISE :)