|
|
|
06-06-2018, 04:05 AM
|
#1
|
Human being with feelings
Join Date: Jun 2015
Posts: 685
|
Moving tracks with ReaScript
As far as I can see, there's no simple way to move tracks around with ReaScript. Is this really the case?
There seem to be two workarounds for this: X-Raym script which copies the track to the new position, copies the send envelope (?), and deletes the old one. Other is just cut & pasting the tracks to new positions.
The copy&paste method has a major drawback though: all effects on the pasted track will have to be reloaded into memory, which will be a problem with plugins with big states like samplers for example.
So I guess the only way to achieve this efficiently would be to go poking around in the project state chunk and manually changing the track indices? Has anyone had to do this before?
|
|
|
06-06-2018, 04:16 AM
|
#2
|
Human being with feelings
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
|
5.90: API: add ReorderSelectedTracks()
Code:
Lua: boolean reaper.ReorderSelectedTracks(integer beforeTrackIdx, integer makePrevFolder)
Moves all selected tracks to immediately above track specified by index beforeTrackIdx, returns false if no tracks were selected. makePrevFolder=0 for normal, 1 = as child of track preceding track specified by beforeTrackIdx, 2 = if track preceding track specified by beforeTrackIdx is last track in folder, extend folder
|
|
|
06-06-2018, 04:27 AM
|
#3
|
Human being with feelings
Join Date: Jun 2015
Posts: 685
|
Oo nice! thanks for the heads-up.
I wish they updated the API docs sometimes...
|
|
|
06-06-2018, 04:39 AM
|
#4
|
Human being with feelings
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
|
It's updated every time - Help | ReaScript Documentation.
X-Raym's is sometimes a little behind, if you're using that.
|
|
|
06-06-2018, 04:54 AM
|
#5
|
Human being with feelings
Join Date: Jun 2015
Posts: 685
|
Oh I didn't know they included the docs with the install. I was going by the one hosted on reaper.fm. Good to know, thanks.
|
|
|
06-06-2018, 07:43 AM
|
#6
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,875
|
They don't include it... it is generated, based on your own install ! (if you have extension etc)
Quote:
I was going by the one hosted on reaper.fm.
|
Don't that. It is too obsolete.
Quote:
X-Raym's is sometimes a little behind, if you're using that.
|
Indeed.
But from a user experience point of view, it is a bit ahead of the generated one :P
|
|
|
06-06-2018, 09:36 AM
|
#7
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,875
|
@ Sju
Mpl have updated my move track script, if you syc reapack, you should see the new version of these scripts with this API
|
|
|
06-06-2018, 03:00 PM
|
#8
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
|
Quote:
Originally Posted by X-Raym
But from a user experience point of view, it is a bit ahead of the generated one :P
|
Absolutely.
|
|
|
06-08-2018, 04:32 AM
|
#9
|
Human being with feelings
Join Date: Jun 2015
Posts: 685
|
Quote:
Originally Posted by X-Raym
@ Sju
Mpl have updated my move track script, if you syc reapack, you should see the new version of these scripts with this API
|
Thanks. I checked out the alphabetic sort. Not exactly my use case but an useful example.
|
|
|
01-17-2019, 10:20 AM
|
#10
|
Human being with feelings
Join Date: Jul 2010
Location: Slovakia
Posts: 2,588
|
Hi, I tried to use this function in a deferred script and it generates an undo point.
Is this a bug? What tou think? Is there any way around it?
|
|
|
01-17-2019, 11:31 AM
|
#11
|
Human being with feelings
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
|
You're changing the project, so it makes sense that it would create an undo point.
One issue with defer scripts is that you can't extend a Undo_BeginBlock section over multiple script loops - I had an FR a while back about giving us a way to do that, don't think it got much attention.
|
|
|
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:28 PM.
|