Csound Csound-dev Csound-tekno Search About

[Cs-dev] genarray issues

Date2013-07-12 13:53
Fromjoachim heintz
Subject[Cs-dev] genarray issues
Attachmentstest.csd  None  None  
hi -

i think genarray is not working properly. i found two issues:

1) it seems to affect values in the same k-cycle which should not be 
affected before the use of genarray.

2) it does not stop at the imax parameter:
    ktab genarray imin, imax[, inc]

a simple example is attached. this is the output (ubuntu studio, csound 
6.00):

new alloc for instr 1:
new alloc for instr 2:
  i   1 time     0.00073:     0.00000
  i   1 time     0.00073:     0.00000
  i   1 time     0.00073:     0.00000
  i   2 time     0.00073:     3.00000
  i   2 time     0.00073:     4.00000
  i   2 time     0.00073:     5.00000
  i   2 time     0.00073:     3.00000
  i   2 time     0.00073:     4.00000
  i   2 time     0.00073:     5.00000

best -

	joachim




-n



sr = 44100
ksmps = 32
nchnls = 2
0dbfs  = 1

instr 1 ;as expected
;create array of 3 elements
kArr[] init 3

;print the values
printk 0, kArr[0]
printk 0, kArr[1]
printk 0, kArr[2]

turnoff
endin

instr 2 ;values before genarray not correctly displayed
;create array of 3 elements
kArr[] init 3

;print the values: WRONG!
printk 0, kArr[0]
printk 0, kArr[1]
printk 0, kArr[2]

;apply genarray: should stop at 3 (4?)
;but does not
kArr genarray 3, 4

;print the values
printk 0, kArr[0]
printk 0, kArr[1]
printk 0, kArr[2]

turnoff
endin



i 1 0 1
i 2 0 1