Csound Csound-dev Csound-tekno Search About

[Cs-dev] Csound 6 not stopping

Date2013-05-10 19:49
FromMichael Gogins
Subject[Cs-dev] Csound 6 not stopping
AttachmentsNone  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

Date2013-05-10 23:49
FromVictor Lazzarini
SubjectRe: [Cs-dev] Csound 6 not stopping
AttachmentsNone  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:

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
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




Date2013-05-11 01:22
FromMichael Gogins
SubjectRe: [Cs-dev] Csound 6 not stopping
AttachmentsNone  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:
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:

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
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
Victor dot Lazzarini AT nuim dot ie




------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel




--
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com

Date2013-05-11 07:16
FromVictor Lazzarini
SubjectRe: [Cs-dev] Csound 6 not stopping
AttachmentsNone  None  
Only on an empty score.
On 11 May 2013, at 01:22, Michael Gogins wrote:

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

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
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
Victor dot Lazzarini AT nuim dot ie




------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel




--
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




Date2013-05-11 14:02
FromVictor Lazzarini
SubjectRe: [Cs-dev] Csound 6 not stopping
AttachmentsNone  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:

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

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
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
Victor dot Lazzarini AT nuim dot ie




------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel




--
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie