Hi,
I am taking my first steps with Juce and outputting some midi. I’m using a midi monitor app and the output is not what I expected. I am trying to send note on/off but the app shows 2 byte sysex data (F0 F7). Am I missing something obvious here?
midiBuffer_.addEvent(MidiMessage::noteOn(1, 60, 127.f), 0);
midiBuffer_.addEvent(MidiMessage::noteOff(1, 60), 44100);
midiOutput_->sendBlockOfMessages(midiBuffer_, 0, 44100)
;
Also I have a ComboBox taking the StringArray straight from getDevices(); When the ComboBox changes I take the index and pass in on to MidiOutput::openDevice. It works but I need to add the +1 to open the correct device. Why is that?
void MyPlugAudioProcessorEditor::comboBoxChanged(ComboBox *box)
{
String value = box->getText();
int deviceIndex = box->getSelectedItemIndex()+1; // off by 1??
midiOutput_ = MidiOutput::openDevice(deviceIndex);
if(!midiOutput_){
label->setText("Device could not be opened :'(", false);
}else{
label->setText("Opened "+value, false);
}
}