[CM] CM Midi question

taube at uiuc.edu taube at uiuc.edu
Fri Mar 26 17:31:13 PST 2004


>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




More information about the Cmdist mailing list