File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -8,13 +8,15 @@ void ofxAudioUnitManagerUtils::setup() {
88 "C#5 ON", "C#5 OFF" etc */
99void ofxAudioUnitManagerUtils::executeMidiCommand (string command, ofxMidiOut *midi) {
1010 vector<string> args = ofSplitString (command, " " );
11- int parsedNote = midiNote (args.at (0 ));
12- if (args.at (1 ) == " ON" ) {
13- cout << " Sending MIDI ON: " << parsedNote << endl;
14- midi->sendNoteOn (1 , parsedNote);
15- } else {
16- cout << " Sending MIDI OFF: " << parsedNote << endl;
17- midi->sendNoteOff (1 , parsedNote);
11+ if (args.size () == 2 ) {
12+ int parsedNote = midiNote (args.at (0 ));
13+ if (args.at (1 ) == " ON" ) {
14+ cout << " Sending MIDI ON: " << parsedNote << endl;
15+ midi->sendNoteOn (1 , parsedNote);
16+ } else {
17+ cout << " Sending MIDI OFF: " << parsedNote << endl;
18+ midi->sendNoteOff (1 , parsedNote);
19+ }
1820 }
1921}
2022
You can’t perform that action at this time.
0 commit comments