Hello Cycling74/Gen Dev Team, I hope you can help me with this,
I found a very annoying bug in GEN and I hope you can fix it , specially since it seems to be something very easy to do for you.
Here's the fact :
I'm making my Gen patches using delay lines etc...
In genexpr / genblock, the delay/buffer size is set to "samplerate" variable. When the entire patch is converted to c++ code, the "samplerate" variable is converted to the INTEGER value of the sampling rate CURRENTLY used by MAX, for example (in the exported .cpp file) you'll find :
"m_delay_22.reset("m_delay_22", 44100);" //this is what is ERRONEOUSLY exported by max/gen
..it should be...
"m_delay_22.reset("m_delay_22", samplerate);" //this is what it should be exported
...It happen also with fractions, for example :
"m_delay_22.reset("m_delay_22", 22050);" //NOT CORRECT
..it should be...
"m_delay_22.reset("m_delay_22", samplerate/2);" //this is what it should be exported
As far as I know, I noticed it happen in the "Reset()" c++ method but maybe it may happen in other places...
And, as far as I know, I noticed it happen with the "delay" line GEN OBJECTS but maybe it may occur with other GEN OBJECTS too...
I'm currently MANUALLY modifying the exported .cpp file each time I export cpp from GEN :
replacing "44100" with "samplerate",
replacing "4410" with "samplerate/10",
replacing "22050" with "samplerate/2",
etc...(very annoying :))
I hope you can help me with this ! If you need additional infos, just ask me :)
P.S. NOTE : If you start a gen patch and create "delay" blocks setting size to "samplerate", and you see at the (right side, "C" icon) genexpr code that is automatically generated on the right side panel, you'll notice that "samplerate" variable is replaced with 44100. So maybe this error happen AT FIRST in genexpr, a step before exporting to c++ code...