| Thanks for your prompt response, Istvan. My responses are interspersed below. In general, now that we're talking about these issues, let's try to imagine how we can improve Csound to work better as a plugin for other hosts. In addition to MIDI and audio input and output in that context, we need Start, Pause, Stop, and Seek functions.
VST is mostly on Windows and the Mac, but the csoundapi~ object by Lazzarini will be able to use these functions on Linux, and so would a DSSI plugin or a Jack implementation that works with ALSA MIDI.
>> The purpose of the isScorePending and setScorePending calls is tell the
> > API client whether or not Csound will synthesize pending Csound score events,
> > and for the API client to tell Csound to synthesize pending Csound score events.
>
> So, does this mean that setScorePending is 1 normally (although it defaults to
> 0 at this time), and when zero, events from the score should be skipped ?
> Or delayed until pending is set to 1 again ?
When zero, events from the score should be delayed, until pending is set to 1 again. In other words, this is the Csound "Pause" button.
> Unfortunately it is SetScoreOffsetSeconds that is more problematic than
> rewinding the score (as the operation of the latter can be defined more
> exactly). It has the following limitations:
> * works by entering a special "fast forward" mode, when kperf()
> does not perform any notes, or do any audio I/O; also, note events
> are discarded. One major disadvantage is that seeking to the requested
> time is slow: while it is faster than normal performance, you may still
> need to wait a few seconds if minutes are skipped.
> Perhaps this is why it seems to "hang" ?
No, my experience was that "fast forward" is plenty fast enough to be imperceptible, or at any rate it used to be fast enough, at least for the moderately complex scores (up to a hundred bars, several hundreds of notes) that I was working with.
> * can only seek forward (otherwise you need to rewind first)
> * as notes that would start during the skipped period are removed, you
> can get unexpected results due to skipping global "always on" notes
> (for reverb etc.). A note that starts at time zero is not skipped,
> however.
This may or may not be a problem. Cubase can be counted on to deliver "note off" events for all hanging notes, and I would imagine other VST hosts would do the same. I have a very complex orchestra with 15 instruments, a global mixer, a heavy reverb, and it was all working peachy keen, including looping, stopping, and restarting. My implementation did not attempt to always play notes at time 0, but I see your point about that. I did not try to loop this particular orchestra in the middle of a piece. So the always on stuff may be a problem, but perhaps scores intended for VST performance could be written to work around this problem by starting all the actual notes after some bars of silence (I used to do that anyway, to give my orchestra a chance to compile before the notes came in). In any event, I think the API would benefit from an "AllNotesOff" call.
Even if VST orchestras can't have "always on" events, the score rewinding would still be very useful as global effects could always be provided by other plugins.
Possibly, another API to retrieve the instrument numbers for "always on" instruments could be used, maybe along with a new opcode for instruments to tell Csound they should be "always on". That's getting pretty baroque... but it might be useful in other contexts.
> * should be called between csoundPreCompile and csoundCompile, or after
> csoundCompile before performance. Calling after csoundCreate will not
> work because either csoundPreCompile or csoundCompile would reset first.
I'm sorry, but I'm not sure what you mean here. Can you go into more detail?
Best,
Mike
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net |