Using MIDI for RPC
Moderators: MattKingUSA, khz
-
- Established Member
- Posts: 1516
- Joined: Sun Jan 27, 2019 2:25 pm
- Location: Italy
- Has thanked: 385 times
- Been thanked: 299 times
Using MIDI for RPC
Many synths have nice features which can't be configured via MIDI, because MIDI offers a limited set of commands. At the same time, OSC supports is not that widespread.
I was thinking that maybe MIDI ports could be used to send arbitrary data, in a way similar to how RPCs work.
This way you could for example write a Python program that fully interacts with a running ZynaddsubFX instance easily, without any API calls. Just connect it to the JACK/ALSA MIDI in port, send the commands and (if necessary) get the results back from the MIDI out port.
Was this ever attempted? Is there a way to use MIDI to send arbitrary data?
I was thinking that maybe MIDI ports could be used to send arbitrary data, in a way similar to how RPCs work.
This way you could for example write a Python program that fully interacts with a running ZynaddsubFX instance easily, without any API calls. Just connect it to the JACK/ALSA MIDI in port, send the commands and (if necessary) get the results back from the MIDI out port.
Was this ever attempted? Is there a way to use MIDI to send arbitrary data?
The community of believers was of one heart and mind, and no one claimed that any of his possessions was his own, but they had everything in common. [Acts 4:32]
Please donate time (even bug reports) or money to libre software
Jam on openSUSE + GeekosDAW!
Please donate time (even bug reports) or money to libre software
Jam on openSUSE + GeekosDAW!
-
- Established Member
- Posts: 2348
- Joined: Mon Jul 01, 2013 8:13 am
- Has thanked: 9 times
- Been thanked: 468 times
Re: Using MIDI for RPC
Why do you want that?
First point is, you need to abuse a protocol to do so, this abuse must be supported by the application you want to serve by this.
Much easier is a socket to use, which could do all that, without abusing a protocol. A (rpc) socket could as well be used across networks, so you could control the app in question from a other PC or tablet or even from your Phone, not only from a python script.
btw. guitarix does that since years now, and a lot of projects use sockets to control guitarix from a arduino board for example, or control guitarix running on a RPI.
First point is, you need to abuse a protocol to do so, this abuse must be supported by the application you want to serve by this.
Much easier is a socket to use, which could do all that, without abusing a protocol. A (rpc) socket could as well be used across networks, so you could control the app in question from a other PC or tablet or even from your Phone, not only from a python script.
btw. guitarix does that since years now, and a lot of projects use sockets to control guitarix from a arduino board for example, or control guitarix running on a RPI.
On the road again.
-
- Established Member
- Posts: 1516
- Joined: Sun Jan 27, 2019 2:25 pm
- Location: Italy
- Has thanked: 385 times
- Been thanked: 299 times
Re: Using MIDI for RPC
Well, you are right, I guess I was thinking about using already established things like JACK to make this kind of communication more straightforward for non-techies as well...just plug two MIDI ports and let programs do the talking, something like that.tramp wrote:Why do you want that?
First point is, you need to abuse a protocol to do so, this abuse must be supported by the application you want to serve by this.
Much easier is a socket to use, which could do all that, without abusing a protocol. A (rpc) socket could as well be used across networks, so you could control the app in question from a other PC or tablet or even from your Phone, not only from a python script.
btw. guitarix does that since years now, and a lot of projects use sockets to control guitarix from a arduino board for example, or control guitarix running on a RPI.
The community of believers was of one heart and mind, and no one claimed that any of his possessions was his own, but they had everything in common. [Acts 4:32]
Please donate time (even bug reports) or money to libre software
Jam on openSUSE + GeekosDAW!
Please donate time (even bug reports) or money to libre software
Jam on openSUSE + GeekosDAW!
-
- Established Member
- Posts: 2059
- Joined: Tue Feb 16, 2016 6:56 am
- Location: Kangasala, Finland
- Has thanked: 374 times
- Been thanked: 209 times
- Contact:
Re: Using MIDI for RPC
I think scope is too narrow. Pretty logical extension of this idea would be TCP/IP over MIDI. And I would not be amazed if someone would have implemented that.
Linux veteran & Novice musician
Latest track: https://www.youtube.com/watch?v=ycVrgGtrBmM
-
- Established Member
- Posts: 1516
- Joined: Sun Jan 27, 2019 2:25 pm
- Location: Italy
- Has thanked: 385 times
- Been thanked: 299 times
Re: Using MIDI for RPC
http://www.halfbakery.com/idea/TCP_2fIP_20over_20MIDItavasti wrote:I think scope is too narrow. Pretty logical extension of this idea would be TCP/IP over MIDI. And I would not be amazed if someone would have implemented that.
It looks like someone thought about it but I couldn't find any implementation...this could also open the road for OSC over MIDI I think (even if it uses UDP)!
Last edited by Basslint on Tue Apr 16, 2019 12:28 pm, edited 1 time in total.
The community of believers was of one heart and mind, and no one claimed that any of his possessions was his own, but they had everything in common. [Acts 4:32]
Please donate time (even bug reports) or money to libre software
Jam on openSUSE + GeekosDAW!
Please donate time (even bug reports) or money to libre software
Jam on openSUSE + GeekosDAW!
Re: Using MIDI for RPC
Yes. You put the data inside a "System Exclusive" MIDI message. This message starts with the hex byte F0 and ends with the hex byte F7. In between these two bytes can be any number of bytes, for any purpose. But the data bytes must be 7-bit (ie, only values 0 to 127). So if you need values 128 to 255, you'll have to "bit pack" the data when it is sent, and unpack when received.Basslint wrote:Is there a way to use MIDI to send arbitrary data?
To make sure you don't interfere with System Exclusive messages already used by various MIDI equipment, it's recommended that the first (one to three) data bytes be a "manufacturer's ID" as registered with MIDI Manufacturer's Association (MMA). For example, Microsoft's ID is hex 00 00 41. So Microsoft sysex messages start with the 4 bytes:
Code: Select all
F0 00 00 41
If you have a MIDI-related question, I'm the guy you want to talk to.
Attached to this post is a zip file containing some tutorials I've written about MIDI specs.
P.S, Although Open Sound Control (OSC) supports sending most MIDI messages, it doesn't support sending MIDI System Exclusive.
- Attachments
-
- midispec.zip
- (98.57 KiB) Downloaded 82 times
Author of BackupBand at https://sourceforge.net/projects/backupband/files/
My fans show their support by mentioning my name in their signature.