I have following code to detect midi events…
void AudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages)
{
// This is the place where you'd normally do the guts of your plugin's
// audio processing...
MidiMessage message (0xf4, 0.0);
MidiBuffer::Iterator i (midiMessages);
int sampleOffset;
while (i.getNextEvent (message, sampleOffset))
{
if (message.isNoteOn())
{
_synth->playNote(message.getNoteNumber(), message.getFloatVelocity(), sampleOffset);
}
else if (message.isNoteOff())
{
_synth->stopNote(message.getNoteNumber(), message.getFloatVelocity(), sampleOffset);
}
}
}
is there a member like an ID in MidiMessage? I want to save this ID when “isNoteOn” is true and compare it when “isNoteOff” is true so that I can stop the right note.
When I press a note and release it, there are two events and booth have to be the same ID. Is there anything like this?
Thanks and greetz from Germany
T.