| MIDI note offs are not difficult to handle if you use a push-down stack of
running instrument instances for each MIDI channel/MIDI key slot. Note on
messages push an instrument instance onto the stack, and note off messages
pop an instrument instance off the stack. This is not perfect, but it works
well enough.
In my view, the MIDI opcodes of Csound should be supplemented by an option
to translate MIDI channel messages into score events and do the
pushing/popping to handle note on/note off. Then people could develop,
debug, and maintain one single instrument definition that would work for
both realtime and nonrealtime synthesis.
In this option, note on events would create instrument instances with
negative p3, and note off events would pop an instance and set its p3 to the
positive value of the current elapsed instrument time. When used with
timout, I believe this would enable an instrument to trap the note off and
extend p3 again, or invoke ihold, to perform a decay before actually turning
itself off. This would work for both score events and MIDI events.
-----Original Message-----
From: richard bowers
To: joshwhiting@hotmail.com
Cc: csound csound
Date: Friday, July 23, 1999 8:13 AM
Subject: Re: sequencer
>Josh, you have highlight an issue which I've been interested in in the
past.
>I haven't read your message in detail but, from my point of view, I would
>like some direct csound/sco type conversion which doesn't involve third
>party software.
>
>I have just started using Direct Csound and am delighted with the MIDI
>functionality but would love to be able to save the MIDI as a sequence
>(*.mid) file. I have found that doing some realtime csound processing with
>control from a MIDI keyboard is quite a pleasant and flexible way of
>working. It would be nice to be able to save the sequence without involving
>a further strain on the computer with a third party sequencer.
>
>Also, I would like to have conversion of MIDI data into a user definable
>.sco file where duration of notes is supported (ie Note-off is interpreted
>and applied to the duration field of the .sco file. This may be problematic
>because, in the case of overlapping notes for the same pitch, I don't think
>MIDI distinguishes between the note occurences (presumably based on the
>assumption that any player would release a note before repeating it). So am
>I right in thinking that the note-offs are difficult to handle?
>
>Anyway, I for one would welcome some form of rudimentary MIDI
>sequence-saving facility in csound and a MIDI to sco conversion system (I
>know one exists already, but I would love to see a seamless operation, if
>poss.)
>
>I apologise to the programmers amongst you - I am completely ignorant of
the
>scale of this problem so forgive me.
>
>Richard Bowers.
> |