1

so I am currently creating a MIDI to CV module and am still having trouble with my MIDI input circuit. I am following this circuit as my guideline and am sending MIDI messages via MIDI interface with the use of this cable. I am also using this software called MIDIKeys as a virtual keyboard for the MIDI notes. Unfortunately, every time I play a note on the keyboard the Arduino doesn't respond with the blink of the LED. I could really use some guidance on fixing this problem.

Below is also the code that I'm using:

#include <MIDI.h>  // Add Midi Library

#define LED 13    // Arduino Board LED is on Pin 13

//Create an instance of the library with default name, serial port and settings
//MIDI_CREATE_DEFAULT_INSTANCE();
MIDI_CREATE_DEFAULT_INSTANCE();

void setup() {
  pinMode (LED, OUTPUT); // Set Arduino board pin 13 to output
  MIDI.begin(MIDI_CHANNEL_OMNI); // Initialize the Midi Library.
  MIDI.turnThruOff();
  MIDI.setHandleNoteOn(MyHandleNoteOn); 
  MIDI.setHandleNoteOff(MyHandleNoteOff); 
  Serial.begin(31250);
}

void loop() { // Main loop
  MIDI.read(); // Continuously check if Midi data has been received.
}

void MyHandleNoteOn(byte channel, byte pitch, byte velocity) { 
  digitalWrite(LED,HIGH);  //Turn LED on
}

void MyHandleNoteOff(byte channel, byte pitch, byte velocity) { 
  digitalWrite(LED,LOW);  //Turn LED off
}

Edit: To verify that my laptop is sending a MIDI message I am using this MIDI Monitor

2
  • how do you know that the PC is sending NoteOn events? ... please edit your question with a description of what you already tried Commented Apr 27, 2023 at 0:37
  • I doubt that the virtual keyboard sends serial messages to the com port Commented Apr 27, 2023 at 13:17

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.