New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Array index out of range #554
Comments
the array length has changed because p4 has changed. Do you mean to say that internally, the array length hasn't changed and then there is a problem? |
Ok, I had a look at this. I think this is to do with initialisation of synthetic k-rate vars. kval = kbuf[(kidx + 6) % ilen] with kn = (kidx + 6) % ilen and initialise kn to 0 at the top, the warning goes away. kn init 0 If I remove the init line, the warning is back. So the synthetic var is not being initialised to 0. Not sure |
Interesting, I wonder if array_get is working at init-time, and the synthetic var's value is leftover from the previous instrument instance that is getting reused. |
Ok thank you Victor. What troubles me is that the warning (which is a PERF ERROR on my ubuntu system) refers to an index which can't logically be reached thanks to the modulo operator. |
Here it is a warning, maybe because the version I am using might be different to yours. |
oh OK, so, knowing that, I should probably add another auxiliary variable for the kdix%ilen expression and initialise it to 0 too at the top for precaution. |
I'd leave it open until we can figure out it's not a bug. |
I think this is a bug; there should be no activity at init time for temporary variables. I think this is a result of the array semantics |
I see an asymmetry between array get and array set birtwistle: so get runs at i anf k rate, but set only at k |
This looks to be a result of something I implemented for Issue #254. This is all very tricky as sometimes users will want to access array's at k-time but give a constant or i-rate sig as an index. |
I could test my fix against your earlier issue if I had a test program |
@jpffitch There's a test CSD posted in the Nabble mailing list archive here: http://csound.1045644.n5.nabble.com/csound6-getting-i-value-of-a-kArray-member-td5729623.html |
OK; my patch breaks the older issue. I still think it odd that kk=0 does not run at i-time but kkk[0]=0 does On Mon, 9 Nov 2015, Steven Yi wrote:
|
Believed fixed in 6.08 with new array rate computation |
Some combinations of array lengths, p2 and p3 raise PERF ERRORs due to array indices out of range.
See for example the following program where array length, initially 338 for a first note, becomes 319 for the next consecutive note:
The text was updated successfully, but these errors were encountered: