[CM] a quick, realy basic question
Rick Taube
taube at uiuc.edu
Wed Jun 12 05:23:10 PDT 2002
>getting an error. Would some kind person
>explain what I'm doing wrong:
>
>I said:
>
>(setf pal-foo (new palindrome notes (import-events "c:\\tmp\\blah.mid")))
sorry ive been away for a few days.
its not clear from your example what you are actually indending to put in your palindrome. import-events will return one or more seqs holdings the midi messages it parses from a file. these midi messages are not "notes" as it would appear you expect given your expression: (new palindrome notes ...)
this is what i think you want to do:
1) import a track of data from a midifile:
(setf x (import-events "c:\\tmp\\blah.mid" :tracks 1) )
2. define a function that maps over subobjects and returns keynumbers:
(defun subobjects->keynums (seq)
(loop for m in (subobjects seq)
when (typep m 'midi)
collect (midi-keynum m)))
3. create a palindrome from that data:
(setf y (new palindrome notes (subobjects->keynums x)))
that should give you a palindrome of the note values of the midi objects you parsed in track 1 of a file.
>I'm attempting my first non-example CM interaction and not surprisingly am
>getting an error. Would some kind person
>explain what I'm doing wrong:
>
>I said:
>
>(setf pal-foo (new palindrome notes (import-events "c:\\tmp\\blah.mid")))
>
>I got:
>
>*** - argument to ROUND should be a real number: #<seq: "BLAH-TRACK-0">
>
>(setf pal-foo (new palindrome notes (import-events "c:\\tmp\\blah.mid"
>:tracks 1)))
>
>got me the same error msg.
>
>Sorry, I just don't know what it's refering to.
>
>Thank in advance,
>
>Carl Edwards
>
>
>
>_______________________________________________
>Cmdist mailing list
>Cmdist at ccrma.stanford.edu
>http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist
More information about the Cmdist
mailing list