Go Back   Cockos Incorporated Forums > REAPER Forums > newbieland

Reply
 
Thread Tools Display Modes
Old 12-11-2019, 02:21 AM   #1
Eraz
Human being with feelings
 
Join Date: Nov 2019
Posts: 225
Default Copy/paste moves down the track list?

Hello I am fairly new to Reaper and somehow when I copy/paste multiple items on multiple tracks (without changing track selection), it pastes them on the tracks below? How to turn that off?

see GIF below (takes a little bit to load):

Last edited by Eraz; 12-11-2019 at 08:33 AM.
Eraz is offline   Reply With Quote
Old 12-11-2019, 12:39 PM   #2
solger
Human being with feelings
 
solger's Avatar
 
Join Date: Mar 2013
Posts: 5,859
Default

Hi Eraz,

just to clarify:
  • Which operating system are you using (macOS, Linux, Windows)?
  • And which Reaper version (6.01 is the most current)?
  • How are you doing the copy/paste move exactly (via which shortcuts, Actions, etc.)?
  • And just in case: do you currently have a time selection active?
__________________
ReaLauncher

Last edited by solger; 12-11-2019 at 12:48 PM.
solger is offline   Reply With Quote
Old 12-11-2019, 02:03 PM   #3
Eraz
Human being with feelings
 
Join Date: Nov 2019
Posts: 225
Default

Quote:
Originally Posted by solger View Post
Hi Eraz,

just to clarify:
  • Which operating system are you using (macOS, Linux, Windows)?
  • And which Reaper version (6.01 is the most current)?
  • How are you doing the copy/paste move exactly (via which shortcuts, Actions, etc.)?
  • And just in case: do you currently have a time selection active?
Hey there!

- Win10
- Reaper 6.01
- standard copy/paste ctrl+c/ctrl+v
- no time selection

I found out what the issue might be. I loaded a script from the ReaPack, and after that copy/paste does seem to behave like in the GIF. It's
"Script: Lokasenna_Track selection follows item selection.lua", everything works fine but simple copy/paste...
Eraz is offline   Reply With Quote
Old 12-11-2019, 02:17 PM   #4
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

Yeah, that's probably the script causing trouble.

It looks like Reaper is using the last-touched track as the "root" for pasting items on multiple tracks, and since the script selects the tracks in order that means the last track of the three is the last one that was touched.

If I have time this evening I'll look at it, but in the meantime here's a possible fix. Open the script file in a text editor, or Reaper's ReaScript editor, then change this (near the end of the file):
Code:
for i = 1, num_items do
  tracks[i] = reaper.GetMediaItem_Track(sel_items[i])
end

for _, v in pairs(tracks) do
  reaper.SetMediaTrackInfo_Value(v, "I_SELECTED", 1)
end
to this:
Code:
for i = num_items, 1, -1 do
  tracks[i] = reaper.GetMediaItem_Track(sel_items[i])
end

for _, v in ipairs(tracks) do
  reaper.SetMediaTrackInfo_Value(v, "I_SELECTED", 1)
end
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate

Last edited by Lokasenna; 12-11-2019 at 02:22 PM.
Lokasenna is offline   Reply With Quote
Old 12-11-2019, 02:20 PM   #5
Eraz
Human being with feelings
 
Join Date: Nov 2019
Posts: 225
Default

Quote:
Originally Posted by Lokasenna View Post
Yeah, that's probably the script causing trouble. I'm not sure it's something that can be fixed though, since it looks like Reaper is just using the last selected track as the "root" for pasting items on multiple tracks.
The last time I was programming was long time ago, but could it maybe be solved by selecting the tracks the other way round? So that the last selected track is the upmost one? Or is this done automatically by reaper?
Eraz is offline   Reply With Quote
Old 12-11-2019, 02:22 PM   #6
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

I had the same thought; edited my post with some code to try.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 12-11-2019, 02:32 PM   #7
Eraz
Human being with feelings
 
Join Date: Nov 2019
Posts: 225
Default

Quote:
Originally Posted by Lokasenna View Post
I had the same thought; edited my post with some code to try.
Wow, thanks, that was fast. Tried it right now, but unfortunately does not seem to work.
Eraz is offline   Reply With Quote
Old 12-11-2019, 09:12 PM   #8
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

New version up. Everything appears to be behaving correctly here.

I ended up cheating a bit and just re-selecting the first track afterward so it's the last-touched.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 12-12-2019, 12:19 AM   #9
Eraz
Human being with feelings
 
Join Date: Nov 2019
Posts: 225
Default

Quote:
Originally Posted by Lokasenna View Post
New version up. Everything appears to be behaving correctly here.

I ended up cheating a bit and just re-selecting the first track afterward so it's the last-touched.
Thanks for your time!
Tried out version 1.1.1 and if you always stay on the same tracks, then it appears to work.
But if you select another track, and then reselect the items and do copy paste, it pastes them on the previously selected track, even though new tracks are selected. It seems that it does not really overwrite the "selected-state" for paste operations.
I attached a GIF



Edit: So far really only the paste operation seems to behave like this... duplicate i.e. works.

Last edited by Eraz; 12-12-2019 at 12:28 AM.
Eraz is offline   Reply With Quote
Old 12-12-2019, 07:39 AM   #10
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

Code:
Should select track: 3.0
Should select track: 5.0
Should select track: 6.0
Attempting to touch: 3.0
Last-touched: 2.0
My bad, apparently simply selecting a track isn't enough to make it the last touched. There's nothing in the script API about it, unfortunately.

I'll ask around though.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 12-12-2019, 11:19 AM   #11
Eraz
Human being with feelings
 
Join Date: Nov 2019
Posts: 225
Default

Quote:
Originally Posted by Lokasenna View Post
Code:
Should select track: 3.0
Should select track: 5.0
Should select track: 6.0
Attempting to touch: 3.0
Last-touched: 2.0
My bad, apparently simply selecting a track isn't enough to make it the last touched. There's nothing in the script API about it, unfortunately.

I'll ask around though.
Thanks again for your time! It would be such a huge timesaver to have this feature working here
Today I was thinking about a possible solution. Since only the paste operation does not work like expected, could a custom paste script which does not care about "last touched" be a (temporary) fix?

It might not be the "cleanest" solution. But all other operations don't really seem to use "last touched" at all.
Eraz is offline   Reply With Quote
Old 12-12-2019, 11:22 AM   #12
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

X-Raym helped me out; I should have a fix up later tonight.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 12-12-2019, 08:05 PM   #13
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

Got a fix for the fix working here. Should be on ReaPack in a few minutes.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 12-13-2019, 02:39 AM   #14
Eraz
Human being with feelings
 
Join Date: Nov 2019
Posts: 225
Default

Quote:
Originally Posted by Lokasenna View Post
Got a fix for the fix working here. Should be on ReaPack in a few minutes.
Theres still only the "old" version online
Eraz is offline   Reply With Quote
Old 12-13-2019, 08:50 AM   #15
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

It's up now.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 12-18-2019, 01:26 AM   #16
Eraz
Human being with feelings
 
Join Date: Nov 2019
Posts: 225
Default

Quote:
Originally Posted by Lokasenna View Post
It's up now.
Thanks Adam, tested it the last days and it worked like a charm.
Donation sent!
Eraz 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 04:08 PM.


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