Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] Score rewinding

Date2005-05-08 23:58
FromMichael Gogins
SubjectRe: [Cs-dev] Score rewinding
Also, I got all sources just now and rebuilt. The score rewinding no longer hangs Cubase, which is great, but it still doesn't behave as it used to.

Right now, if the start of a loop is at time 0 in Cubase, it works.

But if you move the start of the loop to time 5 in Cubase, when the cursor gets to time 5, then Csound starts at Csound score time 0 (5 seconds too late, in other words).

Also, since there is no setScorePending, the minute you compile the Csound score the notes start playing. The idea is that they should not start playing until you hit the Play button in Cubase, then it will either start playing from time 0 (if the loop starts at time 0) or, when Cubase gets to time 5 (in my example), Csound will fast forward to time 5 in the Csound score so it's in syc with the Cubase loop.

Hope this helps... I appreciate your trying to fix this.

Regards,
Mike

-----Original Message-----
From: Michael Gogins 
Sent: May 8, 2005 6:15 PM
To: csound-devel@lists.sourceforge.net
Subject: Re: [Cs-dev] Score rewinding

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
https://lists.sourceforge.net/lists/listinfo/csound-devel





-------------------------------------------------------
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

Date2005-05-09 12:35
FromIstvan Varga
SubjectRe: [Cs-dev] Score rewinding
Michael Gogins wrote:

> But if you move the start of the loop to time 5 in Cubase, when the cursor
 > gets to time 5, then Csound starts at Csound score time 0 (5 seconds too late,
 > in other words).

I do not understand this. Do you mean that you set the score offset to 5 seconds
with the API function, but Csound starts playing from time 0 ?

> Also, since there is no setScorePending, the minute you compile the Csound
 > score the notes start playing.

But was there a working csoundSetScorePending ever ? If yes, how did it work ?


-------------------------------------------------------
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