raspy135 / Qun-mk2

Manual and presets for Qun mk2 synthesizer
75 stars 3 forks source link

Wireless MIDI protocols #28

Open map588 opened 7 months ago

map588 commented 7 months ago

Are there plans to leverage the ESP-32's networking to work with wireless midi controllers (BLE or Wifi)?

raspy135 commented 7 months ago

No, there is no space for BT stack. I recently added WiFi for file access but not for MIDI. So far I don't know good protocol to support midi over WiFi and I think the latency would not be acceptable.

map588 commented 7 months ago

MacOS natively supports a MIDI wireless interface, and in my experience the latency is not terrible. This project below makes it compatible with Windows as well. https://www.tobias-erichsen.de/software/rtpmidi.html

map588 commented 7 months ago

Its the same protocol as well. I experimented with friends of mine who only run windows, and the native MIDI network driver on MacOS was interoperable. The latency was acceptable, even over a WAN connection. https://midi.org/rtp-midi-or-midi-over-networks

"RTP-MIDI can also easily be implemented in hardware such as keyboards, mixers, break-out boxes, etc., 
since the required memory footprint, processor usage, and hardware requirements are compatible with 
modern low-cost microcontrollers."

https://john-lazzaro.github.io/rtpmidi/index.html

raspy135 commented 7 months ago

I will check the possibility but considering current free cpu resources it's hard to achieve low latency I think.

map588 commented 7 months ago

Thats understandable, if I get some time away from school I might investigate as well, maybe submit a PR. The feature would be great though, as of now I need to use my sound interface to interact with the Nunomo using MIDI, and I would be able to use the synth in many more circumstances.

The latency is about 10ms in my experience, which I don't find noticeable. Even then I have a bluetooth midi controller, which does introduce more latency, but I still take the tradeoff in mobile circumstances because the benefits outweigh the cost. It would be a major upgrade for me at least, and most likely others.

I also found some pre-existing Arduino libraries that could be helpful, one is for the esp-8266, one as an arduino libary, and one is written entirely in python:

https://github.com/lathoub/Arduino-AppleMIDI-Library https://github.com/rinaldohack/rtpmidi2midi https://github.com/mik3y/pymidi?tab=readme-ov-file

map588 commented 7 months ago

I appreciate your response, have a good day!