2008/12/14, Josh Parmenter <josh@xxxxxxxxxxxxxxxxx>:
On Dec 14, 2008, at 1:26 PM, Batuhan Bozkurt wrote:
Somehow Ringz.ar remembers its past state...
Like I said, this would indicate to me that some memory isn't being
init'd
correctly.
I'll look it it later.
Josh, I had the same feeling as you, but as JH points out Ringz
doesn't use RTAlloc. It correctly initialises all its variables, as
far as I can tell.
I think I have found the problem. When the Ringz ugen is created, it
calls Ringz_next() but with a blocksize of 1 (this is standard ugen
init procedure). However, the iterations which look like
LOOP(unit->mRate->mFilterLoops,
...
);
LOOP(unit->mRate->mFilterRemain,
...
);
assume that the blocksize is what it normally is (i.e. 64, for most
people). This causes the looping to write outside the memory that it
should do (and probably therefore leaves garbage around to "remember"
inappropriately).
I'm not sure how best to fix this. One way is that the constructor
could call ClearUnitOutputs() rather than trying to run Ringz_next(),
which from my testing does prevent the nasties. Not sure if this
change would have bad side-effects...? What do you think?
Dan
_______________________________________________
sc-dev mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-dev/
search: https://listarc.bham.ac.uk/lists/sc-dev/search/