Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 10-17-2018, 07:16 AM   #1
tufb
Human being with feelings
 
Join Date: Dec 2017
Posts: 152
Default Lua: Replace item under mouse cursor; Copy and replace selected items

Copy and replace selected items

bfut_Copy item to clipboard.lua
bfut_Paste item from clipboard to selected items (replace).lua


Copies and replaces selected items, preserving position, length, mute status, etc. in the replaced items. Requires SWS extension.

How to use:
1. Select media item.
2. Run script "bfut_Copy item to clipboard".
3. Select other media item(s).
4. Run script "bfut_Paste item from clipboard to selected items (replace)".

NB: I use shortcuts similar to Ctrl+c, Ctrl+v.





Replace item under mouse cursor

bfut_Replace item under mouse cursor with selected item.lua

Replaces item under mouse cursor with selected item, preserving position, length, mute status, etc. in the replaced item. Requires SWS extension. (This is a full rewrite of a similar script by spk77.)

How to use:
1. Select media item.
2. Hover mouse over another item.
3. Run the script.

NB: Requires setting a hotkey or mouse modifier.

Installation
Directly from https://github.com/bfut/ReaScripts or
Copy and paste this URL in Extensions > ReaPack > Import a repository:
Code:
https://github.com/bfut/ReaScripts/raw/main/index.xml
Then install in Extensions > ReaPack > Browse packages.

Last edited by tufb; 11-18-2020 at 11:41 AM.
tufb is offline   Reply With Quote
Old 10-27-2018, 03:01 PM   #2
tufb
Human being with feelings
 
Join Date: Dec 2017
Posts: 152
Default

Now with screencaptures!

Copy and replace selected items




Replace item under mouse cursor




Some more details:

Item locking status is handled as follows...
1) A locked target item will not be replaced.
2) When a target item is replaced with a locked source item, the replaced target item will not be locked. However, if the source item is locked to a specific take, the replaced target item will still be locked to that take.


Replaced items get all new IGUIDs and GUIDs, so you don't end up with an unpredictable RPP.


Target MIDI items will are pooled with source MIDI items by default, because it's easy to unpool them. This behavior can be changed in script code.

Last edited by tufb; 10-27-2018 at 03:09 PM.
tufb is offline   Reply With Quote
Old 07-20-2019, 02:07 AM   #3
tufb
Human being with feelings
 
Join Date: Dec 2017
Posts: 152
Default

Performed some light code maintenance on all three functions.
The reapack-index has been updated and can be found on my GitHub. -> https://github.com/bfut/ReaScripts

Feedback is always appreciated.

As always, I have to give my respect to CF for his marvellous reapack-index.
tufb is offline   Reply With Quote
Old 02-22-2020, 07:06 AM   #4
tufb
Human being with feelings
 
Join Date: Dec 2017
Posts: 152
Default

Online today, installation as usual. Among several updated scripts in my repository:


bfut_Replace item under mouse cursor with selected item
@version 1.2
@changelog
+ native pooled (ghost) MIDI item behavior
+ Fix: replace FXIDs in replaced item



bfut_Paste item from clipboard to selected items (replace)
@version 1.2
@changelog
+ native pooled (ghost) MIDI item behavior
+ Fix: replace FXIDs in replaced items
Requires SWS v2.11.0.0 or later



bfut_Remove item under mouse cursor (delete)
@version 1.1
@changelog
+ no longer requires SWS extension
tufb is offline   Reply With Quote
Old 02-22-2020, 08:28 AM   #5
Vagelis
Human being with feelings
 
Vagelis's Avatar
 
Join Date: Oct 2017
Location: Larisa, Greece
Posts: 3,795
Default

Hi! those are some useful scripts thanks! I 'd like to ask would it be possible to replace take under mouse instead of the whole item? That would be useful for comping.
Vagelis is offline   Reply With Quote
Old 02-22-2020, 10:07 AM   #6
tufb
Human being with feelings
 
Join Date: Dec 2017
Posts: 152
Default

Thanks!

As in, replacing active take of target item(s) with active take of the source item?

Right now, you can get:
Via extension, "SWS/S&M: Copy active takes". Afterwards, "Take: Paste as takes in items". Here, a copied source item's takes are added.
Additionally, there is "Take: Delete active take from items".

Last edited by tufb; 02-22-2020 at 10:15 AM.
tufb is offline   Reply With Quote
Old 02-22-2020, 11:03 AM   #7
tufb
Human being with feelings
 
Join Date: Dec 2017
Posts: 152
Default

I'll handle your request in my custom scripts thread: https://forum.cockos.com/showthread....80#post2249480

Last edited by tufb; 02-25-2020 at 03:55 PM.
tufb is offline   Reply With Quote
Old 02-22-2020, 12:03 PM   #8
Vagelis
Human being with feelings
 
Vagelis's Avatar
 
Join Date: Oct 2017
Location: Larisa, Greece
Posts: 3,795
Default

Quote:
Originally Posted by tufb View Post
As in, replacing active take of target item(s) with active take of the source item?
Yes exactly this but without the annoying pop up dialog Your script works great so far ! Really useful for comping and not only Huge thanks !

Now came up another idea for comping that could be also very useful: a similar script to SWS/FNG: Rotate selected media items positions and lengths but for takes and not for the whole item that would exchange the take sources without replacing them.

Again, thanks a lot for your interest and work!!
Vagelis is offline   Reply With Quote
Old 02-23-2020, 10:37 AM   #9
tufb
Human being with feelings
 
Join Date: Dec 2017
Posts: 152
Default

I'll handle your request in my custom scripts thread: https://forum.cockos.com/showthread....80#post2249480

Last edited by tufb; 02-25-2020 at 03:56 PM.
tufb is offline   Reply With Quote
Old 02-23-2020, 02:30 PM   #10
Vagelis
Human being with feelings
 
Vagelis's Avatar
 
Join Date: Oct 2017
Location: Larisa, Greece
Posts: 3,795
Default

Quote:
Originally Posted by tufb View Post
That one's not too difficult either, except it requires extracting and reinserting item take chunks. mpl has implemented this function. Maybe he's up for it?
No idea But nice to know that it could be implemented! It could very useful for comping because when we split an item while comping in order to choose a part of the take, if we want to change its position, we have to move the whole item, while with this action we could just exchange the take positions without overwriting one of the takes as the other script.
Vagelis is offline   Reply With Quote
Old 02-23-2020, 05:11 PM   #11
tufb
Human being with feelings
 
Join Date: Dec 2017
Posts: 152
Default

I'll handle your request in my custom scripts thread: https://forum.cockos.com/showthread....80#post2249480

Last edited by tufb; 02-25-2020 at 03:56 PM.
tufb is offline   Reply With Quote
Old 02-23-2020, 05:29 PM   #12
Vagelis
Human being with feelings
 
Vagelis's Avatar
 
Join Date: Oct 2017
Location: Larisa, Greece
Posts: 3,795
Default

Thanks so much for looking into it, just saw it before i go to bed, i get this error though.

Vagelis is offline   Reply With Quote
Old 02-23-2020, 05:36 PM   #13
tufb
Human being with feelings
 
Join Date: Dec 2017
Posts: 152
Default

I recommend redownloading the scripts. Looks like something went wrong on your end, because that error doesn't make any sense within the context of my code.

I'll handle your custom request in another thread: https://forum.cockos.com/showthread....80#post2249480

Thanks!

Last edited by tufb; 02-25-2020 at 03:57 PM.
tufb 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 02:35 AM.


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