fluid-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [fluid-dev] How to send manual midi commands to fluidsynth from anot


From: Pedro Lopez-Cabanillas
Subject: Re: [fluid-dev] How to send manual midi commands to fluidsynth from another program?
Date: Sun, 12 Oct 2008 15:33:54 +0200
User-agent: KMail/1.9.6 (enterprise 20070904.708012)

John O'Hagan wrote:
> Hi,
>
> I'm writing an algorithmic music program which generates lists of numbers
> representing notes and durations. The results can be printed as scores and
> played as midi files using lilypond, and to play the results as they are
> generated (i.e., bar by bar), I'm using the sox synth.
>
> That's pretty limited, however, so I thought that fluidsynth might be the
> way forward.
>
> The simplest solution would be to translate my number lists into noteon
> commands, etc, and pipe them to fluidsynth.
>
> But I need a little help understanding the fluidsynth shell.
>
> When that is active, I can type commands in, but I cant figure out how to
> pipe them from my program. I tried sending a file object to stdout but it
> seemed to just disappear. Also, when I try to run fluidsynth with the -i
> switch, (no shell), it seems to start up, then immediately exit.
>
> I can get a result by translating my data  into a text-to-midi program,
> then piping that to, say, pmidi, which plays via fluidsynth, but that seems
> very roundabout.
>
> Any advice?

Use the TCP/IP shell server mode. QSynth enables it in Linux, or you can 
enable it in the command line client with the argument "-s, --server". By 
default, the shell port is 9800/tcp, but you can change the number with the 
setting "shell.port", for instance:

$ fluidsynth -i -s -o "shell.port=9988" ...

To send commads to the shell server, use the telnet protocol:

$ telnet localhost 9988
noteon 1 66 100
noteoff 1 66
...

Using the bash shell, or a bash script:
$ echo "noteon 1 60 100" > /dev/tcp/localhost/9988
$ echo "noteoff 1 60" > /dev/tcp/localhost/9988
...

Hope this helps.

Regards,
Pedro




reply via email to

[Prev in Thread] Current Thread [Next in Thread]