Hi everyone, I’ve been building a plugin that takes in audio and outputs midi events based on the incoming audio. I am trying to send note on, off and pitch bend messages. Everything works fine when running the standalone build and routing the midi to the IAC. For some reason though, when running the plugin inside of a host only on and off messages are sent.
This is the code I am running.
if (note.frequency != -1 && m_isNoteOn == false)
{
m_isNoteOn = true;
m_lastNote = note;
auto pitchBendVal = chroma::Midi::getPitchBend(chroma::Midi::distanceInCents(m_lastNote, note));
int msb = (pitchBendVal >> 7) & 0x7F;
int lsb = pitchBendVal & 0x7F;
juce::MidiMessage pitchBend(0xE1, lsb, msb);
juce::MidiMessage noteOn(0x91, note.note, 100);
midiMessages.addEvent(pitchBend, 0);
midiMessages.addEvent(noteOn, 0);
}
else if (note.frequency == -1 && m_isNoteOn == true)
{
m_isNoteOn = false;
juce::MidiMessage noteOff(0x81, m_lastNote.note, 100);
midiMessages.addEvent(noteOff, 0);
}
else if (m_isNoteOn)
{
auto pitchBendVal = chroma::Midi::getPitchBend(chroma::Midi::distanceInCents(m_lastNote, note));
int msb = (pitchBendVal >> 7) & 0x7F;
int lsb = pitchBendVal & 0x7F;
juce::MidiMessage pitchBend(0xE1, lsb, msb);
midiMessages.addEvent(pitchBend, 0);
}
I am wondering if this is a plugin format limit of some kind.
Thanks in advance for your help.