christofmuc / JammerNetz

OpenSource internet jam sessions, aka Networked Music Performance software.
GNU Affero General Public License v3.0
51 stars 13 forks source link

Need UI to configure MIDI recording #11

Open christofmuc opened 3 years ago

christofmuc commented 3 years ago

Currently that's an undocumented feature...

reneknuvers commented 3 years ago

Can midi be sent over the internet? On a Jamulus Facebook group a novice had a question about this. In fact, sending midi would be very reliable and could be used to trigger a metronome puls (as MCC, but also just note on / note off commands that trigger a drum sound of some sort. The difficulty would be to add some rudimentary filtering features. If you look at a typical MIDI stream from different software and hardware, you will notice some devices spitting out a continuous flow of seemingly irrelevant messages. All notes off, sysex, cc and pc commands all should be filterable before they head towards the server to prevent clogging the line and other people's instruments.

christofmuc commented 3 years ago

@reneknuvers Yes, for MIDI there is a standard called RTPMidi, even if it is meant only for LANs the same technology can be used to distribute MIDI over the Internet. I have looked in depth at that technology, and here is the problem: Audio Software like JammerNetz uses potentially unsafe UDP packets, i.e. not all data will necessarily arrive at the recipient. With MIDI, this is a problem, as for each note down message at some point there should be a note up message - but if that package is lost, you'd have hanging notes.

RTPMidi specifies a certain journaling protocol to keep track of keys that need to be released at each point in time should packages drop, but no open source I know has actually implemented this feature, they all just assume all packets are delivered.

I think embedding MIDI data in an Audio stream is possible, but some extra control has to be added, be it an RTPMidi journaling or some other fallback mechanism to deal with lost MIDI data.

This feature was about an additional MIDI recording that is in the source code, but was disabled for now because it is a largely undocumented feature - the use case being that I record what I play during a JAM session (just record all MIDI data locally into one multi-track SMF MIDI file), so I can look it up in case I forgot ;-)

What would really be interesting is to have a synced MIDI clock generator in JammerNetz, so you can sync your drum machine and sequencers etc. Another thing I definitely need to test!