Csound Csound-dev Csound-tekno Search About

[Csnd] Looping Opcodes at k-rate

Date2011-08-13 23:45
FromJim Aikin
Subject[Csnd] Looping Opcodes at k-rate
The manual would lead one to believe that the looping opcodes (such as
loop_lt) can operate either at i-time or at k-rate. But I'm unable to see
how to make k-rate looping work. In the example .csd below, which I
constructed for testing purposes, instr 11 writes some data to a table, and
instr 12 reads it out. If I comment out the i-time usage of loop_lt in instr
12 and uncomment the k-rate usage, the loop never seems to run.

Is this user error on my part, or is the loop_lt opcode not functional at
k-rate? Insights into what's going on here would be much appreciated, as I'm
working on some documentation and don't want to get it wrong.

--Jim Aikin

**************************

giSine 	ftgen	0, 0, 8192, 10, 1

; create a table with 16 zeroes in it:
giData	ftgen	0, 0, 16, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

instr 11

; write to the giData table:
index = 0
spawn:
tableiw index, index, giData
ires	table index, giData
loop_lt index, 1, 16, spawn
	
asig	oscil	p4, p5, giSine
	outs	asig, asig
endin

instr 12	; read out the data in the table

index = 0
idata = -1
spawn:
idata	table index, giData
print	idata
loop_lt	index, 1, 16, spawn

;kndex init 0
;kdata init -1
;spawn:
;kdata	table kndex, giData
;prints	"kdata is %f\n", kdata
;loop_lt	kndex, 1, 16, spawn

endin




i11	0	1 0.2	220
i12	0.5 1


--
View this message in context: http://csound.1045644.n5.nabble.com/Looping-Opcodes-at-k-rate-tp4697195p4697195.html
Sent from the Csound - General mailing list archive at Nabble.com.


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"

Date2011-08-14 00:09
FromVictor Lazzarini
SubjectRe: [Csnd] Looping Opcodes at k-rate
If you're using 'prints' to check if the loop is working, that is the  
problem. This is an i-time opcode. If you change it to
use printk2, you'll see the numbers 0 - 15 printed on the screen.

Note also that printk (and I think printks) will not do also, they  
seem to print only once per k-cycle at max.

Victor
On 13 Aug 2011, at 23:45, Jim Aikin wrote:

> The manual would lead one to believe that the looping opcodes (such as
> loop_lt) can operate either at i-time or at k-rate. But I'm unable  
> to see
> how to make k-rate looping work. In the example .csd below, which I
> constructed for testing purposes, instr 11 writes some data to a  
> table, and
> instr 12 reads it out. If I comment out the i-time usage of loop_lt  
> in instr
> 12 and uncomment the k-rate usage, the loop never seems to run.
>
> Is this user error on my part, or is the loop_lt opcode not  
> functional at
> k-rate? Insights into what's going on here would be much  
> appreciated, as I'm
> working on some documentation and don't want to get it wrong.
>
> --Jim Aikin
>
> **************************
>
> giSine 	ftgen	0, 0, 8192, 10, 1
>
> ; create a table with 16 zeroes in it:
> giData	ftgen	0, 0, 16, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  
> 0, 0
>
> instr 11
>
> ; write to the giData table:
> index = 0
> spawn:
> tableiw index, index, giData
> ires	table index, giData
> loop_lt index, 1, 16, spawn
> 	
> asig	oscil	p4, p5, giSine
> 	outs	asig, asig
> endin
>
> instr 12	; read out the data in the table
>
> index = 0
> idata = -1
> spawn:
> idata	table index, giData
> print	idata
> loop_lt	index, 1, 16, spawn
>
> ;kndex init 0
> ;kdata init -1
> ;spawn:
> ;kdata	table kndex, giData
> ;prints	"kdata is %f\n", kdata
> ;loop_lt	kndex, 1, 16, spawn
>
> endin
>
> 
> 
>
> i11	0	1 0.2	220
> i12	0.5 1
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/Looping-Opcodes-at-k-rate-tp4697195p4697195.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
> 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"
>

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie





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"

Date2011-08-14 01:24
FromJim Aikin
Subject[Csnd] Re: Looping Opcodes at k-rate
Thanks, Victor. I eventually figured that out. The business about some of the
k-rate printing opcodes only running once per k-cycle is a subtle but
important point. Since I'm also writing up some information about the print
opcodes, I'm glad you pointed that out.

--JA

--
View this message in context: http://csound.1045644.n5.nabble.com/Looping-Opcodes-at-k-rate-tp4697195p4697266.html
Sent from the Csound - General mailing list archive at Nabble.com.


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"

Date2011-08-14 09:43
Fromjoachim heintz
SubjectRe: [Csnd] Re: Looping Opcodes at k-rate
i think printf works more than once in a k-cycle, if the trigger input
changes, for instance:



-n -m0


gitab ftgen 0, 0, -7, -2, 1, 2, 3, 4, 5, 6, 7
instr 1
kndx = 0
loop:
kval tab kndx, gitab
    printf "%f\n", kndx+1, kval
    loop_lt kndx, 1, 7, loop
turnoff
endin


i 1 0 .1



	joachim


Am 14.08.2011 02:24, schrieb Jim Aikin:
> Thanks, Victor. I eventually figured that out. The business about some of the
> k-rate printing opcodes only running once per k-cycle is a subtle but
> important point. Since I'm also writing up some information about the print
> opcodes, I'm glad you pointed that out.
> 
> --JA
> 
> --
> View this message in context: http://csound.1045644.n5.nabble.com/Looping-Opcodes-at-k-rate-tp4697195p4697266.html
> Sent from the Csound - General mailing list archive at Nabble.com.
> 
> 
> 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"

Date2011-08-14 10:00
FromVictor Lazzarini
SubjectRe: [Csnd] Re: Looping Opcodes at k-rate
Probably right. My impression, without looking at the code, is that  
all opcodes that depend on a
time counter (printk, printks) only work once per k-cycle.

Victor

On 14 Aug 2011, at 09:43, joachim heintz wrote:
> i think printf works more than once in a k-cycle, if the trigger input
> changes, for instance:
>
> 
> 
> -n -m0
> 
> 
> gitab ftgen 0, 0, -7, -2, 1, 2, 3, 4, 5, 6, 7
> instr 1
> kndx = 0
> loop:
> kval tab kndx, gitab
>    printf "%f\n", kndx+1, kval
>    loop_lt kndx, 1, 7, loop
> turnoff
> endin
> 
> 
> i 1 0 .1
> 
> 
>
> 	joachim
>
>
> Am 14.08.2011 02:24, schrieb Jim Aikin:
>> Thanks, Victor. I eventually figured that out. The business about  
>> some of the
>> k-rate printing opcodes only running once per k-cycle is a subtle but
>> important point. Since I'm also writing up some information about  
>> the print
>> opcodes, I'm glad you pointed that out.
>>
>> --JA
>>
>> --
>> View this message in context: http://csound.1045644.n5.nabble.com/Looping-Opcodes-at-k-rate-tp4697195p4697266.html
>> Sent from the Csound - General mailing list archive at Nabble.com.
>>
>>
>> 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"
>

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie





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"

Date2011-08-14 10:39
FromAndres Cabrera
SubjectRe: [Csnd] Re: Looping Opcodes at k-rate
Hi,

But wouldn't looping be equivalent to a new k-pass as far as the
opcode is concerned?

Cheers,
Andres

On Sun, Aug 14, 2011 at 10:00 AM, Victor Lazzarini
 wrote:
> Probably right. My impression, without looking at the code, is that all
> opcodes that depend on a
> time counter (printk, printks) only work once per k-cycle.
>
> Victor
>
> On 14 Aug 2011, at 09:43, joachim heintz wrote:
>>
>> i think printf works more than once in a k-cycle, if the trigger input
>> changes, for instance:
>>
>> 
>> 
>> -n -m0
>> 
>> 
>> gitab ftgen 0, 0, -7, -2, 1, 2, 3, 4, 5, 6, 7
>> instr 1
>> kndx = 0
>> loop:
>> kval tab kndx, gitab
>>   printf "%f\n", kndx+1, kval
>>   loop_lt kndx, 1, 7, loop
>> turnoff
>> endin
>> 
>> 
>> i 1 0 .1
>> 
>> 
>>
>>        joachim
>>
>>
>> Am 14.08.2011 02:24, schrieb Jim Aikin:
>>>
>>> Thanks, Victor. I eventually figured that out. The business about some of
>>> the
>>> k-rate printing opcodes only running once per k-cycle is a subtle but
>>> important point. Since I'm also writing up some information about the
>>> print
>>> opcodes, I'm glad you pointed that out.
>>>
>>> --JA
>>>
>>> --
>>> View this message in context:
>>> http://csound.1045644.n5.nabble.com/Looping-Opcodes-at-k-rate-tp4697195p4697266.html
>>> Sent from the Csound - General mailing list archive at Nabble.com.
>>>
>>>
>>> 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"
>>
>
> Dr Victor Lazzarini
> Senior Lecturer
> Dept. of Music
> NUI Maynooth Ireland
> tel.: +353 1 708 3545
> Victor dot Lazzarini AT nuim dot ie
>
>
>
>
>
> 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"


Date2011-08-14 10:42
FromVictor Lazzarini
SubjectRe: [Csnd] Re: Looping Opcodes at k-rate
Not when they are counting time, I suppose, because otherwise they'd  
be out of sync, would they not?
The ones that always print when a variable changes seem to print OK.

Victor
On 14 Aug 2011, at 10:39, Andres Cabrera wrote:

> Hi,
>
> But wouldn't looping be equivalent to a new k-pass as far as the
> opcode is concerned?
>
> Cheers,
> Andres
>
> On Sun, Aug 14, 2011 at 10:00 AM, Victor Lazzarini
>  wrote:
>> Probably right. My impression, without looking at the code, is that  
>> all
>> opcodes that depend on a
>> time counter (printk, printks) only work once per k-cycle.
>>
>> Victor
>>
>> On 14 Aug 2011, at 09:43, joachim heintz wrote:
>>>
>>> i think printf works more than once in a k-cycle, if the trigger  
>>> input
>>> changes, for instance:
>>>
>>> 
>>> 
>>> -n -m0
>>> 
>>> 
>>> gitab ftgen 0, 0, -7, -2, 1, 2, 3, 4, 5, 6, 7
>>> instr 1
>>> kndx = 0
>>> loop:
>>> kval tab kndx, gitab
>>>   printf "%f\n", kndx+1, kval
>>>   loop_lt kndx, 1, 7, loop
>>> turnoff
>>> endin
>>> 
>>> 
>>> i 1 0 .1
>>> 
>>> 
>>>
>>>        joachim
>>>
>>>
>>> Am 14.08.2011 02:24, schrieb Jim Aikin:
>>>>
>>>> Thanks, Victor. I eventually figured that out. The business about  
>>>> some of
>>>> the
>>>> k-rate printing opcodes only running once per k-cycle is a subtle  
>>>> but
>>>> important point. Since I'm also writing up some information about  
>>>> the
>>>> print
>>>> opcodes, I'm glad you pointed that out.
>>>>
>>>> --JA
>>>>
>>>> --
>>>> View this message in context:
>>>> http://csound.1045644.n5.nabble.com/Looping-Opcodes-at-k-rate-tp4697195p4697266.html
>>>> Sent from the Csound - General mailing list archive at Nabble.com.
>>>>
>>>>
>>>> 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"
>>>
>>
>> Dr Victor Lazzarini
>> Senior Lecturer
>> Dept. of Music
>> NUI Maynooth Ireland
>> tel.: +353 1 708 3545
>> Victor dot Lazzarini AT nuim dot ie
>>
>>
>>
>>
>>
>> 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"
>

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie





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"

Date2011-08-14 12:00
FromAndres Cabrera
SubjectRe: [Csnd] Re: Looping Opcodes at k-rate
Hi,

I'm trying to understand what happens internally from the opcode's
point of view... Does the opcode know it is inside a loop, and
therefore time is not increasing? Would time counting opcodes give
wrong values when they are placed inside a loop?

Cheers,
Andres

On Sun, Aug 14, 2011 at 10:42 AM, Victor Lazzarini
 wrote:
> Not when they are counting time, I suppose, because otherwise they'd be out
> of sync, would they not?
> The ones that always print when a variable changes seem to print OK.
>
> Victor
> On 14 Aug 2011, at 10:39, Andres Cabrera wrote:
>
>> Hi,
>>
>> But wouldn't looping be equivalent to a new k-pass as far as the
>> opcode is concerned?
>>
>> Cheers,
>> Andres
>>
>> On Sun, Aug 14, 2011 at 10:00 AM, Victor Lazzarini
>>  wrote:
>>>
>>> Probably right. My impression, without looking at the code, is that all
>>> opcodes that depend on a
>>> time counter (printk, printks) only work once per k-cycle.
>>>
>>> Victor
>>>
>>> On 14 Aug 2011, at 09:43, joachim heintz wrote:
>>>>
>>>> i think printf works more than once in a k-cycle, if the trigger input
>>>> changes, for instance:
>>>>
>>>> 
>>>> 
>>>> -n -m0
>>>> 
>>>> 
>>>> gitab ftgen 0, 0, -7, -2, 1, 2, 3, 4, 5, 6, 7
>>>> instr 1
>>>> kndx = 0
>>>> loop:
>>>> kval tab kndx, gitab
>>>>  printf "%f\n", kndx+1, kval
>>>>  loop_lt kndx, 1, 7, loop
>>>> turnoff
>>>> endin
>>>> 
>>>> 
>>>> i 1 0 .1
>>>> 
>>>> 
>>>>
>>>>       joachim
>>>>
>>>>
>>>> Am 14.08.2011 02:24, schrieb Jim Aikin:
>>>>>
>>>>> Thanks, Victor. I eventually figured that out. The business about some
>>>>> of
>>>>> the
>>>>> k-rate printing opcodes only running once per k-cycle is a subtle but
>>>>> important point. Since I'm also writing up some information about the
>>>>> print
>>>>> opcodes, I'm glad you pointed that out.
>>>>>
>>>>> --JA
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>>
>>>>> http://csound.1045644.n5.nabble.com/Looping-Opcodes-at-k-rate-tp4697195p4697266.html
>>>>> Sent from the Csound - General mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>> 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"
>>>>
>>>
>>> Dr Victor Lazzarini
>>> Senior Lecturer
>>> Dept. of Music
>>> NUI Maynooth Ireland
>>> tel.: +353 1 708 3545
>>> Victor dot Lazzarini AT nuim dot ie
>>>
>>>
>>>
>>>
>>>
>>> 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"
>>
>
> Dr Victor Lazzarini
> Senior Lecturer
> Dept. of Music
> NUI Maynooth Ireland
> tel.: +353 1 708 3545
> Victor dot Lazzarini AT nuim dot ie
>
>
>
>
>
> 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"


Date2011-08-14 18:14
FromVictor Lazzarini
SubjectRe: [Csnd] Re: Looping Opcodes at k-rate
Not sure, but will look at the code next time I have the chance.

Victor
On 14 Aug 2011, at 12:00, Andres Cabrera wrote:

> Hi,
>
> I'm trying to understand what happens internally from the opcode's
> point of view... Does the opcode know it is inside a loop, and
> therefore time is not increasing? Would time counting opcodes give
> wrong values when they are placed inside a loop?
>
> Cheers,
> Andres
>
> On Sun, Aug 14, 2011 at 10:42 AM, Victor Lazzarini
>  wrote:
>> Not when they are counting time, I suppose, because otherwise  
>> they'd be out
>> of sync, would they not?
>> The ones that always print when a variable changes seem to print OK.
>>
>> Victor
>> On 14 Aug 2011, at 10:39, Andres Cabrera wrote:
>>
>>> Hi,
>>>
>>> But wouldn't looping be equivalent to a new k-pass as far as the
>>> opcode is concerned?
>>>
>>> Cheers,
>>> Andres
>>>
>>> On Sun, Aug 14, 2011 at 10:00 AM, Victor Lazzarini
>>>  wrote:
>>>>
>>>> Probably right. My impression, without looking at the code, is  
>>>> that all
>>>> opcodes that depend on a
>>>> time counter (printk, printks) only work once per k-cycle.
>>>>
>>>> Victor
>>>>
>>>> On 14 Aug 2011, at 09:43, joachim heintz wrote:
>>>>>
>>>>> i think printf works more than once in a k-cycle, if the trigger  
>>>>> input
>>>>> changes, for instance:
>>>>>
>>>>> 
>>>>> 
>>>>> -n -m0
>>>>> 
>>>>> 
>>>>> gitab ftgen 0, 0, -7, -2, 1, 2, 3, 4, 5, 6, 7
>>>>> instr 1
>>>>> kndx = 0
>>>>> loop:
>>>>> kval tab kndx, gitab
>>>>>  printf "%f\n", kndx+1, kval
>>>>>  loop_lt kndx, 1, 7, loop
>>>>> turnoff
>>>>> endin
>>>>> 
>>>>> 
>>>>> i 1 0 .1
>>>>> 
>>>>> 
>>>>>
>>>>>       joachim
>>>>>
>>>>>
>>>>> Am 14.08.2011 02:24, schrieb Jim Aikin:
>>>>>>
>>>>>> Thanks, Victor. I eventually figured that out. The business  
>>>>>> about some
>>>>>> of
>>>>>> the
>>>>>> k-rate printing opcodes only running once per k-cycle is a  
>>>>>> subtle but
>>>>>> important point. Since I'm also writing up some information  
>>>>>> about the
>>>>>> print
>>>>>> opcodes, I'm glad you pointed that out.
>>>>>>
>>>>>> --JA
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>>
>>>>>> http://csound.1045644.n5.nabble.com/Looping-Opcodes-at-k-rate-tp4697195p4697266.html
>>>>>> Sent from the Csound - General mailing list archive at  
>>>>>> Nabble.com.
>>>>>>
>>>>>>
>>>>>> 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"
>>>>>
>>>>
>>>> Dr Victor Lazzarini
>>>> Senior Lecturer
>>>> Dept. of Music
>>>> NUI Maynooth Ireland
>>>> tel.: +353 1 708 3545
>>>> Victor dot Lazzarini AT nuim dot ie
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> 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"
>>>
>>
>> Dr Victor Lazzarini
>> Senior Lecturer
>> Dept. of Music
>> NUI Maynooth Ireland
>> tel.: +353 1 708 3545
>> Victor dot Lazzarini AT nuim dot ie
>>
>>
>>
>>
>>
>> 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"
>

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie





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"

Date2011-08-24 10:26
FromLouis Cohen
SubjectRe: [Csnd] Re: Looping Opcodes at k-rate
I have written some long loops - actually loops that stepped through  
large tables searching for a value. Based on the sound I was getting,  
I concluded that the time to execute the loop was longer than a k- 
cycle and the loop was allowed to complete before the instrument  
released its ownership of the k-cycle.

So I think your guess is correct, Andres, that time is not increasing.

-Lou

On Aug 14, 2011, at 7:00 AM, Andres Cabrera wrote:

> Hi,
>
> I'm trying to understand what happens internally from the opcode's
> point of view... Does the opcode know it is inside a loop, and
> therefore time is not increasing? Would time counting opcodes give
> wrong values when they are placed inside a loop?
>
> Cheers,
> Andres
>
> On Sun, Aug 14, 2011 at 10:42 AM, Victor Lazzarini
>  wrote:
>> Not when they are counting time, I suppose, because otherwise  
>> they'd be out
>> of sync, would they not?
>> The ones that always print when a variable changes seem to print OK.
>>
>> Victor
>> On 14 Aug 2011, at 10:39, Andres Cabrera wrote:
>>
>>> Hi,
>>>
>>> But wouldn't looping be equivalent to a new k-pass as far as the
>>> opcode is concerned?
>>>
>>> Cheers,
>>> Andres
>>>
>>> On Sun, Aug 14, 2011 at 10:00 AM, Victor Lazzarini
>>>  wrote:
>>>>
>>>> Probably right. My impression, without looking at the code, is  
>>>> that all
>>>> opcodes that depend on a
>>>> time counter (printk, printks) only work once per k-cycle.
>>>>
>>>> Victor
>>>>
>>>> On 14 Aug 2011, at 09:43, joachim heintz wrote:
>>>>>
>>>>> i think printf works more than once in a k-cycle, if the trigger  
>>>>> input
>>>>> changes, for instance:
>>>>>
>>>>> 
>>>>> 
>>>>> -n -m0
>>>>> 
>>>>> 
>>>>> gitab ftgen 0, 0, -7, -2, 1, 2, 3, 4, 5, 6, 7
>>>>> instr 1
>>>>> kndx = 0
>>>>> loop:
>>>>> kval tab kndx, gitab
>>>>>  printf "%f\n", kndx+1, kval
>>>>>  loop_lt kndx, 1, 7, loop
>>>>> turnoff
>>>>> endin
>>>>> 
>>>>> 
>>>>> i 1 0 .1
>>>>> 
>>>>> 
>>>>>
>>>>>       joachim
>>>>>
>>>>>
>>>>> Am 14.08.2011 02:24, schrieb Jim Aikin:
>>>>>>
>>>>>> Thanks, Victor. I eventually figured that out. The business  
>>>>>> about some
>>>>>> of
>>>>>> the
>>>>>> k-rate printing opcodes only running once per k-cycle is a  
>>>>>> subtle but
>>>>>> important point. Since I'm also writing up some information  
>>>>>> about the
>>>>>> print
>>>>>> opcodes, I'm glad you pointed that out.
>>>>>>
>>>>>> --JA
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>>
>>>>>> http://csound.1045644.n5.nabble.com/Looping-Opcodes-at-k-rate-tp4697195p4697266.html
>>>>>> Sent from the Csound - General mailing list archive at  
>>>>>> Nabble.com.
>>>>>>
>>>>>>
>>>>>> 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"
>>>>>
>>>>
>>>> Dr Victor Lazzarini
>>>> Senior Lecturer
>>>> Dept. of Music
>>>> NUI Maynooth Ireland
>>>> tel.: +353 1 708 3545
>>>> Victor dot Lazzarini AT nuim dot ie
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> 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"
>>>
>>
>> Dr Victor Lazzarini
>> Senior Lecturer
>> Dept. of Music
>> NUI Maynooth Ireland
>> tel.: +353 1 708 3545
>> Victor dot Lazzarini AT nuim dot ie
>>
>>
>>
>>
>>
>> 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"