On Tue, 14 Oct 2008, John O'Hagan wrote: > On Mon, 13 Oct 2008, you wrote: > > John O'Hagan wrote: [...] > > > > Note that FluidSynth doesn't follow strictly the telnet protocol, so you > > can use something simpler. The command line utility netcat(1) (or 'nc') > > is > > [...] > > > What I mean is that you can use simple TCP/IP sockets and text streams, > > instead of the telnet class. > > > > #!/usr/bin/python > > import sys > > import time > > from socket import * > > serverHost = "localhost" > > serverPort = 9800 > > s = socket(AF_INET, SOCK_STREAM) > > s.connect((serverHost, serverPort)) > > s.send("noteon 1 66 100\n") > > time.sleep(1) > > s.send("noteoff 1 66\n") > > s.send("quit\n") > > data = s.recv(1024) > > print data > > [...] > > Thanks for the suggestion, Pablo: simpler is better, after all. > > I tried the socket approach, and while it works, multiple connections break > the pipe, whereas Telnet() seems to handle this gracefully, so I put it > back in, as I want to be able to send several streams of midi messages to > one instance of fluidsynth. > > Or is this possible with sockets too? If it is, I missed it.
I sure did: that last part of my post was untrue, the pipe-breaking was an unrelated issue. John _______________________________________________ fluid-dev mailing list fluid-dev@nongnu.org http://lists.nongnu.org/mailman/listinfo/fluid-dev