[CM] CM Midi question

taube@uiuc.edu taube@uiuc.edu
Fri, 26 Mar 2004 19:31:13 -0600


>Hmm, i seem to miss something obvious: how can i change
>the instrument number of a midi channel? I seem to recall
>'midi-channel-message' but can't find them in the dict.

If you are writing events to a midi file from a process, then this will work in either cm 2.4 or 2.5 branches:
                    
(new midimsg :time time :msg (make-program-change chan prog))

where time chan and prog are values. make-program-change is a very old function that makes a really lowlevel message, which im slowly purging from the system...the 2.5 branch is supplanting the 'midimsg' catch-all class with actual goops/clos classes for each type of message. the classes are already in cvs and you can see them listed in midi-topic.html (in the "high level" section) but i still have to hook them into the system (a few hours work to do and test) and of course they are not yet documented yet except by there source in src/midi3.scm. ill send a message in a day or so after i can test them out. at that point you will do something like:

(new midi-program-change :time 0 :program 0 :channel 0)

If you are trying to send a program change in "real time" to the open midi port (cm 2.5) you do something like:

(output (ms:new typeProgChng :program 1 :port 0 :channel 0))

-rick