Interfacing an external package with Clean
Pascal Serrarens
pascalrs@cs.kun.nl
Wed, 24 Feb 1999 11:21:18 +0100
letz@rd.grame.fr wrote:
>
> Hi,
>
> We would like to interface our Midi operating system MidiShare with the
> Clean language.
> Using the Hotclean utility, we were able to compile a link some external C
> functions.
> On the Macintosh, we tried to look at the Mac toolbox implementation, but
> we get rapidly very confused!
> Does anybody has an experience in developing this kind of interface?
Yes, I have implemented a interface to OMS (open music system) on the
macintosh, only the MidiOut part at the moment, but that will probably change
in the future.
I based the interface on the new message passing system, treating the MIDI out
port as a channel on which messages can be send.
MIDI programs look like this:
Start w
#! (midiOut, w) = openMidiOut w
w = send midiOut (NoteOn 1 60 127) w
w = sleep 60 w // wait 60 ticks = 1 sec
w = send midiOut (NoteOff 1 60 0) w
= w
I found this approch very convenient: I could write a standard MIDI file
player in two days.
Unfortunately, I am going on vacation for a month next week, so I can't do
much work on it.
More information on mesage passing for clean can be found in the 'Explicit
Message Passing for Concurrent Clean' paper, which can be found on my
home-page (http://www.cs.kun.nl/~pascalrs).
--
Pascal Serrarens
Concurrent Clean developer
University of Nijmegen, NL