[Cs-dev] Csound 6 not stopping
Date | 2013-05-10 19:49 |
From | Michael Gogins |
Subject | [Cs-dev] Csound 6 not stopping |
Attachments | None None |
I'm developing an example of how to use the Csound 6 API with LuaJIT's foreign function interface. No problems at all except for one...
I use csoundReadScore repeatedly to add score events to the score, then csoundPerform to render it. However, when the last event has been rendered, Csound continues to run. If I use csoundReadScore to send, say, 'e 5' to the score, then performance stops immediately, which is not what I want.
What's the right way for this to be done? Again, the idea is to send score events to Csound and have them render, either to a file or in real time, then exit the performance loop when finished. I'm okay with either 'e 5' as meaning 5 beats after the latest scheduled event, or some function or statement to end performance a given number of beats after the start of performance.
Regards, Mike Michael Gogins Irreducible Productions http://www.michael-gogins.com Michael dot Gogins at gmail dot com |
Date | 2013-05-10 23:49 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] Csound 6 not stopping |
Attachments | None None |
I think this might be because without a score, csound is started with an f0 <long duration>. Using e <time> will generally stop csound after <time> seconds. The way I have killed performances is to stop the processing thread, effectively stop calling csoundPerformKsmps(), then follow it with a csoundReset(). I am not sure what you do in Lua, but I think this is the right way. Alternatively, if you send in a score before csoundStart(), that will be performed until it ends. It might work out to add further events using csoundReadScore(), but I have a feeling they will not keep Csound going (as these will be processed as RT events) after the original score has finished. Victor On 10 May 2013, at 19:49, Michael Gogins wrote:
Dr Victor Lazzarini Senior Lecturer Dept. of Music NUI Maynooth Ireland tel.: +353 1 708 3545 Victor dot Lazzarini AT nuim dot ie |
Date | 2013-05-11 01:22 |
From | Michael Gogins |
Subject | Re: [Cs-dev] Csound 6 not stopping |
Attachments | None None |
Ok, I will try not calling start... didn't know that was the implication! Regards, Mike On Fri, May 10, 2013 at 6:49 PM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
Michael Gogins Irreducible Productions http://www.michael-gogins.com Michael dot Gogins at gmail dot com |
Date | 2013-05-11 07:16 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] Csound 6 not stopping |
Attachments | None None |
Only on an empty score. On 11 May 2013, at 01:22, Michael Gogins wrote:
Dr Victor Lazzarini Senior Lecturer Dept. of Music NUI Maynooth Ireland tel.: +353 1 708 3545 Victor dot Lazzarini AT nuim dot ie |
Date | 2013-05-11 14:02 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] Csound 6 not stopping |
Attachments | None None |
Another solution is to have an instr like this instr end event_i "e", 0 endin and then schedule it as your last score event i "end" 0 1 On 11 May 2013, at 01:22, Michael Gogins wrote:
Dr Victor Lazzarini Senior Lecturer Dept. of Music NUI Maynooth Ireland tel.: +353 1 708 3545 Victor dot Lazzarini AT nuim dot ie |