esp32 MIDI Out Problem #312
craiglindley
started this conversation in
General
Replies: 1 comment
-
There is no need to override the midi::DefaultSettings (Baudrate is already set to the default 31250 and setting the TXPin in Settings does not make sense, it will not be used by the library). Use the regular Do a google search for ESP32 and MIDI for the schema, resistor values and the optocoupler. (eg alf45tar/PedalinoMini#12) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is the first time I have used this library so I may be missing something but I cannot get MIDI output to work at all with Serial2. The code I am using is shown below. On the MIDI DIN connector I connected the ground pin to my circuit ground, I connected GPIO4 to pin 5 through a 10 ohm resistor and pin 4 to 3.3V through a 33 ohm resistor.
I have tried 2 different ESP32 modules and three different GPIO pins and nothing seems to work. I also tried to output MIDI to the main serial port and could see garbage chars written to the serial monitor every second which I interpret to mean that MIDI data is being written out but when I change back to Serial2 none of my connected MIDI devices respond.
`#include <MIDI.h>
// MIDI output signal
#define MIDI_OUT_PIN 4
#include <MIDI.h>
#include <HardwareSerial.h>
// Override default MIDI settings
struct Serial2MIDISettings : public midi::DefaultSettings {
static const long BaudRate = 31250;
static const int8_t TxPin = MIDI_OUT_PIN;
};
//
/ Driver Instances /
//
// Create MIDI driver instance called MIDI
MIDI_CREATE_CUSTOM_INSTANCE(HardwareSerial, Serial2, MIDI, Serial2MIDISettings);
void setup() {
MIDI.begin();
}
void loop() {
MIDI.sendNoteOn(60, 64, 1);
delay(1000);
MIDI.sendNoteOff(60, 64, 1);
delay(1000);
}
`
Any suggestions would be appreciated. Thanks
Beta Was this translation helpful? Give feedback.
All reactions