Sending MIDI wirelessly to phone apps
There are multiple ways to turn your MIDI Madness Maker into a Bluetooth MIDI keyboard! The code used for the different examples is the same (MIDI-madness-BLE-keyboard.ino). Here the focus is on sending MIDI to your computer wirelessly.
Libraries (this part you only need to do once)
You need to start by installing the BLE-MIDI library by Lathoub. Make sure you do NOT install the other suggested libraries; if you have additional BLE libraries compilation may fail so uninstall those if you have them :)
Sometimes different versions of boards and libraries cause conflicts with other libraries (this sometimes happens when a new version comes out). To make sure it’s working, these are the library versions that we are using that work with each other.
boards:
esp32 by Espressif Systems | 3.1.3 |
libraries:
BLE-MIDI by lathoub | 2.2 |
MIDI Library by Francois Best, lathoub | 5.0.2 |
To make it work with ESP32, you need to change line 116 in BLEMIDI_ESP32.h
(Arduino/libraries/BLE-MIDI/src/hardware/BLEMIDI_ESP32.h
). Add .c_str()
at the end of the line, so it looks like this: std::string rxValue = characteristic->getValue().c_str();
. What you can also do is just replace the entire BLE-MIDI library with this BLE-MIDI folder, there it’s already implemented (just unzip into your Arduino/libraries folder).
MidiMadnessMaker library by Bart Jakobs
Programming genius Bart Jakobs made a nice library to use with the MIDI Madness Maker that sends MIDI notes and CC info wirelessly to your phone apps. Check it out here; there is also a code example.
Alternatively, you can use the BLE keyboard code in the Arduino (Code) folder.
MIDI to Garageband/SynprezFM
This example is based on a tutorial by Rico Kanthatham which you can find here.
Apps
- Android: download MIDI BLE Connect & SynprezFM II. Connect to your device via the BLE app and then go to SynprezFM
- Apple: download Garageband; go to gears > advanced > bluetooth midi devices
Using garageband
You can use the BLE keyboard code example for various keyboards, drums and other instruments, but you may want to change the MIDI notes sent (check the charts below). MIDI CC doesn’t always have an effect.
MIDI CC: https://rfwilmut.net/notes/GBcontrol.html MIDI map for Garageband drums (via https://gist.github.com/igolopolosov/8193f8d3da522969244dda318f21d3fa)
via Reddit:
CC 1 (Modulation Wheel) -> Tremolo (Electric Piano)
CC 7 (Channel Volume) -> Channel Volume
CC 10 (Pan)-> Pan (Channel)
MIDI Note Drum Sound
==== ==== ==========
36 C2 Bass Drum 1
37 C#2 Side Stick
38 D2 Acoustic Snare
39 Eb2 Hand Clap
40 E2 Electric Snare
41 F2 Low Floor Tom
42 F#2 Closed Hi Hat
43 G2 Mid Floor Tom
44 Ab2 Pedal Hi-Hat
45 A2 High Floor Tom
46 Bb2 Open Hi-Hat
47 B2 Low-Mid Tom
48 C3 Hi Mid Tom
49 C#3 Crash Cymbal 1
50 D3 High Tom / Maracase
51 Eb3 Ride Cymbal 1
52 E3 Flat Snare / Accent Drum
53 F3 Bass Drum 2
After this point drums are completely situational
54 F#3 Splash Cymbal
55 G3 Cowbell
56 Ab3 Tabourine
57 A3 Vibraslap
58 Bb3 Anything
59 B3 Vibraslap 2