Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] Score rewinding

Date2005-05-09 15:45
FromMichael Gogins
SubjectRe: [Cs-dev] Score rewinding
Thanks for your response.

MIDI file playback should be paused also, but not realtime MIDI event processing. Already active score events should be ended. In other words, setIsScorePending(0) means "stop performing the score (but keep processing realtime events)" and setIsScorePending(1) means "resume performing the score from the same point it was stopped (or from wherever the score offset has been set to)".

I understand that the new event handling code breaks the old way of pausing score playback. I thought about trying to fix it myself, but I realized that I do not understand it as well as you do. In general, I prefer the new code since it is more precise and it also seems more modular.

I think it would work fine if score offset were done only after compiling, at least for VST hosts, because event processing for a block of samples always happens just before audio processing for that block. Therefore, the Csound plugin is always able to advance the score (if it needs to) before any audio is produced.

Regards,
Mike

-----Original Message-----
From: Istvan Varga 
Sent: May 9, 2005 10:00 AM
To: csound-devel@lists.sourceforge.net
Subject: Re: [Cs-dev] Score rewinding

Michael Gogins wrote:

> Score pause should mean:
> 
> The Csound performance loop continues, and continues to receive and
 > dispatch real-time  events, and synthesize audio; but the events from
 > the Csound score are not dispatched, and the score pointer does not advance.

I already know that, however, I assume, MIDI file playback should be paused
too, correct ? Also, should already active score notes be extended and held
indefinitely until playback is unpaused again ? Or turned off after the normal
duration ?

> This may last have worked in the version of CsoundVST built for Csound version
 > 4.23. It was not hard to implement; there was an isScorePending_ flag and rdscor
 > looked at it.

I was aware of that method, but there are a few problems. First, it does not
work with the new implementation of sensevents() in Csound5 (can revert to the
old method, but that has different problems like drifting and accumulating
timing errors over time). Also, having the score time and real time (kcounter)
out of sync can confuse some event related opcodes. And it obviously will not
pause MIDI file playback.

> For the second point about "csoundCompile implies csoundReset",
 > thanks for the explanation.

But not if you call csoundPreCompile first. Then csoundPreCompile will imply
csoundReset, but csoundCompile will not, allowing to change settings (such as
score offset).
Of course, score offset will always work if called just after csoundCompile.


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