Close

Completing the DIN module

A project log for Modular MIDI

Using a CAN bus to distribute MIDI messages in a modular synthesizer

davidDavid 11/18/2023 at 18:050 Comments

Assembling and programming the DIN module was mostly pain-free, but I could not use the bootloader. I tried flashing the bootloader but was unable to upload the program because it got stuck when initializing the flash with the applet. I even tried recompiling the applet to make sure it had the correct memory configuration. Perhaps the SAMD21G15 doesn't have enough RAM for the bootloader. It's not a huge issue though, the MCU variants with more memory are pin-compatible and I have it working on a SAMD21G17.

Flashing activity LEDs

Several issues have been fixed in this module, as well as some general improvements: The output is confirmed to be working as expected now. The DIP switch to select a MIDI group has been implemented. The CAN controller now filters out message types. Randomization of the CAN ID and MUID was added. The module now translates more message types between DIN and M2IDI: realtime, MIDI 2.0 voice messages, and sysex messages.

I have also been updating the MIDI driver during this time, to adhere to the latest UMP specification. So flex and stream messages are handled, and util messages are groupless. It should also insert the bank in program change messages when translating between MIDI 1.0 and MIDI 2.0. One thing that gave me a headache while diving into the spec is that the byte order is inconsistent. Some messages, like realtime, have the least significant byte first. Other messages, like program change, have the most significant byte first. But most of them are ambiguous, left to be decided by each transport. I ended up using most significant byte first because it seems to be the most consistent overall.

This module is basically feature-complete now, the only thing missing may be implementing a function block for MIDI discovery. Next up is probably the USB module, since I already finished soldering it.

Discussions