<html dir="ltr"><head></head><body style="text-align: left; direction: ltr; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div><br></div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div class="part-container pre -e-web-view-background-color -e-web-view-text-color" style="border: none; padding: 8px; margin: 0;"><pre>> In the last day or two I have been playing with the Mido library's documentation</pre><pre><font color="#737373">> examples, and just now found much more apparently practical examples:</font></pre><pre><font color="#737373">> </font></pre><pre><font color="#737373">> <a href="https://github.com/olemb/mido/tree/master/examples">https://github.com/olemb/mido/tree/master/examples</a></font></pre><pre><font color="#737373">> </font></pre><pre><font color="#737373">> including what looks like two actual JACK<-->RTP-MIDI bridges in the 'ports' and</font></pre><pre><font color="#737373">> 'sockets' subsections. Will be studying. Seeking much input :-)</font></pre><pre><br></pre><pre>It would be interesting to know what the throughput and latency is with </pre><pre>that setup. I have never thought of python as being particularly great for </pre><pre>real time applications. However, something that works is a great start. </pre><pre>The road from python to c or c++ is not too bumpy depending on the </pre><pre>librarys used.</pre></div></blockquote><div><br></div><div>Agreed!  Am getting there, but am running into a bobble which I am hoping you or someone else will understand :-)</div><div><br></div><div>Have assembled the two files below, midi2tcp.py and tcp2midi.py; you may find them <a href="https://github.com/ponderworthy/midi2ip">here</a>.  When run thus, in separate xterms:</div><div><br></div><div>python2 tcpmidi.py localhost:44440</div><div>python2 midi2tcp.py localhost:44440</div><div><br></div><div>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?</div><div><br></div><div>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.  </div><div><br></div><div>-- </div><div><span><div><i><font color="#1a5d1a">Jonathan E. Brickman   <a href="mailto:jeb@ponderworthy.com">jeb@ponderworthy.com</a>    (785)233-9977</font></i></div><div><i><font color="#1a5d1a">Hear us at ponderworthy.com -- CDs and MP3 available!</font></i></div><div><i><font color="#1a5d1a">Music of compassion; fire, and life!!!</font></i></div></span></div></body></html>