[Cs-dev] pycall1t trigger argument
Date | 2005-10-16 12:01 |
From | Istvan Varga |
Subject | [Cs-dev] pycall1t trigger argument |
How is it expected to work ? I see code that would attempt to hold the previous output value when the trigger is not on, but it is not implemented correctly, so the opcode outputs zero instead. So, should holding the previous output be fixed, or should the existing code that outputs zero when not triggered be kept (in this case the non-functional parts could be removed) ? The manual does not define the behavior of the opcode in this respect at all. Note that all other opcodes in pycall.c.auto are affected as well, but those in pyx.c.auto are apparently not. |
Date | 2005-10-17 11:18 |
From | Oeyvind Brandtsegg |
Subject | Re: [Cs-dev] pycall1t trigger argument |
I ran into the same problem/bug/feature when using pycall1t. I used a goto to work around it, like this: ;******* kUpdate metro 1 if kUpdate == 0 kgoto end ; necessary hack to prevent the globals being overwritten by a zero between updates kArgument = 0 ; bogus argument ; get date and time from python, write to csound globals gkYear pycall1t kUpdate, "dateAndTime.getYear", kArgument gkMonth pycall1t kUpdate, "dateAndTime.getMonth", kArgument gkMDay pycall1t kUpdate, "dateAndTime.getMonthDay", kArgument gkWDay pycall1t kUpdate, "dateAndTime.getWeekDay", kArgument gkHour pycall1t kUpdate, "dateAndTime.getHour", kArgument gkMinute pycall1t kUpdate, "dateAndTime.getMinute", kArgument gkSecond pycall1t kUpdate, "dateAndTime.getSecond", kArgument end: ;******* Oeyvind > From: Istvan Varga [istvan_v@fibermail.hu] > Sent: 2005-10-16 13:01:23 CEST > To: csound@lists.bath.ac.uk > Subject: [Csnd] [Cs-dev] pycall1t trigger argument > > How is it expected to work ? I see code that would attempt to hold > the previous output value when the trigger is not on, but it is not > implemented correctly, so the opcode outputs zero instead. So, should > holding the previous output be fixed, or should the existing code that > outputs zero when not triggered be kept (in this case the non-functional > parts could be removed) ? The manual does not define the behavior of > the opcode in this respect at all. > Note that all other opcodes in pycall.c.auto are affected as well, > but those in pyx.c.auto are apparently not. > > -- > Send bugs reports to this list. > To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk > |
Date | 2005-10-17 13:04 |
From | Istvan Varga |
Subject | Re: [Cs-dev] pycall1t trigger argument |
So, how should the opcodes actually behave when the trigger is off ? 1. output zero 2. do not write to output variable 3. hold previous output, not clearing internal state on note initialization 4. hold previous output, which is cleared to zero on note initialization Oeyvind Brandtsegg wrote: > I ran into the same problem/bug/feature when using pycall1t. > I used a goto to work around it, like this: > > ;******* > kUpdate metro 1 > if kUpdate == 0 kgoto end ; necessary hack to prevent the globals being overwritten by a zero between updates > > kArgument = 0 ; bogus argument > > ; get date and time from python, write to csound globals > gkYear pycall1t kUpdate, "dateAndTime.getYear", kArgument > gkMonth pycall1t kUpdate, "dateAndTime.getMonth", kArgument > gkMDay pycall1t kUpdate, "dateAndTime.getMonthDay", kArgument > gkWDay pycall1t kUpdate, "dateAndTime.getWeekDay", kArgument > gkHour pycall1t kUpdate, "dateAndTime.getHour", kArgument > gkMinute pycall1t kUpdate, "dateAndTime.getMinute", kArgument > gkSecond pycall1t kUpdate, "dateAndTime.getSecond", kArgument > > end: > ;******* > Oeyvind |
Date | 2005-10-17 14:15 |
From | Oeyvind Brandtsegg |
Subject | Re: [Cs-dev] pycall1t trigger argument |
I think it would be nice if it works like alternative 4 > 4. hold previous output, which is cleared to zero on > note initialization Oeyvind > From: Istvan Varga [istvan_v@fibermail.hu] > Sent: 2005-10-17 14:04:23 CEST > To: csound@lists.bath.ac.uk > Subject: Re: [Csnd] [Cs-dev] pycall1t trigger argument > > So, how should the opcodes actually behave when the trigger is off ? > > 1. output zero > 2. do not write to output variable > 3. hold previous output, not clearing internal state on > note initialization > 4. hold previous output, which is cleared to zero on > note initialization > > Oeyvind Brandtsegg wrote: > > > I ran into the same problem/bug/feature when using pycall1t. > > I used a goto to work around it, like this: > > > > ;******* > > kUpdate metro 1 > > if kUpdate == 0 kgoto end ; necessary hack to prevent the globals being overwritten by a zero between updates > > > > kArgument = 0 ; bogus argument > > > > ; get date and time from python, write to csound globals > > gkYear pycall1t kUpdate, "dateAndTime.getYear", kArgument > > gkMonth pycall1t kUpdate, "dateAndTime.getMonth", kArgument > > gkMDay pycall1t kUpdate, "dateAndTime.getMonthDay", kArgument > > gkWDay pycall1t kUpdate, "dateAndTime.getWeekDay", kArgument > > gkHour pycall1t kUpdate, "dateAndTime.getHour", kArgument > > gkMinute pycall1t kUpdate, "dateAndTime.getMinute", kArgument > > gkSecond pycall1t kUpdate, "dateAndTime.getSecond", kArgument > > > > end: > > ;******* > > Oeyvind > -- > Send bugs reports to this list. > To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk > |