How to reproduce?
Create a track, insert some audio on it, press V to toggle volume envelope and input a lot of points with ctrl modifier
Now, copy that track (make sure envelope gets copied too) and invert the phase on the copied track -
IT DOES NOT NULL!
It is important to note that this happens when you copy tracks and envelope gets copied automatically. If you copy just the item to a new track and then manually copy the envelope, performance of both envelopes will be the same - running the second python script on any of those will display redrawing and nulling problems presented later in the bug report
It also happens to all of the envelopes when you load a saved project
So after you've tested it does not null, save your project and close reaper. After that, reopen project - now it does null! As if reaper does the same thing it does when you're copying the envelope to all of the envelopes in the project
But envelope chunk is the same?!
Before saving and reloading project and giving Reaper a chance to do what it does to the envelope run this python script on both envelopes:
Code:
envelope = RPR_GetSelectedTrackEnvelope(0)
env_state = RPR_GetSetEnvelopeState(envelope, "", 4*1024*1024)
RPR_ShowConsoleMsg(env_state[2])
Compare the results - they should be completely the same. Yet it does not null...
It does the same thing when you update envelope chunk
This python script (but you can try it in c++ with GetSetObjectState - the same thing will happen) just reads the envelope chunk and give it back to the Reaper untouched:
Code:
envelope = RPR_GetSelectedTrackEnvelope(0)
env_state = RPR_GetSetEnvelopeState(envelope, "", 4*1024*1024)
RPR_GetSetEnvelopeState(envelope, env_state[2], 4*1024*1024)
You can directly see on the envelope that it changes even though it shouldn't:
However, if you run that action on the original track's envelope - it will null with the copied track. A proof that Reaper does whatever it does consistently and predictably.
Using different envelope instead of volume envelope
Instead of using volume envelope use something like JS: Utility/volume
Now, when copying tracks - they will null. But the drawing issue is still present. You can confirm it by running the last python script on the original track.
On the other hand, if you don't run the script immediately but freeze and unfreeze both tracks and try running the script - there will be no drawing issues - so it seems reaper does the same thing it does when restoring frozen envelopes.
Discussion thread
http://forum.cockos.com/showthread.php?t=111924