|
|
|
11-08-2018, 11:17 AM
|
#1
|
Human being with feelings
Join Date: Feb 2017
Location: Stockholm
Posts: 98
|
Ruler that follow mouse
I need a ruler that follow the mouse, for split/cut item edits.
Is this possible to script, or theme?
|
|
|
11-11-2018, 01:56 PM
|
#2
|
Human being with feelings
Join Date: Aug 2009
Location: Sweden
Posts: 70
|
This Lua script makes the edit cursor follow the mouse. Could that work? Select "Terminate instance" when you run the script again to be able to toggle on/off.
Code:
function main()
reaper.BR_GetMouseCursorContext()
local pos = reaper.BR_GetMouseCursorContext_Position()
if pos > -1 then
reaper.SetEditCurPos2(0, pos, false, false)
end
reaper.defer(main)
end
function exit()
local is_new_value,filename,sectionID,cmdID,mode,resolution,val = reaper.get_action_context()
reaper.SetToggleCommandState(sectionID, cmdID, 0)
reaper.RefreshToolbar2(sectionID, cmdID)
end
local is_new_value,filename,sectionID,cmdID,mode,resolution,val = reaper.get_action_context()
reaper.SetToggleCommandState(sectionID, cmdID, 1)
reaper.RefreshToolbar2(sectionID, cmdID)
reaper.atexit(exit)
main()
|
|
|
11-12-2018, 01:19 PM
|
#3
|
Human being with feelings
Join Date: Feb 2017
Location: Stockholm
Posts: 98
|
Quote:
Originally Posted by ThomasE
This Lua script makes the edit cursor follow the mouse. Could that work? Select "Terminate instance" when you run the script again to be able to toggle on/off.
Code:
function main()
reaper.BR_GetMouseCursorContext()
local pos = reaper.BR_GetMouseCursorContext_Position()
if pos > -1 then
reaper.SetEditCurPos2(0, pos, false, false)
end
reaper.defer(main)
end
function exit()
local is_new_value,filename,sectionID,cmdID,mode,resolution,val = reaper.get_action_context()
reaper.SetToggleCommandState(sectionID, cmdID, 0)
reaper.RefreshToolbar2(sectionID, cmdID)
end
local is_new_value,filename,sectionID,cmdID,mode,resolution,val = reaper.get_action_context()
reaper.SetToggleCommandState(sectionID, cmdID, 1)
reaper.RefreshToolbar2(sectionID, cmdID)
reaper.atexit(exit)
main()
|
Thank you Thomas! Brilliant! Works like a charm, closest thing to editing in Samp.
ToggleArm next action, split item, followed with this script is exactly what i needed.
Tack igen!
|
|
|
11-12-2018, 02:40 PM
|
#4
|
Human being with feelings
Join Date: Aug 2009
Location: Sweden
Posts: 70
|
Quote:
Originally Posted by Jonas Ekstrom
Thank you Thomas! Brilliant! Works like a charm, closest thing to editing in Samp.
ToggleArm next action, split item, followed with this script is exactly what i needed.
Tack igen!
|
Strålande!
|
|
|
11-13-2018, 12:08 AM
|
#5
|
Human being with feelings
Join Date: Oct 2009
Location: France
Posts: 743
|
very cool, thank you Thomas.
|
|
|
11-14-2018, 06:29 AM
|
#6
|
Human being with feelings
Join Date: Nov 2009
Location: Belgium
Posts: 10,474
|
if you want to just split item at mouse cursor, there's an action for this (40746)
Or, you place the action "split item" in a toolbar and you're right clicking the icon to "load" the action into mouse click
|
|
|
11-14-2018, 08:36 AM
|
#7
|
Human being with feelings
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
|
Quote:
Originally Posted by Reno.thestraws
Or, you place the action "split item" in a toolbar and you're right clicking the icon to "load" the action into mouse click
|
You can do that from custom action using Arm action, something like,
Action: Arm next action
Item: Split item under mouse cursor
...
|
|
|
11-14-2018, 10:00 AM
|
#8
|
Human being with feelings
Join Date: May 2018
Location: Los Angeles
Posts: 1,719
|
Thanks ThomasE... this is going right into my toolbox!
Cheers!
__________________
Cheers... Andrew K
Reaper v6.80+dev0621 - June 21 2023 • Catalina • Mac Mini 2020 6 core i7 • 64GB RAM • OS: Catalina • 4K monitor • RME RayDAT card with Sync Card and extended Light Pipe.
|
|
|
11-14-2018, 10:46 AM
|
#9
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 4,596
|
I think the point of his request is to see where is the cut going to be (like cubase where there is a line following cursor). I think I could make something like that but does not move edit cursor around but have a line that follows mouse cursor all the time (again cubase/studio one like) so you can use split item at mouse cursor with it.I've had this idea script before but if its defered updating edit cursor position all the time hits cpu hard
|
|
|
11-14-2018, 03:34 PM
|
#10
|
Human being with feelings
Join Date: May 2018
Location: Los Angeles
Posts: 1,719
|
Quote:
Originally Posted by Sexan
I think the point of his request is to see where is the cut going to be (like cubase where there is a line following cursor). I think I could make something like that but does not move edit cursor around but have a line that follows mouse cursor all the time (again cubase/studio one like) so you can use split item at mouse cursor with it.I've had this idea script before but if its defered updating edit cursor position all the time hits cpu hard
|
Yeah... I think having a Reaper option of Crosshairs instead of the mouse would be a good one.
__________________
Cheers... Andrew K
Reaper v6.80+dev0621 - June 21 2023 • Catalina • Mac Mini 2020 6 core i7 • 64GB RAM • OS: Catalina • 4K monitor • RME RayDAT card with Sync Card and extended Light Pipe.
|
|
|
11-14-2018, 03:59 PM
|
#11
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
|
Quote:
Originally Posted by Sexan
I think the point of his request is to see where is the cut going to be (like cubase where there is a line following cursor). I think I could make something like that but does not move edit cursor around but have a line that follows mouse cursor all the time (again cubase/studio one like) so you can use split item at mouse cursor with it.I've had this idea script before but if its defered updating edit cursor position all the time hits cpu hard
|
Can you make this perhaps?
https://forum.cockos.com/showpost.ph...20&postcount=3
|
|
|
11-14-2018, 05:04 PM
|
#12
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 4,596
|
Quote:
Originally Posted by nofish
|
Absolutely
|
|
|
11-15-2018, 01:14 AM
|
#13
|
Human being with feelings
Join Date: Feb 2017
Location: Stockholm
Posts: 98
|
Quote:
Originally Posted by Sexan
I think the point of his request is to see where is the cut going to be (like cubase where there is a line following cursor). I think I could make something like that but does not move edit cursor around but have a line that follows mouse cursor all the time (again cubase/studio one like) so you can use split item at mouse cursor with it.I've had this idea script before but if its defered updating edit cursor position all the time hits cpu hard
|
Exactly this! A line would be great, I've noticed that moving the edit cursor around is a little bit laggy, not much though, it definitely works for now.
But a line that follows mouse would be great too.
One of the things I like with having the edit ruler follow mouse is I can easily play/stop and quickly find the right place for the cut. It's just how I did it in Samplitude.
|
|
|
11-15-2018, 07:11 AM
|
#14
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 4,596
|
Quote:
Originally Posted by nofish
|
fishy is this cool or you need all the info like in that script (note position,length etc) and bigger text?
|
|
|
11-15-2018, 07:45 AM
|
#15
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
|
I wasn't sure if you were kidding or not tbh.
Wanted this since I first saw it (five years ago lol).
My old thread:
https://forum.cockos.com/showthread.php?t=132920
Great work! Thanks so much.
This is already stunning, but since you ask...
Position would be nice too (so I don't have to look up at the ruler), Note length unnecessary (as I see that anyway when drawing notes), also note number wouldn't be necessary for me, note name only (e.g. C2, C3 etc.) is fine. Text size seems fine here too.
Thanks again.
Last edited by nofish; 12-06-2018 at 09:57 AM.
|
|
|
11-15-2018, 07:52 AM
|
#16
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 4,596
|
position in time/beat/qn ?
Edit : beats?
I've rounded to two decimals since it has 29
Code:
local oct_tbl = {"C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"}
function round(num, numDecimalPlaces)
local mult = 10^(numDecimalPlaces or 0)
return math.floor(num * mult + 0.5) / mult
end
function main()
local x,y = reaper.GetMousePosition()
local window, segment, details = reaper.BR_GetMouseCursorContext()
if segment == "notes" and window == "midi_editor" then
local retval, inlineEditor, noteRow, ccLane, ccLaneVal, ccLaneId = reaper.BR_GetMouseCursorContext_MIDI()
local pos = reaper.BR_GetMouseCursorContext_Position()
local retval, measures, cml, fullbeats, cdenom = reaper.TimeMap2_timeToBeats( 0, pos )
local beats = retval + 1
local oct = math.floor(noteRow / 12) -- get OCTAVE (1,2,3,4....)
local cur_oct = oct * 12 -- GET OCAVE RANGE (12,24,36...)
local cur_oct_note = ((cur_oct - noteRow ) * -1) + 1 -- GET OCTAVE NOTE (1,2,3,4...)
for i = 1,#oct_tbl do
if i == cur_oct_note then
local note = oct_tbl[i] .. oct - 1 .. " - " .. measures + 1 .. "." .. round(beats, 2)
if last_x ~= x or last_y ~= y then -- DO NOT UPDATE ALL THE TIME, JUST IF MOUSE POSITION CHANGED
reaper.TrackCtl_SetToolTip( note, x, y - 25, true ) -- MOVE IT 25 PIXELS ABOVE CURSOR
last_x, last_y = x, y
end
end
end
end
reaper.defer(main)
end
main()
It will be on ReaPack soon
Last edited by Sexan; 11-15-2018 at 08:12 AM.
|
|
|
11-15-2018, 08:12 AM
|
#17
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
|
Not wanting to go over the top but I actually quite like the 16th time format.
https://forum.cockos.com/showpost.ph...08&postcount=7
But if that's too much hassle (or seems to uncommon) yes, time/beat/qn is fine too.
edit:
You can disregard, crosspost with yours above.
|
|
|
11-15-2018, 08:13 AM
|
#18
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 4,596
|
Ok, let me just change to that (code above is in measure/beats).
btw tick is QN ?
edit: Confused with all the time values haha is this above ok it follows transport values, is that what you want (or something is missing)? (I'm not a midi guy )
Last edited by Sexan; 11-15-2018 at 08:20 AM.
|
|
|
12-06-2018, 05:55 AM
|
#19
|
Human being with feelings
Join Date: Mar 2018
Location: Cologne
Posts: 1,362
|
Sexan,
do you still work on the vertical line drawing or is it kind of obsolete? I just wonder because this thread seemed to be all about that and ended up with the MIDI editor mouse over infos.
greetings
ELi
Last edited by Eliseat; 12-06-2018 at 06:51 AM.
|
|
|
12-06-2018, 06:18 AM
|
#20
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
|
Quote:
Originally Posted by Eliseat
Sexan,
do you still work on the vertical line drawing or is it kind of obsolete? I just wonder because this thread seemed to be all about that and ended up with the MIDI editor mouse over infos. :cunfused:
greetings
ELi
|
Noted. It wasn't good style posting my request here, sorry.
|
|
|
03-31-2020, 05:37 AM
|
#21
|
Human being with feelings
Join Date: Nov 2018
Location: Montreal
Posts: 405
|
This script in combination with the custom action is great! Is there any way to have it work with the ALT key as a modifier instead of a toggle? I can't see how.
Cheers!
Last edited by fbeauvaisc; 03-31-2020 at 09:01 AM.
|
|
|
03-31-2020, 11:34 AM
|
#22
|
Human being with feelings
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
|
I used this behaviour in Samplitude all the time. Now I have the Z key bound to the action View: Move edit cursor to mouse cursor (no snapping) so I can move it whenever I need (probably hundreds of times a day).
|
|
|
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:26 PM.
|