| Steven,
Many thanks for figuring this out.
I don't know if the following would provide any guidance as to whether
the csound design needs to be changed:
As a relatively naive user, I would use the following rule to avoid
trouble:
"Only turnoff instruments whose numbers are lower than the instrument
executing the turnoff opcode." I would treat turnoff, turnoff2 and
turnon as a family of opcodes for which this rule applies.
I can't think of a situation where this rule would cause me any
difficulties (but it's early in the morning here!)
However, Csound is actually giving me some conflicting signals:
In instr 3 (the one you changed to 13) I use "active 10" to test
whether instr 10 is running. I then have a loop that turns off instr
10 until "active 10" returns 0. This is because a few years ago, I
think there was a bug in turnoff2 -- it could not turn off multiple
instances of an instrument, so a loop was necessary.
From what you say, it would seem that even though "active 10" is
returning a zero, instr 10 is not completely turned off. That
possibility creates uncertainty which perhaps would be best cleared up.
I hope these thoughts help.
Again, thanks for spending time on this problem! and for providing a
workaround.
best,
Lou Cohen
On Aug 29, 2010, at 9:51 PM, Steven Yi wrote:
> Hi Lou,
>
> I took a bit of a look and it's a subtle issue; I'm not sure if it's a
> bug or how we want to address it. The root cause is that your
> instrument that calls turnoff2 has a lower number than than the one it
> is turning off (i3 turning off i10). Csound processes down the
> instrument in numerical order, but I think it doesn't clean up
> deactivated instruments until the next kpass. When i3 processes, it
> deactivates the instrument instances in i10, tries to run i10 with
> deactivated UDO's (causing the initialise error messages, for UDO's,
> when it deacts, it sets its performance function pointer to one that
> just reports that message, which normally isn't an issue), then at the
> end of kpass tries to cleanup the instrument instances that were
> deactivated.
>
> I was able to fix it here by renumbering instrument 3 to instr 13 and
> changing the stop button to create an i13 0 1 note instead of i3.
> Doing that, I was able to repeatedly use the start/stop note buttons
> in your project.
>
> I think we need to change how this works for deactivation or just note
> carefully that if using turnoff2 it should only be called on
> instruments with numbers less than the one it is called from.
> (Thinking about how turnoff works, the behavior works fine in that
> context, but if turnoff2 was based on turnoff, then this situation may
> not have come into play during testing.)
>
> So, is this a serious enough issue to merit change or is documentation
> sufficient?
>
> Thanks!
> steven
>
> On Sun, Aug 29, 2010 at 8:54 PM, Louis Cohen
> wrote:
>>
>>
>> Thanks for helping me with this problem.
>>
>> Attached is the csd, which must be run under QTCsound. You will see
>> two
>> buttons labeled "start note" and "stop note".
>>
>> First press "start note" -- no problems, and the UDO is being used
>> every
>> k-cycle in instrument 10 (and some other places I think.)
>>
>> Then press "stop note" and the error message appears. If you press
>> "start
>> note" again, csound will crash (at least it does for me.)
>>
>> best,
>> Lou Cohen
>>
>>
>> On Aug 29, 2010, at 7:50 PM, Steven Yi wrote:
>>
>>> I am thinking that the use of the opcode in context would be useful.
>>> My guess at this point is that the UDO is used within an if-then-
>>> else
>>> clause or some other if-goto and that it is being skipped at init
>>> time
>>> but not at perf-time.
>>>
>>> On Sun, Aug 29, 2010 at 6:53 PM, Victor Lazzarini
>>> wrote:
>>>>
>>>> Maybe the full CSD would be more helpful. I tried your UDO here
>>>> and got
>>>> no
>>>> such PERF errors.
>>>>
>>>> Victor
>>>> On 29 Aug 2010, at 23:36, Louis Cohen wrote:
>>>>
>>>>> Here's the UDO. Sorry I didn't think of including it.
>>>>>
>>>>> As soon as I saw your message I took off a parameter from the UDO
>>>>> declaration without really checking. That's not the problem, it
>>>>> really
>>>>> needs
>>>>> 5 inputs. Here it is:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ;----------------------------------------------------------------------------
>>>>> ;traces a straight line from ky0 to ky1 at time kt, over a
>>>>> period from
>>>>> kt0
>>>>> to kt1
>>>>> ;syntax:
>>>>> ;ky linearinterpolate ky1, ky0, kt1, kt0, kt
>>>>> opcode linearinterpolate, k, kkkkk ;traces a straight line
>>>>> from ky0
>>>>> to ky1 at time kt, over a period from kt0 to kt1
>>>>> ky1, ky0, kt1, kt0, kt xin
>>>>> kslope = (ky1 - ky0)/(kt1-kt0)
>>>>> kintercept = ky0 - (kslope * kt0)
>>>>> ky = (kslope * kt) + kintercept
>>>>> xout ky
>>>>> endop
>>>>>
>>>>>
>>>>>
>>>>> On Aug 29, 2010, at 5:58 PM, Steven Yi wrote:
>>>>>
>>>>>> Hi Lou,
>>>>>>
>>>>>> Could you paste the UDO? I'm wondering if it has an extra
>>>>>> mandatory
>>>>>> argument in its definition that isn't being used.
>>>>>>
>>>>>> Thanks!
>>>>>> Steven
>>>>>>
>>>>>> On 8/29/10, Louis Cohen wrote:
>>>>>>>
>>>>>>>
>>>>>>> I'm getting the following message after I turnoff instrument
>>>>>>> 10, which
>>>>>>> is the instrument that calls the UDO:
>>>>>>>
>>>>>>> PERF ERROR in instr 10: linearinterpolate: not initialised
>>>>>>> kperturbation linearinterpolate 0.5 0.0
>>>>>>> 1 0
>>>>>>> ktemp 0
>>>>>>> note aborted
>>>>>>>
>>>>>>> The actual line of code referenced is:
>>>>>>>
>>>>>>> kperturbation linearinterpolate 0.5, 0.0, 1, 0, ktemp
>>>>>>>
>>>>>>>
>>>>>>> note that there is no zero at the end of the line, yet a zero
>>>>>>> shows up
>>>>>>> at the end of the error message.
>>>>>>>
>>>>>>> While instrument 10 is running, it executes the above line
>>>>>>> (calls this
>>>>>>> UDO) repeatedly with no errors. The error message consistently
>>>>>>> occurs
>>>>>>> only after instrument 10 has been turned off. If I continue
>>>>>>> running
>>>>>>> the csd and try to turn instrument 10 on again, csound (and
>>>>>>> QuteCsound) crash.
>>>>>>>
>>>>>>> I'm running Csound version 5.12 (float samples) Jun 4 2010 with
>>>>>>> QuteCsound 0.6.0.
>>>>>>>
>>>>>>> Can anyone explain what might be causing the error message?
>>>>>>>
>>>>>>> many thanks!
>>>>>>>
>>>>>>> =Lou
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Send bugs reports to the Sourceforge bug tracker
>>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>>>>>> Discussions of bugs and features can be posted here
>>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>>>> "unsubscribe
>>>>>>> csound"
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> Sent from my mobile device
>>>>>>
>>>>>>
>>>>>> Send bugs reports to the Sourceforge bug tracker
>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>>>>> Discussions of bugs and features can be posted here
>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>>> "unsubscribe
>>>>>> csound"
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Send bugs reports to the Sourceforge bug tracker
>>>>> https://sourceforge.net/tracker/?
>>>>> group_id=81968&atid=564599
>>>>> Discussions of bugs and features can be posted here
>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>> "unsubscribe
>>>>> csound"
>>>>>
>>>>
>>>>
>>>>
>>>> Send bugs reports to the Sourceforge bug tracker
>>>> https://sourceforge.net/tracker/?
>>>> group_id=81968&atid=564599
>>>> Discussions of bugs and features can be posted here
>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>> "unsubscribe
>>>> csound"
>>>>
>>>>
>>>
>>>
>>> Send bugs reports to the Sourceforge bug tracker
>>> https://sourceforge.net/tracker/?
>>> group_id=81968&atid=564599
>>> Discussions of bugs and features can be posted here
>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>> "unsubscribe
>>> csound"
>>>
>>
>>
>
>
> Send bugs reports to the Sourceforge bug tracker
> https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body
> "unsubscribe csound"
>
Send bugs reports to the Sourceforge bug tracker
https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
|