Jonathan E. Brickman jeb at ponderworthy.com
Tue Sep 4 05:52:39 CEST 2018

> > In the last day or two I have been playing with the Mido library's
> documentation> examples, and just now found much more apparently
> practical examples:> > 
> https://github.com/olemb/mido/tree/master/examples>; > including what
> looks like two actual JACK<-->RTP-MIDI bridges in the 'ports' and>
> 'sockets' subsections. Will be studying. Seeking much input :-)
> It would be interesting to know what the throughput and latency is
> with that setup. I have never thought of python as being particularly
> great for real time applications. However, something that works is a
> great start. The road from python to c or c++ is not too bumpy
> depending on the librarys used.

Agreed!  Am getting there, but am running into a bobble which I am
hoping you or someone else will understand :-)

Have assembled the two files below, midi2tcp.py and tcp2midi.py; you
may find them here.  When run thus, in separate xterms:

python2 tcpmidi.py localhost:44440
python2 midi2tcp.py localhost:44440

the second connects with the first via TCP, and they both sit quietly,
waiting.  In Catia, I connect RtMidiIn-Client to UM-ONE (USB MIDI
interface to my keyboard), everything still sits quietly.  Then I press
one key on the keyboard once, and both sides report note_on and
note_off over and over again, without stopping until I terminate
them!  Have gone over the Mido docs and sample code several times, have
tried setting 'message' to None after transmit and after receive on
both sides, have also recoded to use accept(), no change.  Have not
found a way to handle this besides terminating and restarting the TCP
connection at every message.  Ideas anyone?

Interestingly, the frequency of the current unintended behavior is a
very steady 12 messages per 1/100 of a second (1200 messages per
second), so I'll think the Mido library is probably incorporating
timing of some sort to semi-mimic hardware MIDI and/or prevent overuse
of hardware; time will tell.  

Jonathan E. Brickman   jeb at ponderworthy.com    (785)233-9977
Hear us at ponderworthy.com -- CDs and MP3 available!
Music of compassion; fire, and life!!!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.linuxaudio.org/archives/linux-audio-dev/attachments/20180903/fbabbdf7/attachment.html>

More information about the Linux-audio-dev mailing list