[Cs-dev] Score Rewinding

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Cs-dev] Score Rewinding

Michael Gogins
I have made some changes to the score rewinding code that bring the
functionality back to what it originally was.

In musmon.c and in csound.c, I removed the code that inserted an 'a' score
event to advance the time, and I added code that simply subtracts the offset
seconds from the current score time and beat. Obviously there is no effect
if the offset is 0 as it is by default.

In other words, with an offset of 5, an event at 5 begins immediately, and
all subsequent events are similarly offset.

I also added code to test for csoundIsScorePending_. If true, processing is
exactly as before. If false, processing is also exactly as before, every
score event is read, times are computed, and so on, except that 'i' events
are simply not inserted into the performance, so they don't sound.

I think the problems that Istvan brought up with respect to 'always on'
events for effect processing, etc., will still be a problem. Also, if you
hit the pause or stop button in Cubase and the score is set to not pending,
events that have already started to play continue to play until they turn
themselves off.

Still, this at least gets the code back to working the way it used to. It is
again possible to run CsoundVST as a plugin that contains a standalone
Csound score, and to write notation for Csound or other plugin softsynths
that plays in sync with the Csound score.

I imagine the same would hold true in csoundapi_tilde, if it uses the API
the same way that CsoundVST does.

Regards,
Mike






-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Csound-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/csound-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Cs-dev] Score Rewinding

Istvan Varga
Michael Gogins wrote:

> In musmon.c and in csound.c, I removed the code that inserted an 'a'
> score event to advance the time,

What was wrong with that ?

> and I added code that simply subtracts  the offset seconds from the current
 > score time and beat.

Which will not work at least in the case of MIDI files (unlike 'a', which
did), and beat mode.

> I also added code to test for csoundIsScorePending_. If true, processing
> is exactly as before. If false, processing is also exactly as before,
> every score event is read, times are computed, and so on, except that
> 'i' events are simply not inserted into the performance, so they don't
> sound.

However, this does not pause playback, but rather than that, mutes events.
And, needless to say, has no effect at all on notes from MIDI files.

@@ -305,11 +305,8 @@
        csound->Message(csound, Str("playing from cscore.srt\n"));
        O->usingcscore = 0;
      }
      csound->Message(csound, Str("SECTION %d:\n"), ++ST(sectno));
-    /* apply score offset if non-zero */
-    if (csound->csoundScoreOffsetSeconds_ > FL(0.0))
-      csound->SetScoreOffsetSeconds(csound, csound->csoundScoreOffsetSeconds_);

Why was this removed ?

                                       /* since we are running in components */
      return 0;                        /* we exit here to playevents later   */
  }

@@ -796,10 +795,10 @@
          case 'q':
          case 'i':
          case 'f':
          case 'a':
-          p->nxtim = (double) e->p[2] + p->timeOffs;
-          p->nxtbt = (double) e->p2orig + p->beatOffs;
+          p->nxtim = (double) e->p[2] + p->timeOffs - csound->csoundScoreOffsetSeconds_;
+          p->nxtbt = (double) e->p2orig + p->beatOffs - csound->csoundScoreOffsetSeconds_ / p->beatTime;

p->nxtbt is wrong. You did assume that tempo can never change during performance, right ?


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Csound-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/csound-devel