|
|
|
04-30-2017, 02:21 AM
|
#1
|
Human being with feelings
Join Date: Nov 2008
Location: London, UK
Posts: 2,583
|
REQ: De-select last selected item
Hey guys, is it possible to write a script that de-selects the last selected item within an item selection across tracks, ignoring grouping?
Example, I'm editing multitrack drums. They are grouped (vertically) and occasionally I want to edit the position of just the first 1 or 2 items (kick drum mics).
A script that deselected the last selected item (shrinks selection) could be used in multiple instances in a custom action.
Alternatively, I'd be happy with a script that changes the selection of items to only the first 2 (or 1) items.
Any thoughts?
Cheers for reading!
All the best,
Last edited by daxliniere; 04-30-2017 at 02:54 AM.
|
|
|
04-30-2017, 02:25 AM
|
#2
|
Human being with feelings
Join Date: Nov 2008
Location: London, UK
Posts: 2,583
|
I suppose this could also be achieved through an adaption of SWS: Select Next Item (across tracks). That action selects the next item on the same track, rather than the next item on the track below.
|
|
|
04-30-2017, 02:30 AM
|
#3
|
Human being with feelings
Join Date: Nov 2008
Location: London, UK
Posts: 2,583
|
Haha, it could also be done with an adaptation of the native action Item navigation: Select and move to item in next track without changing track selection
That action successfully selects the item below, but deselects the first selected item.
|
|
|
04-30-2017, 02:35 AM
|
#4
|
Human being with feelings
Join Date: Nov 2008
Location: London, UK
Posts: 2,583
|
Okay, I think I've got it with a fairly convoluted custom action, but a dedicated script could be quite handy for other things.
|
|
|
09-11-2017, 05:19 PM
|
#5
|
Human being with feelings
Join Date: Jun 2012
Posts: 2,173
|
Script: FnA_Unselect First Selected Item.lua
Script: FnA_Unselect Last Selected Item.lua
are now in ReaPack. Thanks X-Raym and cfillion for help!
Also:
Script: FnA_Ensure toggle ON (item grouping).lua
Script: FnA_Ensure toggle OFF (item grouping).lua
|
|
|
09-12-2017, 02:12 AM
|
#6
|
Human being with feelings
Join Date: Nov 2008
Location: London, UK
Posts: 2,583
|
Woowoo!
|
|
|
12-02-2017, 11:23 AM
|
#7
|
Human being with feelings
Join Date: Oct 2016
Location: Spain
Posts: 324
|
Hello FnA. I'm trying to use your "Ensure toggle" scripts in midi editor, but I can't get them to do what I want.
View: toggle show velocity handles on notes (ID 40040)
View: toggle show velocity numbers on notes (ID 40632)
I want a Custom action that hide velocity handles and show velocity numbers. What I have done is:
I paste "40040" in your Ensure toggle off script, and rename it.
I paste "40632" in your Ensure toggle on script, and rename it.
I make a custom action with those two actions. The custom action does not work. And neither the new "ensure toggle" scripts individually.
Why?
|
|
|
12-02-2017, 02:16 PM
|
#8
|
Human being with feelings
Join Date: Jun 2012
Posts: 2,173
|
Hm, that's a bit of a problem isn't it. That action was only meant for use in the Main Section of the Action List. Well, until I figure out what, if anything, to do for ReaPack, I'll make 2 examples here for use in the regular MIDI Editor. I don't see any toggle "state" being reported for any actions in the Inline MIDI Editor Action List, and I don't know how to trigger a Media Explorer action. So, regular MIDI editor only.
It requires a somewhat obscure integer to point to the other sections of the list. I had to be told about them by Jeffos, lol. And different functions too.
Code:
-- Description: Ensure toggle ON - MIDI Editor (velocity numbers on notes)
-- User Variables ---------------------------------
local Command_ID = "40632" -- Paste Command ID from Action List between quotes SWS example:"_BR_ME_TOGGLE_HIDE_ALL_NO_LAST_CLICKED"
local islistviewcommand = false -- true for Event List, false for Piano Roll
-- End of User Variables --------------------------
local section_id = 32060 --0/100=main/main alt, 32063=media explorer, 32060=midi editor, 32061=midi event list editor, 32062=midi inline editor)
local r = reaper
local x = tonumber(Command_ID)
if x then -- REAPER factory actions
if r.GetToggleCommandStateEx(section_id, x) == 0 then
r.MIDIEditor_LastFocused_OnCommand(x, islistviewcommand)
end
else -- SWS actions
local x = r.NamedCommandLookup(Command_ID)
if r.GetToggleCommandStateEx(section_id, x) == 0 then
r.MIDIEditor_LastFocused_OnCommand(x, islistviewcommand)
end
end
function noundo() end
r.defer(noundo)
Code:
-- Description: Ensure toggle OFF - MIDI Editor (velocity handles on notes)
-- User Variables ---------------------------------
local Command_ID = "40040" -- Paste Command ID from Action List between quotes SWS example:"_BR_ME_TOGGLE_HIDE_ALL_NO_LAST_CLICKED"
local islistviewcommand = false -- true for Event List, false for Piano Roll
-- End of User Variables --------------------------
local section_id = 32060 --0/100=main/main alt, 32063=media explorer, 32060=midi editor, 32061=midi event list editor, 32062=midi inline editor)
local r = reaper
local x = tonumber(Command_ID)
if x then -- REAPER factory actions
if r.GetToggleCommandStateEx(section_id, x) == 1 then
r.MIDIEditor_LastFocused_OnCommand(x, islistviewcommand)
end
else -- SWS actions
local x = r.NamedCommandLookup(Command_ID)
if r.GetToggleCommandStateEx(section_id, x) == 1 then
r.MIDIEditor_LastFocused_OnCommand(x, islistviewcommand)
end
end
function noundo() end
r.defer(noundo)
Last edited by FnA; 12-02-2017 at 09:39 PM.
|
|
|
12-02-2017, 06:21 PM
|
#9
|
Human being with feelings
Join Date: Oct 2016
Location: Spain
Posts: 324
|
Fine, it works. I only need to operate in midi editor. Thanks a lot.
|
|
|
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 07:20 PM.
|