chugins
chugins copied to clipboard
Wavetable | issues when changing array size
Tested on Ubuntu Studio 16.04 64bit - ChucK 1.4.0.0
Hi, I found out that once the size of the array in Wavetable has been increased, there's no way to use an array smaller than the last one in use without having issues. Let's say Wavetable is initialized using an array of size 512, then in the program you pass to setTable() an array of 1024, then going back to an array of 512 doesn't scale back properly (if that makes sense).
I think the issue could be the following, in Wavetable.cpp on line 156 we have:
table_size = (int)userArray->capacity();
while it should probably be:
table_size = (int)userArray->size();
Thanks Mario. Do you have a short example of ChucK code that demonstrates this bug?
I had to do a little research on capacity vs size, and yes, you're right. Pushing the change ASAP.
Presumably this issue can be closed as fixed by pull request #42?
Yes, I think this can be closed.
excellent! thank you all!