[Impromptu] how to play multiple instr. on the same audiounit?
Andrew Sorensen
andrew at moso.com.au
Tue Mar 24 23:30:44 GMT 2009
Michele,
This totally depends on the AU in question. Some AU's support
multiple midi channels, others don't. Usually, an AU that DOES
support multiple MIDI channels will let you control them using normal
MIDI concepts such as program changes, SYSEX messages etc.. I'm not
sure about Crystal but an example for the DLS is below.
Of course the "usual" way to handle multiple sound sources in
impromptu is to run multiple instances of your AU. Although this is
less efficient it is generally more flexible.
(define dls (au:make-node "aumu" "dls " "appl"))
(au:connect-node dls 0 *au:output-node* 0)
(au:update-graph)
(au:midi-out (now) dls *io:midi-pc* 0 30 0)
(au:midi-out (now) dls *io:midi-pc* 1 35 0)
(au:midi-out (now) dls *io:midi-pc* 2 55 0)
(au:midi-out (now) dls *io:midi-pc* 3 80 0)
(au:midi-out (now) dls *io:midi-pc* 4 105 0)
(define loop
(lambda (beat)
(play 0 dls 48 80 1 0)
(play .5 dls 60 80 1 1)
(play 1. dls 67 80 1 2)
(play 1.5 dls 72 80 1 3)
(play 1.75 dls 84 80 1 4)
(callback (*metro* (+ beat (* .5 2))) 'loop (+ beat 2))))
(loop (*metro* 'get-beat 4))
More information about the Impromptu
mailing list