Csound Csound-dev Csound-tekno Search About

[Csnd] another loop question

Date2012-07-29 01:00
Frompeiman khosravi
Subject[Csnd] another loop question
Hello,

I understand that a k-rate loop block will perform all the iterations once per k-cycle (?). So what happens when one puts an opcode with a k rate output inside a loop block?

Something like this:


kcount=0

loop:

kline  line 0, 10, 1

if (kcount<10) kgoto loop

kcount=kcount+1



Date2012-07-29 11:06
Fromjoachim heintz
SubjectRe: [Csnd] another loop question
hi peiman -

i think you must put the line
kcount = kcount + 1
before the if statement.

what you then get, is a faster increment, because in every k-cycle the 
kline variable is incremented ten times:



-n


instr 1
kcount=0
loop:
kline  line 0, 10, 1
kcount=kcount+1
if (kcount<10) kgoto loop
printk .1, kline
endin


i 1 0 10



i   1 time     1.00000:     0.99998
  i   1 time     2.00000:     1.99998
  i   1 time     3.00000:     2.99998
  i   1 time     4.00000:     3.99998
  i   1 time     5.00000:     4.99998
  i   1 time     6.00000:     5.99998
  i   1 time     7.00000:     6.99998
  i   1 time     8.00000:     7.99998
  i   1 time     9.00000:     8.99998
  i   1 time    10.00000:     9.99998

so you are able to make time to run faster ...

best -

	joachim



Am 29.07.2012 02:00, schrieb peiman khosravi:
>
> kcount=0
>
> loop:
>
> kline  line 0, 10, 1
>
> if (kcount<10) kgoto loop
>
> kcount=kcount+1

Date2012-07-29 11:18
Frompeiman khosravi
SubjectRe: [Csnd] another loop question
Thanks very much Joachim. Wow, I had no idea. Glad I asked!

Are the increments evened out over the duration of a full loop cycle? Or is there one increment per iteration?

Best,
Peiman

On 29 July 2012 11:06, joachim heintz <jh@joachimheintz.de> wrote:
hi peiman -

i think you must put the line
kcount = kcount + 1
before the if statement.

what you then get, is a faster increment, because in every k-cycle the kline variable is incremented ten times:

<CsoundSynthesizer>
<CsOptions>
-n
</CsOptions>
<CsInstruments>
instr 1

kcount=0
loop:
kline  line 0, 10, 1
kcount=kcount+1

if (kcount<10) kgoto loop
printk .1, kline
endin
</CsInstruments>
<CsScore>
i 1 0 10
</CsScore>
</CsoundSynthesizer>

i   1 time     1.00000:     0.99998
 i   1 time     2.00000:     1.99998
 i   1 time     3.00000:     2.99998
 i   1 time     4.00000:     3.99998
 i   1 time     5.00000:     4.99998
 i   1 time     6.00000:     5.99998
 i   1 time     7.00000:     6.99998
 i   1 time     8.00000:     7.99998
 i   1 time     9.00000:     8.99998
 i   1 time    10.00000:     9.99998

so you are able to make time to run faster ...

best -

        joachim



Am 29.07.2012 02:00, schrieb peiman khosravi:


kcount=0

loop:

kline  line 0, 10, 1

if (kcount<10) kgoto loop

kcount=kcount+1


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"



Date2012-07-29 11:30
Frompeiman khosravi
SubjectRe: [Csnd] another loop question
Aha, the actual rate depends on the control rate. This seems to work out as one increment per k cycle.

kline  line 0, 1/kr, 1
 

On 29 July 2012 11:18, peiman khosravi <peimankhosravi@gmail.com> wrote:
Thanks very much Joachim. Wow, I had no idea. Glad I asked!

Are the increments evened out over the duration of a full loop cycle? Or is there one increment per iteration?

Best,
Peiman


On 29 July 2012 11:06, joachim heintz <jh@joachimheintz.de> wrote:
hi peiman -

i think you must put the line
kcount = kcount + 1
before the if statement.

what you then get, is a faster increment, because in every k-cycle the kline variable is incremented ten times:

<CsoundSynthesizer>
<CsOptions>
-n
</CsOptions>
<CsInstruments>
instr 1

kcount=0
loop:
kline  line 0, 10, 1
kcount=kcount+1

if (kcount<10) kgoto loop
printk .1, kline
endin
</CsInstruments>
<CsScore>
i 1 0 10
</CsScore>
</CsoundSynthesizer>

i   1 time     1.00000:     0.99998
 i   1 time     2.00000:     1.99998
 i   1 time     3.00000:     2.99998
 i   1 time     4.00000:     3.99998
 i   1 time     5.00000:     4.99998
 i   1 time     6.00000:     5.99998
 i   1 time     7.00000:     6.99998
 i   1 time     8.00000:     7.99998
 i   1 time     9.00000:     8.99998
 i   1 time    10.00000:     9.99998

so you are able to make time to run faster ...

best -

        joachim



Am 29.07.2012 02:00, schrieb peiman khosravi:


kcount=0

loop:

kline  line 0, 10, 1

if (kcount<10) kgoto loop

kcount=kcount+1


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"




Date2012-07-29 17:52
FromLouis Cohen
SubjectRe: [Csnd] another loop question
Pieman,

There is a problem with your code. It starts with the line:

kcount = 0

This causes kcount to be set to 0 every k-cycle. So you will set  
kcount to 0, then later increment by 1, then set it to 0 again and so  
forth. It will never get higher than 1.

If you want kcount to increase from one k-cycle to the next, you must  
instead write

kcount init 0

This sets kcount to 0 only once at init time. then

kcount = kcount + 1

will cause kcount to increase by 1 every k-cycle.

-Lou Cohen

On Jul 29, 2012, at 6:30 AM, peiman khosravi wrote:

> Aha, the actual rate depends on the control rate. This seems to work  
> out as one increment per k cycle.
>
> kline  line 0, 1/kr, 1
>
>
> On 29 July 2012 11:18, peiman khosravi   
> wrote:
> Thanks very much Joachim. Wow, I had no idea. Glad I asked!
>
> Are the increments evened out over the duration of a full loop  
> cycle? Or is there one increment per iteration?
>
> Best,
> Peiman
>
>
> On 29 July 2012 11:06, joachim heintz  wrote:
> hi peiman -
>
> i think you must put the line
> kcount = kcount + 1
> before the if statement.
>
> what you then get, is a faster increment, because in every k-cycle  
> the kline variable is incremented ten times:
>
> 
> 
> -n
> 
> 
> instr 1
>
> kcount=0
> loop:
> kline  line 0, 10, 1
> kcount=kcount+1
>
> if (kcount<10) kgoto loop
> printk .1, kline
> endin
> 
> 
> i 1 0 10
> 
> 
>
> i   1 time     1.00000:     0.99998
>  i   1 time     2.00000:     1.99998
>  i   1 time     3.00000:     2.99998
>  i   1 time     4.00000:     3.99998
>  i   1 time     5.00000:     4.99998
>  i   1 time     6.00000:     5.99998
>  i   1 time     7.00000:     6.99998
>  i   1 time     8.00000:     7.99998
>  i   1 time     9.00000:     8.99998
>  i   1 time    10.00000:     9.99998
>
> so you are able to make time to run faster ...
>
> best -
>
>         joachim
>
>
>
> Am 29.07.2012 02:00, schrieb peiman khosravi:
>
>
> kcount=0
>
> loop:
>
> kline  line 0, 10, 1
>
> if (kcount<10) kgoto loop
>
> kcount=kcount+1
>
>
> 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"
>
>
>


Date2012-07-30 00:05
Frompeiman khosravi
SubjectRe: [Csnd] another loop question
Thanks Lou,

I see your point, but wouldn't that give a different result?

From what I understand at the moment kcount is set to 0 on the first k cycle. Then we enter the loop section and complete the iterations up to 10, still only in the first k cycle. Then on the second cycle kcount is set to zero again and we recount to ten before the next cycle.

So I think the difference is that with '=' the count is wrapping around where as with 'init' it keeps incrementing up.

My question is why this instrument below keeps counting even passed 10. With the conditional there shouldn't the count stop at 10?

<CsoundSynthesizer>
<CsOptions>
-n -odac -d
</CsOptions>
<CsInstruments>

sr     = 44100
ksmps  = 100
nchnls = 1

instr 1

kcount init 0
loop:

printk2 kcount

kcount=kcount+1

if (kcount<10) kgoto loop


endin

</CsInstruments>
<CsScore>
i 1 0 10
</CsScore>
</CsoundSynthesizer>
 

On 29 July 2012 17:52, Louis Cohen <loucohen@jolc.net> wrote:
Pieman,

There is a problem with your code. It starts with the line:

kcount = 0

This causes kcount to be set to 0 every k-cycle. So you will set kcount to 0, then later increment by 1, then set it to 0 again and so forth. It will never get higher than 1.

If you want kcount to increase from one k-cycle to the next, you must instead write

kcount init 0

This sets kcount to 0 only once at init time. then


kcount = kcount + 1

will cause kcount to increase by 1 every k-cycle.

-Lou Cohen


On Jul 29, 2012, at 6:30 AM, peiman khosravi wrote:

Aha, the actual rate depends on the control rate. This seems to work out as one increment per k cycle.

kline  line 0, 1/kr, 1


On 29 July 2012 11:18, peiman khosravi <peimankhosravi@gmail.com> wrote:
Thanks very much Joachim. Wow, I had no idea. Glad I asked!

Are the increments evened out over the duration of a full loop cycle? Or is there one increment per iteration?

Best,
Peiman


On 29 July 2012 11:06, joachim heintz <jh@joachimheintz.de> wrote:
hi peiman -

i think you must put the line
kcount = kcount + 1
before the if statement.

what you then get, is a faster increment, because in every k-cycle the kline variable is incremented ten times:

<CsoundSynthesizer>
<CsOptions>
-n
</CsOptions>
<CsInstruments>
instr 1

kcount=0
loop:
kline  line 0, 10, 1
kcount=kcount+1

if (kcount<10) kgoto loop
printk .1, kline
endin
</CsInstruments>
<CsScore>
i 1 0 10
</CsScore>
</CsoundSynthesizer>

i   1 time     1.00000:     0.99998
 i   1 time     2.00000:     1.99998
 i   1 time     3.00000:     2.99998
 i   1 time     4.00000:     3.99998
 i   1 time     5.00000:     4.99998
 i   1 time     6.00000:     5.99998
 i   1 time     7.00000:     6.99998
 i   1 time     8.00000:     7.99998
 i   1 time     9.00000:     8.99998
 i   1 time    10.00000:     9.99998

so you are able to make time to run faster ...

best -

        joachim



Am 29.07.2012 02:00, schrieb peiman khosravi:


kcount=0

loop:

kline  line 0, 10, 1

if (kcount<10) kgoto loop

kcount=kcount+1


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"



Date2012-07-30 00:16
Frompeiman khosravi
SubjectRe: [Csnd] another loop question
BTW I realise that 'kline  line 0, 1/kr, 1' mentioned in one of my previous emails is totally absurd. 1/kr is not in seconds!

P

On 30 July 2012 00:05, peiman khosravi <peimankhosravi@gmail.com> wrote:
Thanks Lou,

I see your point, but wouldn't that give a different result?

From what I understand at the moment kcount is set to 0 on the first k cycle. Then we enter the loop section and complete the iterations up to 10, still only in the first k cycle. Then on the second cycle kcount is set to zero again and we recount to ten before the next cycle.

So I think the difference is that with '=' the count is wrapping around where as with 'init' it keeps incrementing up.

My question is why this instrument below keeps counting even passed 10. With the conditional there shouldn't the count stop at 10?

<CsoundSynthesizer>
<CsOptions>
-n -odac -d
</CsOptions>
<CsInstruments>

sr     = 44100
ksmps  = 100
nchnls = 1

instr 1

kcount init 0
loop:

printk2 kcount


kcount=kcount+1

if (kcount<10) kgoto loop


endin

</CsInstruments>
<CsScore>
i 1 0 10
</CsScore>
</CsoundSynthesizer>
 

On 29 July 2012 17:52, Louis Cohen <loucohen@jolc.net> wrote:
Pieman,

There is a problem with your code. It starts with the line:

kcount = 0

This causes kcount to be set to 0 every k-cycle. So you will set kcount to 0, then later increment by 1, then set it to 0 again and so forth. It will never get higher than 1.

If you want kcount to increase from one k-cycle to the next, you must instead write

kcount init 0

This sets kcount to 0 only once at init time. then


kcount = kcount + 1

will cause kcount to increase by 1 every k-cycle.

-Lou Cohen


On Jul 29, 2012, at 6:30 AM, peiman khosravi wrote:

Aha, the actual rate depends on the control rate. This seems to work out as one increment per k cycle.

kline  line 0, 1/kr, 1


On 29 July 2012 11:18, peiman khosravi <peimankhosravi@gmail.com> wrote:
Thanks very much Joachim. Wow, I had no idea. Glad I asked!

Are the increments evened out over the duration of a full loop cycle? Or is there one increment per iteration?

Best,
Peiman


On 29 July 2012 11:06, joachim heintz <jh@joachimheintz.de> wrote:
hi peiman -

i think you must put the line
kcount = kcount + 1
before the if statement.

what you then get, is a faster increment, because in every k-cycle the kline variable is incremented ten times:

<CsoundSynthesizer>
<CsOptions>
-n
</CsOptions>
<CsInstruments>
instr 1

kcount=0
loop:
kline  line 0, 10, 1
kcount=kcount+1

if (kcount<10) kgoto loop
printk .1, kline
endin
</CsInstruments>
<CsScore>
i 1 0 10
</CsScore>
</CsoundSynthesizer>

i   1 time     1.00000:     0.99998
 i   1 time     2.00000:     1.99998
 i   1 time     3.00000:     2.99998
 i   1 time     4.00000:     3.99998
 i   1 time     5.00000:     4.99998
 i   1 time     6.00000:     5.99998
 i   1 time     7.00000:     6.99998
 i   1 time     8.00000:     7.99998
 i   1 time     9.00000:     8.99998
 i   1 time    10.00000:     9.99998

so you are able to make time to run faster ...

best -

        joachim



Am 29.07.2012 02:00, schrieb peiman khosravi:


kcount=0

loop:

kline  line 0, 10, 1

if (kcount<10) kgoto loop

kcount=kcount+1


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"




Date2012-07-30 09:27
Fromjoachim heintz
SubjectRe: [Csnd] another loop question
this is what happens:
- in the first k-cycle kcount is incremented ten times because of the 
loop condition.
- in the following k-cycles it continues to increment because of the 
statement 'kcount=kcount+1', but it increments just once in one k-cycle.
see the output below.
best -
	j




-n


ksmps  = 100
instr 1
kNum timeinstk ;reports number of k-cycle
kcount init 0
loop:
printk2 kcount
kcount=kcount+1
if (kcount<10) kgoto loop
printks "Number of k-cycle = %d, kcount = %d\n", 0, kNum, kcount
endin


i 1 0 .1



SECTION 1:
new alloc for instr 1:
  i1     0.00000
  i1     1.00000
  i1     2.00000
  i1     3.00000
  i1     4.00000
  i1     5.00000
  i1     6.00000
  i1     7.00000
  i1     8.00000
  i1     9.00000
Number of k-cycle = 1, kcount = 10
  i1    10.00000
Number of k-cycle = 2, kcount = 11
  i1    11.00000
Number of k-cycle = 3, kcount = 12
  i1    12.00000
Number of k-cycle = 4, kcount = 13
  i1    13.00000
Number of k-cycle = 5, kcount = 14
  i1    14.00000
Number of k-cycle = 6, kcount = 15
  i1    15.00000
...




Am 30.07.2012 01:05, schrieb peiman khosravi:
> Thanks Lou,
>
> I see your point, but wouldn't that give a different result?
>
>  From what I understand at the moment kcount is set to 0 on the first k
> cycle. Then we enter the loop section and complete the iterations up to
> 10, still only in the first k cycle. Then on the second cycle kcount is
> set to zero again and we recount to ten before the next cycle.
>
> So I think the difference is that with '=' the count is wrapping around
> where as with 'init' it keeps incrementing up.
>
> My question is why this instrument below keeps counting even passed 10.
> With the conditional there shouldn't the count stop at 10?
>
> 
> 
> -n -odac -d
> 
> 
>
> sr     = 44100
> ksmps  = 100
> nchnls = 1
>
> instr 1
>
> kcount init 0
> loop:
>
> printk2 kcount
>
> kcount=kcount+1
>
> if (kcount<10) kgoto loop
>
>
> endin
>
> 
> 
> i 1 0 10
> 
> 
>
>
> On 29 July 2012 17:52, Louis Cohen  > wrote:
>
>     Pieman,
>
>     There is a problem with your code. It starts with the line:
>
>     kcount = 0
>
>     This causes kcount to be set to 0 every k-cycle. So you will set
>     kcount to 0, then later increment by 1, then set it to 0 again and
>     so forth. It will never get higher than 1.
>
>     If you want kcount to increase from one k-cycle to the next, you
>     must instead write
>
>     kcount init 0
>
>     This sets kcount to 0 only once at init time. then
>
>
>     kcount = kcount + 1
>
>     will cause kcount to increase by 1 every k-cycle.
>
>     -Lou Cohen
>
>
>     On Jul 29, 2012, at 6:30 AM, peiman khosravi wrote:
>
>         Aha, the actual rate depends on the control rate. This seems to
>         work out as one increment per k cycle.
>
>         kline  line 0, 1/kr, 1
>
>
>         On 29 July 2012 11:18, peiman khosravi          > wrote:
>         Thanks very much Joachim. Wow, I had no idea. Glad I asked!
>
>         Are the increments evened out over the duration of a full loop
>         cycle? Or is there one increment per iteration?
>
>         Best,
>         Peiman
>
>
>         On 29 July 2012 11:06, joachim heintz          > wrote:
>         hi peiman -
>
>         i think you must put the line
>         kcount = kcount + 1
>         before the if statement.
>
>         what you then get, is a faster increment, because in every
>         k-cycle the kline variable is incremented ten times:
>
>         
>         
>         -n
>         
>         
>         instr 1
>
>         kcount=0
>         loop:
>         kline  line 0, 10, 1
>         kcount=kcount+1
>
>         if (kcount<10) kgoto loop
>         printk .1, kline
>         endin
>         
>         
>         i 1 0 10
>         
>         
>
>         i   1 time     1.00000:     0.99998
>           i   1 time     2.00000:     1.99998
>           i   1 time     3.00000:     2.99998
>           i   1 time     4.00000:     3.99998
>           i   1 time     5.00000:     4.99998
>           i   1 time     6.00000:     5.99998
>           i   1 time     7.00000:     6.99998
>           i   1 time     8.00000:     7.99998
>           i   1 time     9.00000:     8.99998
>           i   1 time    10.00000:     9.99998
>
>         so you are able to make time to run faster ...
>
>         best -
>
>                  joachim
>
>
>
>         Am 29.07.2012 02:00, schrieb peiman khosravi:
>
>
>         kcount=0
>
>         loop:
>
>         kline  line 0, 10, 1
>
>         if (kcount<10) kgoto loop
>
>         kcount=kcount+1
>
>
>         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"
>
>

Date2012-07-30 09:40
Frompeiman khosravi
SubjectRe: [Csnd] another loop question
Ah yes this makes perfect sense. Thanks joachim.

Best,
Peiman

On 30 July 2012 09:27, joachim heintz <jh@joachimheintz.de> wrote:
this is what happens:
- in the first k-cycle kcount is incremented ten times because of the loop condition.
- in the following k-cycles it continues to increment because of the statement 'kcount=kcount+1', but it increments just once in one k-cycle.
see the output below.
best -

        j


<CsoundSynthesizer>
<CsOptions>
-n
</CsOptions>
<CsInstruments>
ksmps  = 100
instr 1
kNum timeinstk ;reports number of k-cycle

kcount init 0
loop:
printk2 kcount
kcount=kcount+1
if (kcount<10) kgoto loop
printks "Number of k-cycle = %d, kcount = %d\n", 0, kNum, kcount
endin
</CsInstruments>
<CsScore>
i 1 0 .1
</CsScore>
</CsoundSynthesizer>

SECTION 1:
new alloc for instr 1:
 i1     0.00000
 i1     1.00000
 i1     2.00000
 i1     3.00000
 i1     4.00000
 i1     5.00000
 i1     6.00000
 i1     7.00000
 i1     8.00000
 i1     9.00000
Number of k-cycle = 1, kcount = 10
 i1    10.00000
Number of k-cycle = 2, kcount = 11
 i1    11.00000
Number of k-cycle = 3, kcount = 12
 i1    12.00000
Number of k-cycle = 4, kcount = 13
 i1    13.00000
Number of k-cycle = 5, kcount = 14
 i1    14.00000
Number of k-cycle = 6, kcount = 15
 i1    15.00000
...




Am 30.07.2012 01:05, schrieb peiman khosravi:
Thanks Lou,

I see your point, but wouldn't that give a different result?

 From what I understand at the moment kcount is set to 0 on the first k
cycle. Then we enter the loop section and complete the iterations up to
10, still only in the first k cycle. Then on the second cycle kcount is
set to zero again and we recount to ten before the next cycle.

So I think the difference is that with '=' the count is wrapping around
where as with 'init' it keeps incrementing up.

My question is why this instrument below keeps counting even passed 10.
With the conditional there shouldn't the count stop at 10?

<CsoundSynthesizer>
<CsOptions>
-n -odac -d
</CsOptions>
<CsInstruments>

sr     = 44100
ksmps  = 100
nchnls = 1

instr 1

kcount init 0
loop:

printk2 kcount

kcount=kcount+1

if (kcount<10) kgoto loop


endin

</CsInstruments>
<CsScore>
i 1 0 10
</CsScore>
</CsoundSynthesizer>


On 29 July 2012 17:52, Louis Cohen <loucohen@jolc.net
<mailto:loucohen@jolc.net>> wrote:

    Pieman,

    There is a problem with your code. It starts with the line:

    kcount = 0

    This causes kcount to be set to 0 every k-cycle. So you will set
    kcount to 0, then later increment by 1, then set it to 0 again and
    so forth. It will never get higher than 1.

    If you want kcount to increase from one k-cycle to the next, you
    must instead write

    kcount init 0

    This sets kcount to 0 only once at init time. then


    kcount = kcount + 1

    will cause kcount to increase by 1 every k-cycle.

    -Lou Cohen


    On Jul 29, 2012, at 6:30 AM, peiman khosravi wrote:

        Aha, the actual rate depends on the control rate. This seems to
        work out as one increment per k cycle.

        kline  line 0, 1/kr, 1


        On 29 July 2012 11:18, peiman khosravi <peimankhosravi@gmail.com
        <mailto:peimankhosravi@gmail.com>> wrote:
        Thanks very much Joachim. Wow, I had no idea. Glad I asked!

        Are the increments evened out over the duration of a full loop
        cycle? Or is there one increment per iteration?

        Best,
        Peiman


        On 29 July 2012 11:06, joachim heintz <jh@joachimheintz.de
        <mailto:jh@joachimheintz.de>> wrote:
        hi peiman -

        i think you must put the line
        kcount = kcount + 1
        before the if statement.

        what you then get, is a faster increment, because in every
        k-cycle the kline variable is incremented ten times:

        <CsoundSynthesizer>
        <CsOptions>
        -n
        </CsOptions>
        <CsInstruments>
        instr 1

        kcount=0
        loop:
        kline  line 0, 10, 1
        kcount=kcount+1

        if (kcount<10) kgoto loop
        printk .1, kline
        endin
        </CsInstruments>
        <CsScore>
        i 1 0 10
        </CsScore>
        </CsoundSynthesizer>

        i   1 time     1.00000:     0.99998
          i   1 time     2.00000:     1.99998
          i   1 time     3.00000:     2.99998
          i   1 time     4.00000:     3.99998
          i   1 time     5.00000:     4.99998
          i   1 time     6.00000:     5.99998
          i   1 time     7.00000:     6.99998
          i   1 time     8.00000:     7.99998
          i   1 time     9.00000:     8.99998
          i   1 time    10.00000:     9.99998

        so you are able to make time to run faster ...

        best -

                 joachim



        Am 29.07.2012 02:00, schrieb peiman khosravi:


        kcount=0

        loop:

        kline  line 0, 10, 1

        if (kcount<10) kgoto loop

        kcount=kcount+1


        Send bugs reports to the Sourceforge bug tracker
        https://sourceforge.net/__tracker/?group_id=81968&atid=__564599

        <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
        <mailto: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

    <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
    <mailto: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"