Hi there,
I have a question about the MidiKeyboardState class. I currently have code that adds MidiMessages to this object (e.g. when OSC messages are received). When I process these to add them to the main MidiBuffer in the processAudio block (as in the code below), they all have time 0, i.e. they only appear at the start of the buffer.
processBlock(AudioSampleBuffer& buffer, MidiBuffer& midiMessages)
{
...
myKeyboardState.processNextMidiBuffer(midiMessages, 0, numSamples, true);
MidiBuffer::Iterator i( midiMessages );
MidiMessage message (0xf4, 0.0);
int time;
// extract any messages from it
while(i.getNextEvent(message, time))
DBG(time << " " << ( (message.isNoteOn()) ? "on" : "off")); // time always is 0
Is there any way to place & retrieve sample accurate MidiMessages using MidiKeyboardState (rather than rounding to the nearest block) or do I need a more elaborate solution for this level of accuracy? And if not what do I need to look at / read? Similar posts on the forums here have left me more confused that when I started…
Any help very much appreciated!