[Impromptu] how to play multiple instr. on the same audiounit?

Michele Pasin michele.pasin at kcl.ac.uk
Wed Mar 25 17:51:27 GMT 2009


Thanks a lot Andrew, that example was what I was looking for!
Soon or later I'll have to study the MIDI protocol more carefully..  
but for now that's all I needed.

To David: thanks for the tip, I'll keep that in mind!



Michele



On 24 Mar 2009, at 23:30, Andrew Sorensen wrote:

> 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))
>
> _______________________________________________
> Impromptu mailing list
> Impromptu at lists.moso.com.au
> http://lists.moso.com.au/mailman/listinfo/impromptu









____________________________
Dr. Michele Pasin, Researcher
Centre for Computing in the Humanities
King's College, London
http://staff.cch.kcl.ac.uk/~mpasin/









More information about the Impromptu mailing list