MIDI Over Serial



  • Hey!

    I am quite stuck with getting MIDI to work on my Grey Core. I am Using Serial2 (that should be GIOP16 for RX and GIOP17 for TX) and am using the MIDI Library from FortySevenEffects (its the most common used one, as far as I know). I connected the DIN Port to 3.3V, GND and the Port labeled 17 via a 220Ohm resistor to the 3rd pin. As i did a lot of Midi Projects with Arduino, Teensy and ESB32 boards, this should run without any issues. Even the Test-DIN Port is reused from the Teensy Project. But I get no result. My standard test sketch, that sends NoteOn and NoteOff on all MidiChannels does not Trigger any notes?
    Is the Labeling on the M5 Stacks button not the Number of the GIOP?

    Any help aprecheated!

    #include <M5Stack.h>
    #include <MIDI.h>
    
    MIDI_CREATE_INSTANCE(HardwareSerial, Serial2, MIDI);
    
    void setup() {
      M5.begin();
      dacWrite(25, 0);
      M5.Lcd.print( "M5 MIDI Test");
      MIDI.begin(MIDI_CHANNEL_OMNI);
    }
    
    void loop() {
      M5.Lcd.setCursor( 0, 30);
      M5.Lcd.fillRect( 0, 30, 100, 100, BLACK);
      M5.Lcd.print( "ON");
      for( uint8_t i = 0; i < 16; ++i) {
        MIDI.sendNoteOn( 62, 127, i);
      }
      delay( 1000);
      M5.Lcd.setCursor( 0, 30);
      M5.Lcd.fillRect( 0, 30, 100, 100, BLACK);
      M5.Lcd.print( "Off");
      for( uint8_t i = 0; i < 16; ++i) {
        MIDI.sendNoteOff( 62, 127, i);
      }
      delay( 1000);
    }
    


  • @jkirchheimer are you using the M5stack internal speaker for the MIDI sounds, because “dacWrite(25, 0);“ mutes the speaker