Old 06-28-2020, 01:03 PM   #1
Buy One
Human being with feelings
 
Join Date: Sep 2019
Posts: 319
Default Q: Check several track parameters at once

Just curious whether and how this

Code:
reaper.GetMediaTrackInfo_Value(tr, "I_FOLDERDEPTH")
reaper.GetMediaTrackInfo_Value(tr, "B_SHOWINTCP")
reaper.GetMediaTrackInfo_Value(tr, "B_SHOWINMIXER")
can be shortened.
Buy One is online now   Reply With Quote
Old 06-28-2020, 01:19 PM   #2
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 658
Default

Not at all, unless you want to work with StateChunks, but I think, this would also be at least 2 lines or so(plus one line for getting the track).

And it's code is complicated to read.
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish

Last edited by Meo-Ada Mespotine; 06-28-2020 at 02:11 PM.
Meo-Ada Mespotine is offline   Reply With Quote
Old 06-28-2020, 01:29 PM   #3
Buy One
Human being with feelings
 
Join Date: Sep 2019
Posts: 319
Default

I see, thank you.
Buy One is online now   Reply With Quote
Old 06-28-2020, 05:12 PM   #4
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,191
Default

Code:
local trk_num = reaper.GetNumTracks()

start = reaper.time_precise()
for tr = 0, trk_num-1 do
  local track = reaper.GetTrack( 0, tr )
  local _, chunk = reaper.GetTrackStateChunk( track, "", false )
  local FOLDERDEPTH, B_SHOWINMIXER,B_SHOWINTCP = chunk:match("ISBUS (%d).+SHOWINMIX (%d) [%d%.]+ [%d%.]+ (%d)")
end
speed1 = reaper.time_precise() - start

start = reaper.time_precise()
for tr = 0, trk_num-1 do
  local track = reaper.GetTrack( 0, tr )
  local FOLDERDEPTH = reaper.GetMediaTrackInfo_Value(track, "I_FOLDERDEPTH")
  local B_SHOWINTCP = reaper.GetMediaTrackInfo_Value(track, "B_SHOWINTCP")
  local B_SHOWINMIXER = reaper.GetMediaTrackInfo_Value(track, "B_SHOWINMIXER")
end
speed2 = reaper.time_precise() - start
Test project with 3000 empty tracks:
Code:
speed1 = 0.0206 sec
speed2 = 0.0013 sec
Same test on a project with 10 tracks but a lot of FX:
Code:
speed1 = 0.246 sec
speed2 = 1.119 sec
Result:
Interesting...
amagalma is offline   Reply With Quote
Old 06-28-2020, 05:41 PM   #5
Thonex
Human being with feelings
 
Join Date: May 2018
Location: Los Angeles
Posts: 1,200
Default

Quote:
Originally Posted by amagalma View Post

Same test on a project with 10 tracks but a lot of FX:
Code:
speed1 = 0.246 sec
speed2 = 1.119 sec
Result:
Interesting...
Whoa... that is interesting!
__________________
Cheers,
Andrew K
v6.03+dev0114 - January 14 2020 • Mac 10.12.+ • i7 Quad 2.9GHz • 24GB
Thonex is online now   Reply With Quote
Old 06-28-2020, 06:03 PM   #6
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 658
Default

Yeah, mass fiddling with stuff is usually faster when done in StateChunks.

That's why my Ultraschall-API-Routing-functions are much faster than Reaper's own native functions.
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is offline   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 12:49 AM.


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