[Csnd] "Abort" Command?
Date | 2008-02-06 00:32 |
From | "Art Hunkins" |
Subject | [Csnd] "Abort" Command? |
Is there any facility in Csound that will permit a conditional abort during orchestra initialization? In realtime situations, I often require performers to specify the values of certain macros, and I'm looking for an abort capability if the macro specified is out of range. Here's a simple example: #define FREQ #25000# if $FREQ >= (SR * .5) then printf "$FREQ needs to be less than %d\\n", SR * .5 abort endif I suppose the latter segment might need to be within an instrument definition - which would be no problem in my case. I know this could be done by forcing some kind of error - but I'm looking for something "clean". Art Hunkins |
Date | 2008-02-06 01:43 |
From | "Matt J. Ingalls" |
Subject | [Csnd] Re: "Abort" Command? |
event "e" On Tue, 5 Feb 2008, Art Hunkins wrote: > Is there any facility in Csound that will permit a conditional abort during > orchestra initialization? > > In realtime situations, I often require performers to specify the values of > certain macros, and I'm looking for an abort capability if the macro > specified is out of range. > > Here's a simple example: > > #define FREQ #25000# > > if $FREQ >= (SR * .5) then > printf "$FREQ needs to be less than %d\\n", SR * .5 > abort > endif > > I suppose the latter segment might need to be within an instrument definition > - which would be no problem in my case. > > I know this could be done by forcing some kind of error - but I'm looking for > something "clean". > > Art Hunkins > > > Send bugs reports to this list. > To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe > csound" > |
Date | 2008-02-06 01:47 |
From | "Matt J. Ingalls" |
Subject | [Csnd] Re: Re: "Abort" Command? |
oh i should mention it used to be that you had to add some time/duration params for this -- i don't know if it's been fixed yet, but if you do get an error message this should work: event "e", 0, 0 On Tue, 5 Feb 2008, Matt J. Ingalls wrote: > > > event "e" > > > On Tue, 5 Feb 2008, Art Hunkins wrote: > >> Is there any facility in Csound that will permit a conditional abort >> during orchestra initialization? >> >> In realtime situations, I often require performers to specify the values >> of certain macros, and I'm looking for an abort capability if the macro >> specified is out of range. >> >> Here's a simple example: >> >> #define FREQ #25000# >> >> if $FREQ >= (SR * .5) then >> printf "$FREQ needs to be less than %d\\n", SR * .5 >> abort >> endif >> >> I suppose the latter segment might need to be within an instrument >> definition - which would be no problem in my case. >> >> I know this could be done by forcing some kind of error - but I'm looking >> for something "clean". >> >> Art Hunkins >> >> Send bugs reports to this list. >> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe >> csound" >> > > > Send bugs reports to this list. > To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe > csound" > |