Modulo doesn´t work in progress (FL Studio)


#1

Hello,

I figured out that modulo operations doesn´t work in a progress loop. what happends? ok, modulo is working but if I close (delete) my plugin, the DAW breaks down. For example:

if i do this…

for (int i = 0; i < _buffersize; i++)
{
	// ... some stuff

	_writeL++;
	_writeR++;		
	_writeL %= _buffersize;
	_writeR %= _buffersize;

}

… the DAW breaks down, when i close/delete the instance in FL Studio. I also tested it with ‘VSTHost’ and with the host, there are no problems.
Testing the same plugin without the modulo operations, I can close/delete the plugin in FL Studio without any problems. Now I ask myself, why? What do You think?

An alternative is this way and that is working but I prefer to use modulo:

for (int i = 0; i < _buffersize; i++)
{
	_writeL++;
	_writeR++;
		
	_writeL = _writeL >= _buffersize ? _writeL-_buffersize : _writeL;
	_writeR = _writeR >= _buffersize ? _writeR-_buffersize : _writeR;
}

Greetz from Germany
T.


#2

Maybe you have the same issue i got: http://www.rawmaterialsoftware.com/viewtopic.php?f=2&t=11354