CM/CMN note output method and chords

Larry Troxler lt@westnet.com
Mon, 8 Dec 1997 23:30:15 -0500 (EST)


On Mon, 8 Dec 1997, Rick Taube wrote:

> if you transcribe from midi-events then you are always going to have to
> "parse" chord information from the flow of seperate events. the alternative
> would be to invent your own class of note that handles chords "atomically"
> in cmn, and then provide a write-event method for midi if you also want to
> hear it, ie somethinkg like
> 
> (defmethod write-event ((object whatever) (stream midi-port))
>   ;; copy params to midi-note and output it
>   (loop with msg = (object midi-note)
>         for n in (slot-value object 'chord) ; object holds more than one note.
>         do (setf (slot-value msg 'note) n)
>            (write-event msg stream)))
> 

Ok, so you are suggesting making something like a midi-chord class. I
suppose that would be the best way to handle it. I just thought that as a
short-cut I could avoid creating a new class. I already have some parsing
routines for the stuff I want to do within CM - the only problem I have is
not having access to the correspnding CMN chord object, which from my
understanding, CMN is creating on the fly based on the note durations. 

So, yes, like you say, the correct approach would be to create a chord
class at the CM level, and then the method that writes to cmn-file could
use cmn::chord, and then presumably the "marker" slot in the cmn
stream, which I am
currently using to add the fingering, would add messages to a cmn::chord
if it is operating on a "chord" object.

Alas, this is too much work for me, especially since I could no longer
tread the thread in Stella as before - for example, mapping commands would
be much different since they would now have to deal with the chord
objects.


For now, I use map-simultaneous to resort events in each chord in pitch
order, and my marker function adds the fingering to only the top note in
each chord. This is working out fine for what I wanted it for, and in
fact is a lot less cluttered than the result would be even if I did
manage to mark the fingering for each note.

For anyone who is still reading at this point and cares, I am using
the fingering mark to mark notes with their position in the container.
 
So in effect, I'm using the CMN output as a sort of fancy "list" command.

> >Is there a way in a CM write-event method for a note going to a cmn-file,
> >to add a mark or CMN message to the chord the note belongs to?
> >
> >My specific problem is that I would like use the CMN fingering message to
> >mark all notes with their index in their thread. However, I find that
> >applying the fingering to the individual notes results in a mess, and I
> >think I probably need to add the fingerings to the chord as a whole.
> >
> >I almost think that I am better off not using the midi-note method, but
> >writing code that writes the thread as a whole (I would iterate through
> >the notes myself). Is there a way to do this within the CM/CMN framework?
> >
> >Larry
> >
> >
> >
> >
> >--  Larry Troxler  --  lt@westnet.com  --  Patterson, NY USA  --
> >
> 
> 
> 

--  Larry Troxler  --  lt@westnet.com  --  Patterson, NY USA  --