Skip to content

Commit 7113bda

Browse files
committed
add support for serial-to-midi bridge softwares on usb for esp32 wroom
1 parent d3b7482 commit 7113bda

File tree

2 files changed

+26
-10
lines changed

2 files changed

+26
-10
lines changed

v2/AciduinoV2/1_uctrl.ino

+4
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,10 @@ void uCtrlSetup() {
333333
// Plugin MIDI interfaces to handle
334334
#if defined(USE_MIDI1)
335335
uCtrl.midi->plug(&MIDI1);
336+
#if defined(USE_SERIAL_MIDI_115200)
337+
// forces MidiInterface back to 115200
338+
Serial.begin(115200);
339+
#endif
336340
#endif
337341
#if defined(USE_MIDI2)
338342
uCtrl.midi->plug(&MIDI2);

v2/AciduinoV2/src/ports/esp32/wroom-ext1.h

+22-10
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,14 @@
2323
// enable ble-midi? needs USE_MIDI2
2424
#define USE_BT_MIDI_ESP32
2525

26-
#define USE_MIDI1
27-
#define USE_MIDI2
28-
//#define USE_MIDI3
26+
// enable Serial to be able to use on serial-to-midi bridges on PCs
27+
// like hairless midi or ttymidi
28+
// does it needs USE_MIDI1
29+
#define USE_SERIAL_MIDI_115200
30+
31+
#define USE_MIDI1 // USB MIDI, needs a serial-to-midi bridge on the other side: hariless midi or ttymidi
32+
#define USE_MIDI2 // BLE MIDI: bluetooth is not a good option to run realtime application like midi, so be aware of shit timming and issues(good for a midi controller only)
33+
#define USE_MIDI3 // real MIDI serial port: connect to your hardware synths via MIDI cable(check midi out schematics for 3.3v)
2934

3035
// wich modules you need acidman?
3136
// PUSH and LED modules require booth PUSH_SPI and LED_SPI to point into some spi device
@@ -96,19 +101,26 @@ U8G2_SH1106_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE);
96101

97102
// Midi device
98103
// initing midi devices
99-
//MIDI_CREATE_INSTANCE(HardwareSerial, Serial, MIDI1);
100-
MIDI_CREATE_INSTANCE(HardwareSerial, Serial2, MIDI1);
104+
#if defined(USE_MIDI1) // USB
105+
MIDI_CREATE_INSTANCE(HardwareSerial, Serial, MIDI1);
106+
#endif
101107

102-
#if defined(USE_BT_MIDI_ESP32) && defined(CONFIG_BT_ENABLED)
108+
#if defined(USE_MIDI2) // Bluetooth
109+
#if defined(USE_BT_MIDI_ESP32) && defined(CONFIG_BT_ENABLED)
103110
BLEMIDI_CREATE_INSTANCE("Aciduino", MIDI2);
104111
#endif
112+
#endif
105113

106-
// in case we got USB native mode support builtin, use it!
107-
#if defined(CONFIG_TINYUSB_ENABLED)
108-
ESPNATIVEUSBMIDI espNativeUsbMidi;
109-
MIDI_CREATE_INSTANCE(ESPNATIVEUSBMIDI, espNativeUsbMidi, MIDI3);
114+
#if defined(USE_MIDI3) // Hardware midi
115+
MIDI_CREATE_INSTANCE(HardwareSerial, Serial2, MIDI3);
110116
#endif
111117

118+
// in case we got USB native mode support builtin, use it! note the case of wroom, keep this setup for later other boards
119+
//#if defined(CONFIG_TINYUSB_ENABLED)
120+
//ESPNATIVEUSBMIDI espNativeUsbMidi;
121+
//MIDI_CREATE_INSTANCE(ESPNATIVEUSBMIDI, espNativeUsbMidi, MIDI1);
122+
//#endif
123+
112124
// SPI devices
113125
//#define PUSH_SPI SPI
114126
//#define LED_SPI SPI

0 commit comments

Comments
 (0)