|
|
|
12-08-2021, 08:51 AM
|
#1
|
Human being with feelings
Join Date: Feb 2016
Location: Hollyweird
Posts: 2,630
|
[FIXED] ReaScript Master Track P_EXT: Various storage & clearing bugs
[Fixed in 6.43!]
P_EXT data on the Master Track is lost on project reload, unlike P_EXT in regular tracks, items, etc.
I also tested P_EXT in Master Track (tempo) envelope and it's affected by this same bug.
This is a nasty bug for scripters since Master Track envelopes are currently the only place devs can save arbitrary data that is affected by undo points.
Last edited by MonkeyBars; 12-10-2021 at 01:49 PM.
|
|
|
12-08-2021, 09:43 AM
|
#2
|
Administrator
Join Date: Mar 2007
Location: NY
Posts: 15,749
|
P_EXT is currently not supported for the master track itself, we can look at adding that.
I think it is saved/loaded correctly for other master objects like the tempo map envelope, though.
|
|
|
12-08-2021, 09:57 AM
|
#3
|
Human being with feelings
Join Date: Feb 2016
Location: Hollyweird
Posts: 2,630
|
Thanks for chiming in!
P_EXT does store data on the Master Track itself already, as well as the tempo envelope, but neither of these P_EXT locations persist across project loads. That's probably a better way to phrase the actual bug here.
|
|
|
12-08-2021, 10:02 AM
|
#4
|
Human being with feelings
Join Date: Feb 2016
Location: Hollyweird
Posts: 2,630
|
Also please note that, unlike its tempo envelope P_EXT, the Master Track P_EXT is not tied to the Undo History. Not sure what the intended behavior is.
Here is my test of how P_EXT values are stored in the Undo History.
|
|
|
12-08-2021, 10:03 AM
|
#5
|
Administrator
Join Date: Mar 2007
Location: NY
Posts: 15,749
|
Quote:
Originally Posted by MonkeyBars
Thanks for chiming in!
P_EXT does store data on the Master Track itself already, as well as the tempo envelope, but neither of these P_EXT locations persist across project loads. That's probably a better way to phrase the actual bug here.
|
Can you check that again or give a specific example regarding the tempo envelope, or any object other than the master track itself? This works as expected here:
Code:
tr=reaper.GetMasterTrack(0)
env=reaper.GetTrackEnvelopeByName(tr, "Tempo map")
reaper.GetSetEnvelopeInfo_String(env, "P_EXT:foo", "bar", 1)
If the project is saved, this appears in the .RPP and after close/reopen is read back properly by GetSetEnvelopeInfo_String:
Code:
<TEMPOENVEX
EGUID {2588176B-3CAD-49DD-8D83-B532BA43AAC6}
ACT 0 -1
VIS 1 0 1
LANEHEIGHT 0 0
ARM 0
DEFSHAPE 1 -1 -1
<EXT
foo bar
>
>
|
|
|
12-08-2021, 11:47 AM
|
#6
|
Human being with feelings
Join Date: Feb 2016
Location: Hollyweird
Posts: 2,630
|
Quote:
Originally Posted by schwa
Can you check that again or give a specific example regarding the tempo envelope, or any object other than the master track itself?
If the project is saved, this appears in the .RPP and after close/reopen is read back properly by GetSetEnvelopeInfo_String:
Code:
<TEMPOENVEX
EGUID {2588176B-3CAD-49DD-8D83-B532BA43AAC6}
ACT 0 -1
VIS 1 0 1
LANEHEIGHT 0 0
ARM 0
DEFSHAPE 1 -1 -1
<EXT
foo bar
>
>
|
Actually, you have provided the state chunk, not output from GetSetEnvelopeInfo_String()! I also see the P_EXT data in the state chunk, but P_EXT value is NOT returned by Info_String() functions (only) after project reload.
SO:
Master Track P_EXT data indeed DOES persist across project reload, BUT is only reflected in state chunk and is NOT returned properly by Info_String() function(s). (I only tested Tempo envelope but assume this is the same bug for any Master Track P_EXT.)
Changed thread subject to reflect
Last edited by MonkeyBars; 12-08-2021 at 11:58 AM.
|
|
|
12-08-2021, 12:17 PM
|
#7
|
Administrator
Join Date: Mar 2007
Location: NY
Posts: 15,749
|
Quote:
Originally Posted by schwa
If the project is saved, this appears in the .RPP and after close/reopen is read back properly by GetSetEnvelopeInfo_String
|
for example if you run this script
Code:
tr=reaper.GetMasterTrack(0)
env=reaper.GetTrackEnvelopeByName(tr,"Tempo map")
reaper.GetSetEnvelopeInfo_String(env,"P_EXT:foo","bar",1)
and then close the project and reopen it, then this script
Code:
tr=reaper.GetMasterTrack(0)
env=reaper.GetTrackEnvelopeByName(tr,"Tempo map")
rc,str=reaper.GetSetEnvelopeInfo_String(env,"P_EXT:foo","",0)
reaper.ShowConsoleMsg(str)
displays "bar". As far as I can tell, saving and loading P_EXT data is working as expected for the tempo envelope, and all other objects *except* for the master track itself.
Last edited by schwa; 12-08-2021 at 12:29 PM.
|
|
|
12-08-2021, 12:31 PM
|
#8
|
Human being with feelings
Join Date: Feb 2016
Location: Hollyweird
Posts: 2,630
|
Quote:
Originally Posted by schwa
repeating myself:
for example if you run this script
Code:
tr=reaper.GetMasterTrack(0)
env=reaper.GetTrackEnvelopeByName(tr,"Tempo map")
reaper.GetSetEnvelopeInfo_String(env,"P_EXT:foo","bar",1)
and then close the project and reopen it, then this script
Code:
tr=reaper.GetMasterTrack(0)
env=reaper.GetTrackEnvelopeByName(tr,"Tempo map")
rc,str=reaper.GetSetEnvelopeInfo_String(env,"P_EXT:foo","",0)
reaper.ShowConsoleMsg(str)
displays "bar". As far as I can tell, saving and loading P_EXT data is working as expected for the tempo envelope, and all other objects *except* for the master track itself.
|
I was doing nearly the identical thing with my test LUA.
But just in case, I tried exactly your code, and cannot replicate your results in 6.42.
I get blank string with the second script after project reload. Then while keeping the project open I can run the 1st script and repeat the output script, and "bar" appears.
Oh wow! I just updated to yesterday's build 6.42+1207 and it's fixed! Any idea what recent code change repaired the bug?!
Thank you so much for testing this with me, Schwa! Very encouraging.
Last edited by MonkeyBars; 12-08-2021 at 01:54 PM.
|
|
|
12-08-2021, 12:36 PM
|
#9
|
Human being with feelings
Join Date: Feb 2016
Location: Hollyweird
Posts: 2,630
|
Quote:
Originally Posted by schwa
As far as I can tell, saving and loading P_EXT data is working as expected for the tempo envelope, and all other objects *except* for the master track itself.
|
Actually, I just tested the Master Track P_EXT data retrieval after project restart and it is working properly for me in 6.42+1207. Are you sure you saw the bug?
Last edited by MonkeyBars; 12-08-2021 at 01:54 PM.
|
|
|
12-08-2021, 12:57 PM
|
#10
|
Administrator
Join Date: Mar 2007
Location: NY
Posts: 15,749
|
I'm moderately confident that P_EXT is working as expected for the tempo envelope, in both the 6.42 released version and the current prerelease builds.
I'm highly confident that P_EXT is not supported for the master track, in either the 6.42 release version or the current prerelease builds.
|
|
|
12-08-2021, 01:04 PM
|
#11
|
Human being with feelings
Join Date: Feb 2016
Location: Hollyweird
Posts: 2,630
|
I'm just reporting the results of my tests in a portable install.
|
|
|
12-08-2021, 01:09 PM
|
#12
|
Administrator
Join Date: Mar 2007
Location: NY
Posts: 15,749
|
Could you just check your results please? This is a challenging discussion if we're not on the same page.
Write P_EXT data to the tempo envelope in a test project using a reascript, save the project and close out of it.
Open the project in a text editor to verify that the <TEMPOENVEX block contains the <EXT block that you wrote.
Open the project normally and read the P_EXT data back using a reascript.
If any of those steps fails, could you report which one please?
|
|
|
12-08-2021, 01:13 PM
|
#13
|
Human being with feelings
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,618
|
The test script persists the data for me with stock 6.42. Both tests outlined by schwa pass for me.
|
|
|
12-08-2021, 01:45 PM
|
#14
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Quote:
Originally Posted by schwa
I'm highly confident that P_EXT is not supported for the master track, in either the 6.42 release version or the current prerelease builds.
|
It is actually, but only as long as the project is opened. It's not stored in the projectfile, though.
How to recreate:
1. create a new project
2. create a P_EXT for the master-track and check, if it is available:
Code:
-- create P_EXT in the master track
reaper.GetSetMediaTrackInfo_String(reaper.GetMasterTrack(0,0), "P_EXT:Test", "This is a a test more", true)
-- this wil return the value of the P_EXT just created
retval, PEXT = reaper.GetSetMediaTrackInfo_String(reaper.GetMasterTrack(0,0), "P_EXT:Test", "", false)
In this code, PEXT will contain the value we just wrote into it, as expected.
Now:
3. Save the project
4. Close the project
5. Reopen the project
6. Try to access the P_EXT again:
Code:
-- returns empty string now
retval, PEXT = reaper.GetSetMediaTrackInfo_String(reaper.GetMasterTrack(0,0), "P_EXT:Test", "", false)
Now, the P_EXT is gone and the function returns just an empty string.
It looks like, as if P_EXTs in the master track are kept in memory, but not written into the statechunk and(when in undo-block-functions) are not added to the undo-list.
It's also not existing in the rpp-file of the saved project. Also not, when adding the project to the render-queue and reading the rpp-file from there.
Tested on Reaper 6.42 on Windows 7.
Last edited by Meo-Ada Mespotine; 12-08-2021 at 01:59 PM.
|
|
|
12-08-2021, 01:50 PM
|
#15
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Quote:
Originally Posted by MonkeyBars
Actually, I just tested the Master Track P_EXT data retrieval after project restart and it is working properly for me in 6.42+1107. Are you sure you saw the bug?
|
This is odd. Did the bug get fixed without being known by anyone before? XD
Great to hear, though.
|
|
|
12-08-2021, 01:53 PM
|
#16
|
Human being with feelings
Join Date: Feb 2016
Location: Hollyweird
Posts: 2,630
|
Wow, this is really odd. I am testing in macOS if it makes any difference. What OS are tack and schwa on?
MAP, would you mind testing in 6.42+1207?
|
|
|
12-08-2021, 02:00 PM
|
#17
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Will try.
|
|
|
12-08-2021, 02:02 PM
|
#18
|
Administrator
Join Date: Mar 2007
Location: NY
Posts: 15,749
|
Sorry to be bigfooting this thread, but the signal to noise is a bit low, so I want to be clear.
I'm certain P_EXT for the master track does not persist when saving/reloading the project, in any REAPER build including +dev1207. It has never been supported. We will probably add support for this in the next prerelease build though.
As far as I can tell, P_EXT for the project tempo envelope does persist when saving/reloading the project and that has been supported properly for a long time, including in 6.42 and in the current prerelease builds. But it's possible there are some cases where this isn't working as expected. If somebody has a reproducible case that *doesn't* work, please give as much detail as possible. But like I said, as far as I can tell this is working properly.
|
|
|
12-08-2021, 02:12 PM
|
#19
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Ah, now I get what you meant and it matches what I observed.
Thnx for considering adding it to the next dev-release.
|
|
|
12-08-2021, 02:29 PM
|
#20
|
Human being with feelings
Join Date: Feb 2016
Location: Hollyweird
Posts: 2,630
|
Okay!
I've done some more testing and am definitely able to reproduce the bug.
The distingushing factor appears to be that the Master Track data is tied to Reaper load, not project load.
Reproducing the bug requires restarting Reaper. The reason I thought it was tied to the update was because after update, Reaper opened without a project, which didn't flush the Master Track data.. or something? I can't test more now
|
|
|
12-08-2021, 02:43 PM
|
#21
|
Human being with feelings
Join Date: Feb 2016
Location: Hollyweird
Posts: 2,630
|
Confirmed Master Track P_EXT may be stored per Reaper boot. Not tied to project. - Write Master Track P_EXT OR Tempo map P_EXT
- Save project
- Reboot Reaper
- Load project
- Output Master Track P_EXT with GetSetMediaTrackInfo_String()
Console result: Empty string
- Write Master Track P_EXT OR Tempo map P_EXT
- Save project
- Close project
- Load project
- Output Master Track P_EXT with GetSetMediaTrackInfo_String()
Console result: Stored string
Last edited by MonkeyBars; 12-08-2021 at 03:53 PM.
|
|
|
12-08-2021, 03:55 PM
|
#22
|
Human being with feelings
Join Date: Feb 2016
Location: Hollyweird
Posts: 2,630
|
Very strange. I just booted up Reaper 6.42 and loaded the project, and I'm getting the string on the first try. So this is intermittent...
Perhaps I am making errors in my testing? I'm trying to identify the cause of the bug appearing.
I just tested the tempo envelope P_EXT and am getting it on Reaper restart, but not Master Track P_EXT.
|
|
|
12-08-2021, 04:05 PM
|
#23
|
Human being with feelings
Join Date: Feb 2016
Location: Hollyweird
Posts: 2,630
|
Further tests: - Load project
- Store Tempo map P_EXT with GetSetEnvelopeInfo_String()
- Save project
- Close project (to empty project)
- Output Tempo map P_EXT with GetSetEnvelopeInfo_String() to console
- Result: Stored string!!
- Load project
- Output Tempo map P_EXT to console with GetSetEnvelopeInfo_String()
- Result: Empty string!!
- Output Tempo map state chunk to console
- Result: P_EXT data is present!!
So it seems to be a bug in GetSet...Info_String() that isn't correctly flushing object data between project loads?
Last edited by MonkeyBars; 12-08-2021 at 04:11 PM.
|
|
|
12-08-2021, 04:13 PM
|
#24
|
Administrator
Join Date: Mar 2007
Location: NY
Posts: 15,749
|
Ah, it's a bug that the extended state of the master track envelopes isn't cleared when the project is cleared. A fix for that may or may not make it into the next build.
|
|
|
12-08-2021, 04:22 PM
|
#25
|
Human being with feelings
Join Date: Feb 2016
Location: Hollyweird
Posts: 2,630
|
Thanks schwa.
Confirmed with Master Track P_EXT as well (not just envelope) – not flushed in state chunk on project close.
But Master Track P_EXT is not being loaded afresh on project load, which accounts for the confusing QA here.
The desired behavior of course is flush on project close and load on project load.
Last edited by MonkeyBars; 12-08-2021 at 04:34 PM.
|
|
|
12-08-2021, 04:35 PM
|
#26
|
Human being with feelings
Join Date: Feb 2016
Location: Hollyweird
Posts: 2,630
|
I'm also noticing that when script writes data to the Master Track, the project is not marked as dirty. It could simply be a matter of calling the project dirty method after setting data values... hopefully.
So the combo of not clearing data and sometimes not saving appears to be causing the erroneous behavior.
|
|
|
12-08-2021, 05:03 PM
|
#27
|
Human being with feelings
Join Date: Feb 2016
Location: Hollyweird
Posts: 2,630
|
Okay I think there are 2 bugs and a gotcha here: - Master Track P_EXT doesn't get saved with project data
- Master Track P_EXT incl. envelopes don't flush on project close
- Master Track P_EXT incl. envelopes Set() doesn't mark project as dirty
Scripts not marking project dirty was confusing us and causing our false positives with tempo envelope, as we thought we were saving project when we were not. Naughty amateur QA engineers!
Last edited by MonkeyBars; 12-09-2021 at 04:30 PM.
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 12:40 PM.
|