|
|
|
05-20-2017, 04:18 PM
|
#1
|
Human being with feelings
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,619
|
API to set active take in MIDI editor?
In the MIDI editor, when the Track List is enabled, the icon to the right of the track color indicates whether the item on that track is set to be the target for inserted MIDI events.
How can I set this programmatically?
We have MIDIEditor_GetTake() but no MIDIEditor_SetTake() which is exactly what I want to be able to do.
I thought I had a workaround where I'd select only the take I want to activate, and then invoke command 40153 (Item: Open in built-in MIDI editor). But this is buggy: if the track of the selected item contains multiple items, then this actually activates the last item on the track of the programmatically selected item, not the actually selected item.
Any ideas?
Thanks,
Jason.
|
|
|
05-21-2017, 02:36 PM
|
#2
|
Human being with feelings
Join Date: Mar 2016
Posts: 117
|
hi! I have wrote scripting.(I attached scripts this post.)
Quote:
API to set active take in MIDI editor?
|
it may exsit other way though, I was using "reaper.SetMediaItemInfo_Value" function.
I think it will to using as combination "next midi take" and "prev midi take", that can be quick compare.
I could not testing these scripts enough, if you get unexpected results, please let me know. I will check
Last edited by kawa_; 05-21-2017 at 04:00 PM.
|
|
|
05-22-2017, 12:57 PM
|
#3
|
Human being with feelings
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,619
|
Hi kawa,
Quote:
Originally Posted by kawa_
it may exsit other way though, I was using "reaper.SetMediaItemInfo_Value" function.
|
Your example will change the take of the currently active item. I should clarify: I'd like to be able to set the active take in the MIDI editor of any item, even if the item isn't currently the one with an active take in the editor.
I ended up doing a silly kludge, which was to keep triggering the "Activate next MIDI item" action in a loop, and after each call, checking to see if the new MIDI item in the editor is the one I wanted to set.
It works well enough, but I expect this would perform poorly with a project with a large number of MIDI items. So much better would be reaper.MIDIEditor_SetTake(new_take), which is a function I imagine would exist if Reaper's API was designed rather than evolved.
Thanks!
|
|
|
05-22-2017, 03:02 PM
|
#4
|
Human being with feelings
Join Date: Mar 2016
Posts: 117
|
Hi tack
Indeed, one of weak point of my lua scripts that when process many number of items ,it will be slowing .
reaper.MIDIEditor_SetTake(new_take) , I think that function will be good.
Thanks!
|
|
|
05-23-2017, 02:44 PM
|
#5
|
Human being with feelings
Join Date: Jun 2012
Posts: 2,173
|
+1. Coordination between MIDI Editor and Arrange is not quite there yet in my opinion.
I'd like to have a simple "Activate MIDI Item Take under mouse" action.
One issue with the situation would be controlling visibility/editability of the take that gets left behind.
|
|
|
06-06-2017, 03:24 AM
|
#6
|
Human being with feelings
Join Date: Sep 2009
Posts: 863
|
Quote:
Originally Posted by tack
Hi kawa,
Your example will change the take of the currently active item. I should clarify: I'd like to be able to set the active take in the MIDI editor of any item, even if the item isn't currently the one with an active take in the editor.
I ended up doing a silly kludge, which was to keep triggering the "Activate next MIDI item" action in a loop, and after each call, checking to see if the new MIDI item in the editor is the one I wanted to set.
It works well enough, but I expect this would perform poorly with a project with a large number of MIDI items. So much better would be reaper.MIDIEditor_SetTake(new_take), which is a function I imagine would exist if Reaper's API was designed rather than evolved.
Thanks!
|
I'd just like to bump this thread in case the Dev's drop by (thanks nofish for the pointer over here...)
I could also really use a reaper.MIDIEditor_SetTake() - currently banging my head off the table trying to figure a way to do this elegantly, but failing miserably :|
Thanks for the workaround Tack, I'll give this a go later.
Rob
|
|
|
05-10-2023, 05:59 PM
|
#7
|
Human being with feelings
Join Date: Apr 2018
Posts: 515
|
MIDIEditor_SetTake()
+1
Is there a feature request on this?
|
|
|
05-10-2023, 06:25 PM
|
#8
|
Human being with feelings
Join Date: Jan 2019
Location: China
Posts: 654
|
MIDIEditor_SetActiveTake()
+1
|
|
|
07-04-2023, 05:11 AM
|
#9
|
Human being with feelings
Join Date: Dec 2019
Location: sthlm, swe
Posts: 147
|
+1 I am also trying to figure out how to set the active take. Actually, it makes sense to be able to control all parameters of the `Track List` in the MIDI Editor via the API.
|
|
|
07-04-2023, 05:32 AM
|
#10
|
Human being with feelings
Join Date: Dec 2019
Location: sthlm, swe
Posts: 147
|
Maybe it would be possible unselect and then re-select the item take which you wish to make active?
|
|
|
07-05-2023, 07:59 AM
|
#11
|
Human being with feelings
Join Date: Dec 2019
Location: sthlm, swe
Posts: 147
|
|
|
|
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:07 PM.
|