Making processing and fluidsynth talk

Just a quick post if you are interested in triggering notes from Processing to Fluidsynth. It could be great if your works have a visual component and you need responsive notes in the background that you wish to play using your soundfont via Fluidsynth.

Fluidsynth listens to commands via a telnet socket on port 8888 (you can change this i guess) that you can write to using a processing sketch.

So, just write to the socket if something turns up. It makes it very useful while making realistic music installation when playing frequency correct notes. There is also an option to use minim library, but i found it pretty complex and wanted a modular approach where i can fiddle with the audio program. I also feel it is a bit more responsive.

The code looks like :

Cheers,

Rohit