Discussion:
[haskell-art] Sending MIDI via Jack
alex
2012-11-04 21:04:10 UTC
Permalink
Hi all,

Would anyone have a example to hand of how to send MIDI messages over
Jack using Haskell?

Best wishes,

alex
--
http://yaxu.org/
Henning Thielemann
2012-11-04 21:20:26 UTC
Permalink
Post by alex
Would anyone have a example to hand of how to send MIDI messages over
Jack using Haskell?
I have not a working example but I would like to add one to the 'jack'
package. The general idea is to chop your MIDI stream into blocks of a
duration that the JACK server provides, and then send the blocks when
their time comes.
You may communicate with your JACK client from the main thread via
Concurrent.Chan. E.g. you may send the MIDI stream block by block via a
Chan.
You may also use an IORef to maintain a state in the JACK client. Then
you could initialize the client with a pointer to the stream and let the
client chop the stream.

Here is a simple software synthesizer that converts MIDI input to audio
output, if that helps:
http://code.haskell.org/jack/examples/Synthesizer.hs

Continue reading on narkive:
Loading...