Skip to content

Commit

Permalink
Merge pull request #136 from davy39/main
Browse files Browse the repository at this point in the history
Use tinyusb midi with esp32S3
  • Loading branch information
corrados committed Mar 8, 2024
2 parents 43fee63 + 6fa5d4c commit 9cbb9db
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
11 changes: 10 additions & 1 deletion edrumulus.ino
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ const int number_pads4 = 8; // example: do not use tom3 and shrink number of pad
#ifdef USE_MIDI
# ifdef ESP_PLATFORM
# include <MIDI.h>
MIDI_CREATE_DEFAULT_INSTANCE();
# ifdef USE_TINYUSB
# include <Adafruit_TinyUSB.h>
Adafruit_USBD_MIDI usb_midi;
MIDI_CREATE_INSTANCE(Adafruit_USBD_MIDI, usb_midi, MIDI);
# else
MIDI_CREATE_DEFAULT_INSTANCE();
# endif
# define MYMIDI MIDI
# define MIDI_CONTROL_CHANGE_TYPE midi::ControlChange
# define MIDI_SEND_AFTER_TOUCH sendAfterTouch
Expand Down Expand Up @@ -76,6 +82,9 @@ void setup()
number_pads = min ( number_pads, 7 ); // only max. 7 pads are supported for ESP32 serial debug plotting
#endif
#ifdef USE_MIDI
# ifdef USE_TINYUSB
TinyUSBDevice.setProductDescriptor("Edrumulus");
# endif
MYMIDI.begin();
#endif
#ifdef MIDI_SERIAL
Expand Down
10 changes: 10 additions & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,13 @@ board = az-delivery-devkit-v4
[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
build_unflags = -DARDUINO_USB_MODE=1
build_flags =
-DUSE_TINYUSB=1
-DARDUINO_USB_MODE=0
-DARDUINO_USB_CDC_ON_BOOT=1
'-DCFG_TUSB_CONFIG_FILE="${platformio.core_dir}/packages/framework-arduinoespressif32/tools/sdk/esp32s3/include/arduino_tinyusb/include/tusb_config.h"'
lib_archive = no
lib_deps =
fortyseveneffects/MIDI Library
adafruit/Adafruit TinyUSB Library

0 comments on commit 9cbb9db

Please sign in to comment.