Old 09-16-2021, 01:11 AM   #1
DarkStar
Human being with feelings
 
DarkStar's Avatar
 
Join Date: May 2006
Location: Surrey, UK
Posts: 19,681
Default ReaScripts: Access another (named) project?

Is there any way to access another, named, project and then its track chunks from a lua script?

I have looked through the API documentation but did not see a suitable one.
__________________
DarkStar ... interesting, if true. . . . Inspired by ...
DarkStar is online now   Reply With Quote
Old 09-16-2021, 02:33 AM   #2
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

Not possible to use reascript API with unopen project


but you can parse and do text processing on .rpp


More advanced, you can use our RPP Lua Parser :
https://github.com/ReaTeam/ReaScripts/wiki/RPP-Parser


It is more advanced than simple line per line text parsing as it actually understand .rpp chunks structure.
X-Raym is offline   Reply With Quote
Old 09-16-2021, 04:06 PM   #3
DarkStar
Human being with feelings
 
DarkStar's Avatar
 
Join Date: May 2006
Location: Surrey, UK
Posts: 19,681
Default

OK. Thank you.

How about if I load the project ("XXX") into a new tab, then run the lua script in my main project ("AAA"). Can I run a script for project AAA and access the track chunks of the project XXX, in the other tab?
__________________
DarkStar ... interesting, if true. . . . Inspired by ...
DarkStar is online now   Reply With Quote
Old 09-16-2021, 06:27 PM   #4
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,110
Default

Yes, this should be possible.
Use EnumProjects() to get a pointer ('ReaProject') to the (background) project of interest.
Use that pointer in GetTrack() to get track from background project, then GetTrackStateChunk().
nofish is offline   Reply With Quote
Old 09-17-2021, 06:30 AM   #5
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

possible, but way less efficient than the rpp parser. especially if you have VST like Kontakt etc.
X-Raym is offline   Reply With Quote
Old 09-17-2021, 10:55 AM   #6
DarkStar
Human being with feelings
 
DarkStar's Avatar
 
Join Date: May 2006
Location: Surrey, UK
Posts: 19,681
Default

Thank you both. I'll give the parser a try out first.
__________________
DarkStar ... interesting, if true. . . . Inspired by ...
DarkStar is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:43 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.