Csound Csound-dev Csound-tekno Search About

stopping a csound performance...

Date2006-04-29 17:42
FromRory Walsh
Subjectstopping a csound performance...
Is there an opcode that when called will stop a csound performance? For 
example if you had a generative instrument that you wanted to stop once 
a random opcode produces a 99 or something like that? A trivial example 
I know, but do you get the picture?

Rory.

Date2006-04-29 19:13
FromPeiman Khosravi
SubjectRe: stopping a csound performance...
Hi,

Do you mean some kind of conditional function like "if", "goto" or  
"timout"? Maybe the "reinit" opcode?

Sorry if I misunderstood you...
Peiman

On 29 Apr 2006, at 17:42, Rory Walsh wrote:

> Is there an opcode that when called will stop a csound performance?  
> For example if you had a generative instrument that you wanted to  
> stop once a random opcode produces a 99 or something like that? A  
> trivial example I know, but do you get the picture?
>
> Rory.
> -- 
> Send bugs reports to this list.
> To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk

Date2006-04-29 19:30
FromIstvan Varga
SubjectRe: stopping a csound performance...
AttachmentsNone  

Date2006-04-29 20:48
FromHudson Lacerda
SubjectRe: stopping a csound performance...
Rory Walsh escreveu:
> Is there an opcode that when called will stop a csound performance? For 
> example if you had a generative instrument that you wanted to stop once 
> a random opcode produces a 99 or something like that? A trivial example 
> I know, but do you get the picture?
> 
> Rory.

We talked about this recently (yesterday?). This is the summary of what 
I recall (well, they are trivial examples, but anyway...):

0) There is the opcode `exitnow'; one can use it inside a conditional 
block, like:

    if gkquit > .5 then
         exitnow
    endif

1) One can create an `e' score event with the opcode `event_i':

    event_i "e", 0, 0, 0.1

2) One can use a FLTK button to create an `e' score event (one can 
change it to call a kind of ``coda'' instrument):

--------------------------------------------------------------------

iASCIIe = 101 ; 'e' as ASCII
iASCIIi = 105 ; 'i' as ASCII
FLpanel "Running CSound",380,500,50,50
  gkquit, iquit FLbutton "Quit", 1, 0, 1, 340, 25, 20, 450, iASCIIe, 0, 0
FLpanelEnd
FLrun

instr 1
endin



f0 3600

--------------------------------------------------------------------

3) Opcodes like `turnoff', `turnoff2' and `ihold' can be used for more 
control of performance.

Regards,
Hudson


-- 
   '-------------------------------------------------------------------.
Hudson Lacerda 
*Não deixe seu voto sumir! http://www.votoseguro.org/
*Apóie o Manifesto:        http://www.votoseguro.com/alertaprofessores/

                     == THE WAR IN IRAQ COSTS ==
http://nationalpriorities.org/index.php?option=com_wrapper&Itemid=182
   .-------------------------------------------------------------------'
--


		
_______________________________________________________ 
Novidade no Yahoo! Mail: receba alertas de novas mensagens no seu celular. Registre seu aparelho agora! 
http://br.mobile.yahoo.com/mailalertas/ 
 

Date2006-04-29 20:50
FromRory Walsh
SubjectRe: stopping a csound performance...
I found that in the following code if I replace the 'event' line with 
exit now it quits straight after I run it every time?

instr 1
k1 randh 10, 1
printk 1, k1
if (k1>6) then
event "e", 2, 0, 0; exitnow
else
a1 oscil 10000, 200, 1
endif
out a1
endin

anyway the event opcode is perfect for what I want. Cheers,

Rory.

Istvan Varga wrote:
> On Saturday 29 April 2006 18:42, Rory Walsh wrote:
> 
>> Is there an opcode that when called will stop a csound performance? For 
>> example if you had a generative instrument that you wanted to stop once 
>> a random opcode produces a 99 or something like that? A trivial example 
>> I know, but do you get the picture?
> 
> Try using event or event_i with an "e" score event, or the exitnow opcode.