|
|
|
01-07-2022, 12:48 PM
|
#1
|
Human being with feelings
Join Date: Jun 2019
Location: Hampshire, England
Posts: 240
|
[SOLVED] mouse editing - move nearest split to mouse cursor?
Suppose you've used dynamic split on a snare track and, despite your best efforts with the transient detection settings, some of the splits are not exactly on the transients. Some are slightly to the left of transients and some are slightly to the right.
To deal with this situation, I've created two custom mouse editing actions. One allows me to fix splits too far to the left, and the other fixes the opposite problem. I just need to point to the transient with my mouse and hitt a key. Each custom action works the same way, e.g. the 'split too far to the right' one basically works as follows:
select item under mouse
move edit cursor to mouse cursor
left trim to edit cursor
select previous item
Untrim right
This works great. However, the trouble is I have to remember which of my two custom actions to use! And this is slowing me down when I'm going through a long piece of audio and fixing things dynamic split didn't quite get right! ;-)
So...is there a way to have one custom action which will fix the problem, regardless of whether the split is too far to the left, or too far to the right? It would be something like 'move nearest split to mouse cursor' but I can't find this anywhere and can't work out how to make it myself.
Any thoughts?
Last edited by IrishRover79; 01-11-2022 at 10:44 AM.
Reason: solved
|
|
|
01-07-2022, 01:07 PM
|
#2
|
Human being with feelings
Join Date: Dec 2009
Location: Oblivion
Posts: 10,271
|
I didn't give it much thought, but I'd start with the action "move cursor to nearest transient items."
And maybe consider stretch markers instead. Dynamic splitting to fix timing is a bit outdated now (not to mention the phase issues you would incur by splitting and moving individual tracks in a multi-mic recording).
You can also use dynamic split to add transient guides, which do nothing until you move them. Basically I'm just suggesting an entirely different approach. Dynamic split has a lot of caveats.
The way I do it is to set up mouse modifiers in prefs so that dragging a stretch marker stretches the item, while holding a modifier key simply re-positions the marker. And I always make sure all multi-track recordings get the same exact treatments.
|
|
|
01-07-2022, 04:41 PM
|
#3
|
Human being with feelings
Join Date: Jun 2019
Location: Hampshire, England
Posts: 240
|
Hi foxAsteria, Thanks for your reply. I'm aware of stretch markers and do use them from time to time. On drums, though, I generally prefer slicing or sliding as I tend to get cleaner results that way. I use item grouping to maintain phase alignment.
That's a bit of a side issue though. There are reasons other than fixing the timing of a performance why one might want to split an item at its transients. And, in those cases also, dynamic split can be inaccurate, requiring its results to be checked and where necessary fixed. Which brings me back to my question.
Regarding the action 'move cursor to nearest transient in item,' I can't see how that's going to be useful, I'm afraid. In the case of an incorrect split, the position of the transient (as far as Reaper is concerned) is where the incorrect split is. That's why the split has been put there. What I want to do is quickly move that split to the real transient by pointing my mouse cursor at the real transient and tapping one key. This would usually be done in the context of scrolling through all the splits in an item and checking them for accuracy.
As I say, I've managed to create two custom actions which, together, can do what I'm looking for. This query is really just to see if I can somehow reduce them to one action, which will work regardless of which side of the incorrect split the real transient is on - so that I don't have to slow down and think about that. A first world problem, for sure! :-)
|
|
|
01-09-2022, 05:11 PM
|
#4
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
Try this script:
Code:
local x, y = reaper.GetMousePosition()
local item = reaper.GetItemFromPoint( x, y, true )
if not item then return reaper.defer(function() end) end
local mouse_pos = reaper.BR_PositionAtMouseCursor( false )
local itemS = reaper.GetMediaItemInfo_Value( item, "D_POSITION" )
local itemE = itemS + reaper.GetMediaItemInfo_Value( item, "D_LENGTH" )
local itemIP = reaper.GetMediaItemInfo_Value( item, "IP_ITEMNUMBER" )
local track = reaper.GetMediaItemTrack( item )
local item_cnt = reaper.CountTrackMediaItems( track )
reaper.PreventUIRefresh( 1 )
local sel_items, si = {}, 0
for i = reaper.CountSelectedMediaItems(0)-1, 0, -1 do
si = si + 1
local item = reaper.GetSelectedMediaItem( 0, i )
sel_items[si] = item
reaper.SetMediaItemSelected( item, false )
end
local function Finish()
for i = 1, si do
if reaper.ValidatePtr2( 0, sel_items[si], "MediaItem*") then
reaper.SetMediaItemSelected( sel_items[si], true )
end
end
reaper.PreventUIRefresh( -1 )
reaper.UpdateArrange()
reaper.Undo_OnStateChange( "Move nearest split to cursor")
end
if mouse_pos - itemS < itemE - mouse_pos then
other_item = reaper.GetTrackMediaItem( track, itemIP-1 )
if not other_item then
other_item = reaper.GetTrackMediaItem( track, itemIP+1 )
end
else
other_item = reaper.GetTrackMediaItem( track, itemIP+1 )
if not other_item then
other_item = reaper.GetTrackMediaItem( track, itemIP-1 )
end
end
if not other_item then
return Finish()
else
reaper.SetMediaItemSelected( item, true )
reaper.SetMediaItemSelected( other_item, true )
reaper.Main_OnCommand(40548, 0) -- Heal splits in items
if reaper.CountTrackMediaItems( track ) == item_cnt then
return Finish()
else
local new_item = reaper.GetItemFromPoint( x, y, true )
reaper.SplitMediaItem( new_item, mouse_pos )
Finish()
end
end
|
|
|
01-11-2022, 10:42 AM
|
#5
|
Human being with feelings
Join Date: Jun 2019
Location: Hampshire, England
Posts: 240
|
Thanks, Amagalma. That works perfectly. Look out for a little thank you donation.
|
|
|
01-11-2022, 12:26 PM
|
#6
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
Thank you very much for the donation! Glad the script helps
|
|
|
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 03:20 PM.
|