Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Q&A, Tips, Tricks and Howto

Reply
 
Thread Tools Display Modes
Old 09-18-2018, 07:49 AM   #1
crackinkid
Human being with feelings
 
Join Date: Nov 2016
Posts: 79
Default Reverse item positions in time selection?

Hi guys,

I was searching for a script that can reverse item positions in a time selection

So for instance I've got a one bar long time selection with 2 selected items.
- item A is placed on the first quarter note, item B is placed on the second quarter note
- now i would execute the script and it would position item A on the 4th Quarter note and item B on the 3rd
So the distance is always proporitional to the end or beginning of the time selection.

Is there an action or script like that yet? I haven't found anything, maybe some talented scripter wants to program that?
crackinkid is offline   Reply With Quote
Old 09-18-2018, 11:13 AM   #2
foxAsteria
Human being with feelings
 
foxAsteria's Avatar
 
Join Date: Dec 2009
Location: Oblivion
Posts: 10,271
Default

search the actions list for "rotate."
__________________
foxyyymusic
foxAsteria is offline   Reply With Quote
Old 09-19-2018, 01:38 PM   #3
crackinkid
Human being with feelings
 
Join Date: Nov 2016
Posts: 79
Default

thank you for your answer,
but i can't seem to find any rotate action that does what I described in my first post. I don't want the items to simply swap positions. they should change their position in the time selection,so for instance if i - I have one selected item positioned on the first quarter note of a 1 bar long time selection
- I execute the script
- now the selected item moved to the fourth quarter note
if the item would be positioned on the second quarter it would have moved to the third and so on.
that's what i meant by reversing.

so the script would check where the item is positioned in the time selection (calculating the position from time selection start to item)
and then script would turn that positive value into a negative and place the item in the "equal" distance relative to the time selections end.

Sry for my bad explanation :e
crackinkid is offline   Reply With Quote
Old 09-22-2018, 08:04 AM   #4
crackinkid
Human being with feelings
 
Join Date: Nov 2016
Posts: 79
Default

crackinkid is offline   Reply With Quote
Old 09-22-2018, 08:50 AM   #5
foxAsteria
Human being with feelings
 
foxAsteria's Avatar
 
Join Date: Dec 2009
Location: Oblivion
Posts: 10,271
Default

You'd need a special script I guess. For that simple example you could just set the appropriate grid size and use the "move items/envelope points right[/left] by grid size" actions.
__________________
foxyyymusic
foxAsteria is offline   Reply With Quote
Old 09-24-2018, 01:45 AM   #6
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

According to the code you show me in PM,
the problem is that item position change,


so GetSelectedMediaItems doesnt work as expected.




Use this item editing template instead :
https://github.com/ReaTeam/ReaScript...%20editing.lua


By storing items in a table first, they can me move freely.
X-Raym is offline   Reply With Quote
Old 09-24-2018, 02:14 AM   #7
crackinkid
Human being with feelings
 
Join Date: Nov 2016
Posts: 79
Default

wow, awesome that was super fast thank you now it's behaving like it should :>
crackinkid 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 05:35 PM.


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