Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] csoundRewind() ?

Date2005-05-07 22:17
FromMichael Gogins
SubjectRe: [Cs-dev] csoundRewind() ?
Thanks for the information. I will test this myself and see what happened to the rewinding. Perhaps it is easy to see what to fix, perhaps Istvan needs to be involved.

Regards,
Mike


-----Original Message-----
From: Victor Lazzarini 
Sent: May 7, 2005 4:54 PM
To: csound-devel@lists.sourceforge.net
Subject: Re: [Cs-dev] csoundRewind() ?

I tried using the functions in the order you show, but
with no luck. I lost my patience and implemented the
rewinding using csoundReset() and csoundCompile()
again.

I also could not manage to get the score offset setting
function to work. Otherwise, the API is brilliant.

Victor

>
> I haven't tested score rewinding since Istvan introduced
> many changes, but here's how it's supposed to be used
> (CppSound is a C++ wrapper for the Csound API):
>
> void CsoundVST::synchronizeScore()
> {
>   vstPriorSamplePosition = vstCurrentSamplePosition;
>   VstTimeInfo *vstTimeInfo = getTimeInfo(0);
>   vstSr = double(vstTimeInfo->sampleRate);
>   vstCurrentSamplePosition = (int) vstTimeInfo->samplePos;
>   vstCurrentSampleBlockStart = vstTimeInfo->samplePos /
> vstSr;
>   if((vstCurrentSamplePosition && !vstPriorSamplePosition)
> ||
>      (vstCurrentSamplePosition < vstPriorSamplePosition))
>     {
>       if(getCppSound()->getIsGo())
>     {
>       getCppSound()->setScorePending(1);
>       getCppSound()->rewindScore();
>
> getCppSound()->setScoreOffsetSeconds(vstCurrentSampleBlock
> Start);
>       csound::System::inform("Score synchronized at
> %f...\n", vstCurrentSampleBlockStart);
>     }
>     }
> }
>
>
> -----Original Message-----
> From: Victor Lazzarini 
> Sent: May 7, 2005 9:29 AM
> To: csound-devel@lists.sourceforge.net
> Subject: [Cs-dev] csoundRewind() ?
>
> I'm having trouble with csoundRewind(). I expected that
> it would rewind a compiled score back to the beginning
> and then the next call to csoundPerformKsmps() would start
> playing it.
>
> But after I call it, csoundPerformKsmps() doesn't budge.
> Everything
> else around it seems to be working, because if I send an
> event to csound, then csoundPerformKsmps() plays it.
>
> Is there anything else I should do to start the score
> performance?
> Of course I could call csoundReset() and do
> csoundCompile() again, but that's not very elegant.
>
> Apart from that csoundapi~ is going well; I've just got to
> implement the invalue/outvalue interface before a beta
> release. Compiles and runs with libcsound 5 and 4.23;
> next week at work I'll try it on Linux, which should
> offers the
> best cs5  performance.
>
> Victor
>
>
> -------------------------------------------------------
> 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
> 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
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-07 22:33
FromIstvan Varga
SubjectRe: [Cs-dev] csoundRewind() ?
Michael Gogins wrote:

> Thanks for the information. I will test this myself and see what
 > happened to the rewinding. Perhaps it is easy to see what to fix

Correctly implementing these functions may not be really easy.
The current version of csoundRewindScore() only calls fseek() on
the score file, and while it may have worked to some extent
earlier, it apparently does not with the new sensevents().
In fact, resetting the performance to time zero is a lot more
complex task than just rewinding the score file; you need to:
   * deactivate all currently playing notes immediately
   * reset the various state variables used by musmon.c and others
   * rewind MIDI file playback (if any) to zero time as well
   * rewind the score file, of course

The other score control functions seem to be stubs, and I am not
sure if those ever worked, nor do I know exactly how are they
intended to be used.


-------------------------------------------------------
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-08 18:24
FromIstvan Varga
SubjectRe: [Cs-dev] csoundRewind() ?
Score rewind and offset are now implemented and committed, but not tested yet,
so it may or may not work. I am not sure about the purpose of "score pending"
functions, so these still do not have any effect.


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