Hello, all! I’m presently using Reaper (sequencer software) to test my Juce code. I’ve built a VST plugin that is intercepting midi from the host as shown below:
void AudioProcessor::processBlock (AudioBuffer<float>& buffer, MidiBuffer& midiMessages)
{
ScopedNoDenormals noDenormals;
auto numSamples = buffer.getNumSamples();
buffer.clear();
processBlockBasic(buffer, midiMessages, numSamples);
}
Inside processBlockBasic() is the usual Midi Iterator loop which is feeding into another class that stores the MidiNoteNumber, MidiNoteVelocity, and timestamps.
For brevity, I’m omitting the details of the nested function calls, but you should get the general idea of what’s going on by looking at the code below:
MidiMessage msg; int offset(0);
for (MidiBuffer::Iterator i(midiMessages); i.getNextEvent(msg, offset);)
{
if (msg.isControllerOfType(64))
{
respondToPedal(msg);
}
else if (msg.isNoteOn() || msg.isNoteOff())
{
handleNoteEvent(hostInfo, msg, offset);
}
else if (msg.isControllerOfType(1) || msg.isPitchWheel())
{
handleControllerEvent(hostInfo, msg, offset);
}
}
The problem I’m having is that Juce tells me a sequence of notes is coming in as MidiNoteNumber 48, whereas the Reaper midi editor shows the same notes as MidiNoteNumber 60. I have no octave offset configured in the host insofar as I can tell, nor am I doing anything “funny” to the MidiBuffer messages that Juce delivers.
I am wondering if anyone else has encountered this behavior with Reaper (or other hosts) and if so, what is your recommended workaround? Transposing the notes up an octave in the code seems likely to cause problems in other hosts that perhaps are in agreement with Juce about the note number.
Thoughts?