Csound Csound-dev Csound-tekno Search About

[Csnd-dev] invalid schedule turns off an instance

Date2018-09-24 09:40
Fromjoachim heintz
Subject[Csnd-dev] invalid schedule turns off an instance
in the follwoing code, the turnoff2 in instrument "Stop" is not 
executed, because the
	schedule "Bla", 0, 1
refers to a non existing instrument:

nchnls = 2
0dbfs = 1

instr Sine
  aSin poscil .2, 400
  out aSin, aSin
endin
schedule "Sine", 0, 100

instr Stop
  schedule "Bla", 0, 1
  turnoff2 "Sine", 0, 0 ;not executed
endin
schedule "Stop", 1, 1


i think that csound should throw a waring (as it does currently, too), 
but nevertheless execute the rest of the code.

is this an error, or is there a reasoon to remove the instance when an 
invalid score event takes place?

Date2018-09-24 13:01
Fromjpff
SubjectRe: [Csnd-dev] invalid schedule turns off an instance
Are you asking for a special case in schedule to give a warning ony and 
not an error, or are wanting all opcodes to just warn when they fail?

My instinct is to say this is a bad idea


On Mon, 24 Sep 2018, joachim heintz wrote:

> in the follwoing code, the turnoff2 in instrument "Stop" is not executed, 
> because the
> 	schedule "Bla", 0, 1
> refers to a non existing instrument:
>
> nchnls = 2
> 0dbfs = 1
>
> instr Sine
> aSin poscil .2, 400
> out aSin, aSin
> endin
> schedule "Sine", 0, 100
>
> instr Stop
> schedule "Bla", 0, 1
> turnoff2 "Sine", 0, 0 ;not executed
> endin
> schedule "Stop", 1, 1
>
>
> i think that csound should throw a waring (as it does currently, too), but 
> nevertheless execute the rest of the code.
>
> is this an error, or is there a reasoon to remove the instance when an 
> invalid score event takes place?
>
> 	joachim

Date2018-09-24 18:25
Fromjoachim heintz
SubjectRe: [Csnd-dev] invalid schedule turns off an instance
actually csound is not reporting an error in this case.  instead:

	new alloc for instr Stop:
	WARNING: instr Bla not found

so csound here reports a warning but behaves as error.  this looks like 
inconsistency.

in my personal opinion, in the case of schedule / event a warning would 
be good (= not killing the instrument instance) if the called instrument 
is not found, but i don't have the overview about consequences.

	j



On 24/09/18 14:01, jpff wrote:
> Are you asking for a special case in schedule to give a warning ony and
> not an error, or are wanting all opcodes to just warn when they fail?
>
> My instinct is to say this is a bad idea
>
>
> On Mon, 24 Sep 2018, joachim heintz wrote:
>
>> in the follwoing code, the turnoff2 in instrument "Stop" is not
>> executed, because the
>>     schedule "Bla", 0, 1
>> refers to a non existing instrument:
>>
>> nchnls = 2
>> 0dbfs = 1
>>
>> instr Sine
>> aSin poscil .2, 400
>> out aSin, aSin
>> endin
>> schedule "Sine", 0, 100
>>
>> instr Stop
>> schedule "Bla", 0, 1
>> turnoff2 "Sine", 0, 0 ;not executed
>> endin
>> schedule "Stop", 1, 1
>>
>>
>> i think that csound should throw a waring (as it does currently, too),
>> but nevertheless execute the rest of the code.
>>
>> is this an error, or is there a reasoon to remove the instance when an
>> invalid score event takes place?
>>
>>     joachim
>>

Date2018-09-24 18:37
Fromjpff
SubjectRe: [Csnd-dev] invalid schedule turns off an instance
yActually the warning is from schedule but the error in in event.  More