|
|
|
02-21-2017, 11:15 AM
|
#1
|
Human being with feelings
Join Date: Jul 2012
Location: Netherlands
Posts: 5,247
|
Snap Edit cursor to nearest Grid Line...
Dear Reapers,
Seems that there doesn't exist an Action "Snap Edit Cursor to nearest Grid line".
For my workflow, this Action would be so useful .
Am i overseeing it ?
If not available indeed, is it maybe scriptable ?
Willing to pay generously for it.
Warm Regards.
|
|
|
02-21-2017, 11:38 AM
|
#2
|
Human being with feelings
Join Date: Aug 2006
Location: Berlin
Posts: 11,818
|
As long as relative grid is not activated, snapping is on as well as the grid, you just need to nudge your editor cursor to land on the next or previous grid line.
Here's the simple code for LUA, which was actually provided to me by some helpful soul on this forum:
Code:
local val=1
reaper.ApplyNudge( -- move edit cursor left 1 frame
0, -- ReaProject project
2, -- integer nudgeflag (&1=set to value (otherwise nudge by value), &2=snap)
6, -- 0=position, 1=left trim, 2=left edge, 3=right edge, 4=contents, 5=duplicate, 6=edit cursor
18, -- integer nudgeunits: 0=ms, 1=seconds, 2=grid, 3=256th notes, ..., 15=whole notes, 16=measures.beats (1.15 = 1 measure + 1.5 beats), 17=samples, 18=frames, 19=pixels, 20=item lengths, 21=item selections
val, -- value: amount to nudge by, or value to set to
true, -- reverse: in nudge mode, nudges left (otherwise ignored)
0 -- copies: in nudge duplicate mode, number of copies (otherwise ignored)
)
I use this stuff to move items around, manipulate item edges and so on. You can use the nudge-by-slot actions of course. You'd need to save the right settings in the right slot first. Those load/save actions are only available in the action list though, not in the nudge window itself.
|
|
|
02-21-2017, 11:48 AM
|
#3
|
Human being with feelings
Join Date: Jul 2012
Location: Netherlands
Posts: 5,247
|
Quote:
Originally Posted by airon
As long as relative grid is not activated, snapping is on as well as the grid, you just need to nudge your editor cursor to land on the next or previous grid line.
.
|
Thanks for your help !
But the Action should decide itself if the Edit cursor should be moved backwards or forward, depending on which Gridline is closest to Edit Cursor, the left one or right one.
Workflow:
I have Snap OFF.
I have Grid ON.
I place Edit cursor somewhere between 2 Grid lines.
I execute wishful Script.
Outcome: The Edit Cursor snaps to the nearest Gridline, be it on the left or the right.
Sorry for my misunderstanding if your lua script does exactly this ..:0)
|
|
|
02-21-2017, 06:28 PM
|
#4
|
Human being with feelings
Join Date: Mar 2014
Location: Phoenix, AZ
Posts: 488
|
how about this:
Script: me2beats_Move cursor to nearest grid division.lua
get here:
http://forum.cockos.com/showthread.php?t=186999
seems to do what you ask
|
|
|
02-21-2017, 11:13 PM
|
#5
|
Human being with feelings
Join Date: Jul 2012
Location: Netherlands
Posts: 5,247
|
AWESOME !
Thank you !
|
|
|
01-22-2018, 08:39 PM
|
#6
|
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
|
Is there a way to remove the nudge commands from the undo history?
I tried the trick with the empty function and defer, but the undo points are still shown
|
|
|
07-14-2019, 02:42 PM
|
#7
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
I just released a simple script:
- X-Raym_Snap edit cursor to nearest grid if snap is enabled.lua
Can be useful in custom actions :P
|
|
|
09-19-2019, 02:06 PM
|
#8
|
Human being with feelings
Join Date: Mar 2017
Location: Ukraine, Kyiv
Posts: 546
|
Quote:
Originally Posted by X-Raym
I just released a simple script:
- X-Raym_Snap edit cursor to nearest grid if snap is enabled.lua
Can be useful in custom actions :P
|
Can you make this one for MIDI editor? Can't find anything like that.
|
|
|
07-18-2020, 11:17 AM
|
#9
|
Human being with feelings
Join Date: Dec 2019
Posts: 67
|
Quote:
Originally Posted by Skorobagatko
Can you make this one for MIDI editor? Can't find anything like that.
|
It doesn't need making, it can be setup in Reaper...
Shift+?
Change the "Section" at the top right to "MIDI Editor".
Find: Misc: Pass through key to main window.
Highlight it.
Click "Add" near the bottom left.
Press whatever key combo you normally press to run the script.
Done.
|
|
|
09-09-2023, 07:39 AM
|
#10
|
Human being with feelings
Join Date: Oct 2011
Posts: 2,924
|
Quote:
X-Raym_Snap edit cursor to nearest grid if snap is enabled.lua
|
Quote:
Script: me2beats_Move cursor to nearest grid division.lua
|
Sadly, none of them work with the MIDI editor.
No solution about that?
Last edited by ovnis; 09-09-2023 at 09:52 AM.
|
|
|
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 01:19 AM.
|