[CM] update re: CM/Linux/MidiShare
dlphillips@woh.rr.com
dlphillips@woh.rr.com
Sun, 27 Mar 2005 07:24:24 -0500
Hi Rick:
I think I've figured out how and where MidiShare works and doesn't work with CM in Linux. Basically, code written with the high-level MIDI objects will work fine. For example, the following code will work in either the cmio GUI or from the prompt:
(define (ms-test1)
(process repeat 200
output (new midi :time (now)
:duration (pick .1 .2 .3 .2 .1 .1 .2 .3 .2 .1)
:amplitude (between 40 60)
:keynum (pick 58 60 62 64 65 67 68 70 72 73 75 76 79 80))
wait (pick .1 .2)))
(define (ms-test2)
(process repeat 200
output (new midi :time (now)
:duration (pick .1 .2 .3 .2 .1 .1 .2 .3 .2 .1)
; :duration (pick .25 .25 .50 1.0 .25 .25 .50)
:amplitude (between 40 60)
:keynum (pick 36 38 41 43 48 50 53 55 60 62 65 67 70 72))
wait (pick .1 .2)))
Assuming an opened MS MIDI port, running (events (list (ms-test1) (ms-test2) "midi.port") will then create a realtime MIDI output stream that I can play via a MidiShare-enabled fluidsynth. Incidentally, the GUI replaces whatever file name is in the Execute entry box with "midi.port", which I think is correct behavior, yes ?
The situation is not so clear regarding the low-level MIDI objects, i.e. the ms:* family. This code will work fine when run alone:
(output (ms:new typeNote :port 1
:pitch (between 50 80)
:vel (between 30 50)
:dur (pick 100 200 300)))
But it fails in this setting:
(define (rankeys)
(process repeat 100
output (ms:new typeNote :port 1
:pitch (between 50 80)
:vel (between 30 50)
:dur (pick 100 200 300))
wait (pick 100 200)))
; (events (rankeys) "midi.port")
Running (rankeys) in the Events dialog results in the following error:
* (events (rankeys) "midi.port")
No matching method for the generic function
#<STANDARD-GENERIC-FUNCTION OBJECT-TIME (4) {59F783E9}>, when called with
arguments
(#<Alien (*
(ALIEN:STRUCT MIDISHARE::TMIDIEV
(MIDISHARE:LINK (* (ALIEN:STRUCT MIDISHARE::TMIDIEV)))
(DATE (ALIEN:SIGNED 32)) (EVTYPE (ALIEN:SIGNED 8))
(REF (ALIEN:SIGNED 8)) (PORT (ALIEN:SIGNED 8))
(CHAN (ALIEN:SIGNED 8))
(MIDISHARE::DATA
(UNION MIDISHARE::EVDATA
(MIDISHARE::NOTE
(ALIEN:STRUCT MIDISHARE::PITCHVELDUR
(MIDISHARE:PITCH (ALIEN:SIGNED 8))
(MIDISHARE:VEL (ALIEN:SIGNED 8))
(MIDISHARE:DUR (ALIEN:SIGNED 16))))
(MIDISHARE::DATA
(ALIEN:STRUCT MIDISHARE::DATAS
(MIDISHARE::DATA0 (ALIEN:SIGNED 8))
(MIDISHARE::DATA1 (ALIEN:SIGNED 8))
(MIDISHARE::DATA2 (ALIEN:SIGNED 8))
(MIDISHARE::DATA3 (ALIEN:SIGNED 8))))
(MIDISHARE:INFO (ALIEN:SIGNED 32))
(MIDISHARE:LINKSE
(*
(ALIEN:STRUCT MIDISHARE::TMIDISEX
(MIDISHARE:LINK (* (ALIEN:STRUCT MIDISHARE::TMIDISEX)))
(MIDISHARE::DATA (ARRAY (ALIEN:SIGNED 8) 12)))))
(MIDISHARE:LINKST
(*
(ALIEN:STRUCT MIDISHARE::TMIDIST (MIDISHARE::PTR1 (* T))
(MIDISHARE::PTR2 (* T)) (MIDISHARE::PTR3 (* T))
(MIDISHARE::PTR4 (* T))))))))) at #x082129C4>).
[Condition of type PCL::NO-APPLICABLE-METHOD-ERROR]
Restarts:
0: [CONTINUE] Retry call to :FUNCTION.
1: [ABORT ] Return to Top-Level.
Debug (type H for help)
("DEFMETHOD NO-APPLICABLE-METHOD (T)" #<unused-arg> #<unused-arg>
#<STANDARD-GENERIC-FUNCTION OBJECT-TIME (4) {59F783E9}>
(#<Alien # at #x082129C4>))
Source: Error finding source:
Error in function DEBUG::GET-FILE-TOP-LEVEL-FORM: Source file no longer exists:
target:pcl/braid.lisp.
0] 1
*
Btw, I can open and close the MS MIDI port without errors now (from GUI or prompt), though I'll keep an eye on its behavior.
So, my provisional conclusion is that MidiShare works fine with CM's high level MIDI objects but not so well with the low-level ones. There may be advantages to using the MidiShare objects but I've not been testing anything that can't be done with the high level objects. I will keep testing and would appreciate any advice re: looping with the MidiShare objects.
Best regards,
dp