Csound Csound-dev Csound-tekno Search About

[Cs-dev] bug with kArr[N] = kArr[N]+x

Date2013-09-08 22:17
Fromjoachim heintz
Subject[Cs-dev] bug with kArr[N] = kArr[N]+x
hi -

i think there is a bug in the k-rate version of the '=' operator.

kArr[] array 1, 2, 3
kArr[0] = kArr[0] + 10

kArr[0] should be set now to 11, but returns 10. in fact, all the array 
values are set to zero if treated in this way. an example is below; 
instr 1 shows that the i-rate version is working.

best -

	joachim




-nm128



instr 1 ;i-rate version works
iArr[] array 1, 2, 3
iArr[0] = iArr[0] + 10
prints "iArr[0] = %d\n", iArr[0]
endin

instr 2 ;k-rate version sets array values implicitely to zero
kArr[] array 1, 2, 3
kArr[0] = kArr[0] + 10 ;should be 11, but is set to 10
kArr[1] = kArr[1] + 10 ;also set to 10
kArr[2] = kArr[2] + 10 ;simile
printks "kArr[0] = %d\n", 0, kArr[0]
printks "kArr[1] = %d\n", 0, kArr[1]
printks "kArr[2] = %d\n", 0, kArr[2]
turnoff
endin



i 1 0 1
i 2 1 1



------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net