Csound Csound-dev Csound-tekno Search About

[Csnd] UDO help...

Date2010-10-15 17:23
FromRory Walsh
Subject[Csnd] UDO help...
The following UDO is not behaving as I would expect, the code is commented..




-odac


sr = 44100
nchnls = 1

opcode triggerTable, k, ki;	
kfreq, ifn xin
kout = 0
k1 phasor kfreq
ktab tab k1, ifn, 1
kcnt = int(k1*8)
kgo changed kcnt
;if table value is a 1 and is in time with counter
;enter this test
if(kgo==1 && (ktab==1||kcnt==0)) then
	kout = 1
	printk 0.1, kout
endif
;kout is ALWAYS 0 even though the it's periodically set
;to 1 in the above test??
printk 0.1, kout
xout kout
endop


instr 1
ktrig triggerTable .5, 4, 1
endin


f4 0 8 2 1 0 1 0 1 0 1 0
i1 0 100




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"

Date2010-10-15 20:07
Fromjoachim heintz
Subject[Csnd] Re: UDO help...
hi rory -

i think it's just a problem of the printout. there is just one k-cycle  
in which kout becomes 1, so you don't get it with the printk 0.1  
statement. this works:



-odac


sr = 44100
nchnls = 1

opcode triggerTable, k, ki;
kfreq, ifn xin
kout = 0
k1 phasor kfreq
ktab tab k1, ifn, 1
kcnt = int(k1*8)
kgo changed kcnt
;if table value is a 1 and is in time with counter
;enter this test
if(kgo==1 && (ktab==1||kcnt==0)) then
kout = 1
endif
xout kout
endop

instr 1
ktrig triggerTable .5, 4
printk2 ktrig
endin


f4 0 8 2 1 0 1 0 1 0 1 0
i1 0 5



	joachim


Am 15.10.2010 um 18:23 schrieb Rory Walsh:

> The following UDO is not behaving as I would expect, the code is  
> commented..
>
>
> 
> 
> -odac
> 
> 
> sr = 44100
> nchnls = 1
>
> opcode triggerTable, k, ki;	
> kfreq, ifn xin
> kout = 0
> k1 phasor kfreq
> ktab tab k1, ifn, 1
> kcnt = int(k1*8)
> kgo changed kcnt
> ;if table value is a 1 and is in time with counter
> ;enter this test
> if(kgo==1 && (ktab==1||kcnt==0)) then
> 	kout = 1
> 	printk 0.1, kout
> endif
> ;kout is ALWAYS 0 even though the it's periodically set
> ;to 1 in the above test??
> printk 0.1, kout
> xout kout
> endop
>
>
> instr 1
> ktrig triggerTable .5, 4, 1
> endin
> 
> 
> f4 0 8 2 1 0 1 0 1 0 1 0
> i1 0 100
> 
> 
>
>
> 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"

Date2010-10-15 23:25
FromRory Walsh
Subject[Csnd] Re: Re: UDO help...
That makes sense. At least I'm keeping everyone else sharp! Thanks Joachim,

Rory.



On 15 October 2010 20:07, joachim heintz  wrote:
> hi rory -
>
> i think it's just a problem of the printout. there is just one k-cycle in
> which kout becomes 1, so you don't get it with the printk 0.1 statement.
> this works:
>
> 
> 
> -odac
> 
> 
> sr = 44100
> nchnls = 1
>
> opcode triggerTable, k, ki;
> kfreq, ifn xin
> kout = 0
> k1 phasor kfreq
> ktab tab k1, ifn, 1
> kcnt = int(k1*8)
> kgo changed kcnt
> ;if table value is a 1 and is in time with counter
> ;enter this test
> if(kgo==1 && (ktab==1||kcnt==0)) then
> kout = 1
> endif
> xout kout
> endop
>
> instr 1
> ktrig triggerTable .5, 4
> printk2 ktrig
> endin
> 
> 
> f4 0 8 2 1 0 1 0 1 0 1 0
> i1 0 5
> 
> 
>
>        joachim
>
>
> Am 15.10.2010 um 18:23 schrieb Rory Walsh:
>
>> The following UDO is not behaving as I would expect, the code is
>> commented..
>>
>>
>> 
>> 
>> -odac
>> 
>> 
>> sr = 44100
>> nchnls = 1
>>
>> opcode triggerTable, k, ki;
>> kfreq, ifn xin
>> kout = 0
>> k1 phasor kfreq
>> ktab tab k1, ifn, 1
>> kcnt = int(k1*8)
>> kgo changed kcnt
>> ;if table value is a 1 and is in time with counter
>> ;enter this test
>> if(kgo==1 && (ktab==1||kcnt==0)) then
>>        kout = 1
>>        printk 0.1, kout
>> endif
>> ;kout is ALWAYS 0 even though the it's periodically set
>> ;to 1 in the above test??
>> printk 0.1, kout
>> xout kout
>> endop
>>
>>
>> instr 1
>> ktrig triggerTable .5, 4, 1
>> endin
>> 
>> 
>> f4 0 8 2 1 0 1 0 1 0 1 0
>> i1 0 100
>> 
>> 
>>
>>
>> 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"