Serial MIDI for drum machine

hi everyone!

i have had success controlling a hardware drum machine with my Arduino Uno, but now with the Arduino Nano 33 BLE Sense it's not working :frowning:

i am using Serial1 for the hardware MIDI connection, and according to the post i found here
maybe the baudrate 31250 neccesary for MIDI is not achievable?

here is my code / comments, thanks so much :slight_smile:

void setup() {

void loop() {
// 0x99 is hexadecimal for 153 decimal
// 153 is note on channel 10
// 49 is crash cymbal
// 127 is velocity
midiCommand(0x99, 49, 127);

// send 3 byte midi message
void midiCommand(byte cmd, byte data1, byte data2) {



and i want to control a hardware MIDI drum machine with it, i am able to do it with

here is my code so far:

i saw on this post some issues about the baudrate

If you follow the links in the description you will see that your baudrate is not supported by the library code. Using the formula given in the example the baudrate register value should be 0x800000.

Can you try this?

Serial1.begin( 9600 );
uint32_t baudrate = 0x800000;
uint32_t *pBaudrate = ( uint32_t * )0x40002524;
*pBaudrate = baudrate;

Note: We use the begin() function to initialize Serial1 but then change the baudrate register "manually".

hi klaus thank you so much, now my MIDI is working!!! :slight_smile: