|
|
|
09-20-2018, 12:06 PM
|
#1
|
Human being with feelings
Join Date: Jun 2011
Location: Sweden
Posts: 46
|
Make MIDI channel input mapping available as actions
Hi!
I have nice little feature request that's hopefully not that time consuming to implement. It would be awesome to have "Map input to channel", from the MIDI input menu, available as actions so we can bind them to shortcuts. It would be a nice way to switch between MIDI channels quickly.
Cheers!
|
|
|
09-20-2018, 09:28 PM
|
#2
|
Human being with feelings
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
|
SWS/S&M: Set selected tracks MIDI input to channel X
|
|
|
09-21-2018, 05:54 AM
|
#3
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
|
Quote:
Originally Posted by mpl
SWS/S&M: Set selected tracks MIDI input to channel X
|
I suggested OP to request for native actions as the SWS ones seem to give trouble.
https://forum.cockos.com/showpost.ph...postcount=2477
|
|
|
09-21-2018, 06:47 AM
|
#4
|
Human being with feelings
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
|
My bad. I firstly posted lua code using native API, then found SWS action.
|
|
|
09-21-2018, 06:54 AM
|
#5
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
|
Quote:
Originally Posted by mpl
My bad. I firstly posted lua code using native API, then found SWS action.
|
We can do this via native API? (I looked and didn't find anything.)
This may then be an alternative to chunk manipulation SWS uses currently.
|
|
|
09-21-2018, 11:05 AM
|
#6
|
Human being with feelings
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
|
Code:
MIDIInput = 6
for i = 1, reaper.CountSelectedTracks(0) do
local tr = reaper.GetSelectedTrack(0,i-1)
local RecInput = reaper.GetMediaTrackInfo_Value( tr, 'I_RECINPUT' )
local isMIDI = RecInput&4096 ==4096
if isMIDI then
local cur_MIDIInput = RecInput&31
reaper.SetMediaTrackInfo_Value( tr, 'I_RECINPUT' , RecInput - cur_MIDIInput + MIDIInput)
end
end
Last edited by mpl; 09-21-2018 at 01:55 PM.
|
|
|
09-21-2018, 01:20 PM
|
#7
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
|
Thanks. Missed this in the API doc.
|
|
|
09-21-2018, 02:22 PM
|
#8
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
|
On checking your script more closely, this seems to set the input channel right ?
What's requested here though is the ' Map input to channel' functionality.
For this we don't have an API way as far as I could see or do we?
|
|
|
09-21-2018, 03:17 PM
|
#9
|
Human being with feelings
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
|
Sorry!
Yes, it is 'MIDI_INPUT_CHANMAP' variable and there is no way to change it from API without chunking.
So
Code:
MIDI_MapInput = 15 -- from 0 to 15
for i = 1, reaper.CountSelectedTracks(0) do
local tr = reaper.GetSelectedTrack(0,i-1)
local ret, chunk = reaper.GetTrackStateChunk(tr, '',true)
if chunk:match('MIDI_INPUT_CHANMAP') then
chunk = chunk:gsub('MIDI_INPUT_CHANMAP%s%d+', 'MIDI_INPUT_CHANMAP '..MIDI_MapInput)
else
chunk = chunk:gsub('NAME', 'MIDI_INPUT_CHANMAP '..MIDI_MapInput..'\nNAME')
end
reaper.SetTrackStateChunk(tr, chunk,true)
end
|
|
|
09-21-2018, 03:46 PM
|
#10
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
|
Thanks for confirming.
Chunking (I like that word ) is also what SWS uses currently.
https://github.com/reaper-oss/sws/bl...rack.cpp#L1038
and which seems to give problems for OP (I imagine when having to parse through a lot of tracks with large track chunks could lead to short freeze as he mentions).
So we're back to the original FR:
Either native actions or a way via API (without chunking) to set input channel mapping would be nice.
Last edited by nofish; 09-21-2018 at 09:20 PM.
|
|
|
04-27-2020, 01:28 PM
|
#11
|
Human being with feelings
Join Date: Oct 2018
Posts: 26
|
Quote:
Originally Posted by nofish
[...]
So we're back to the original FR:
Either native actions or a way via API (without chunking) to set input channel mapping would be nice.
|
Please developers, please consider implementing a way that allows "map (all) MIDI input to MIDI channel #" natively.
This would be immensely helpful, because when working with large templates or tracks with several sample library instrument articulations loaded, currently Reaper freezes for several seconds while scripts/SWS actions achieve the channel mapping in a hacky way.
If a MIDI device doesn't allow for MIDI output channel selection (or if it is a cumbersome feat), such a feature could come quite handy.
|
|
|
04-27-2020, 08:41 PM
|
#12
|
Human being with feelings
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
|
As temporary workaround - maybe ix/MIDI_Router JSFX help?
|
|
|
04-29-2020, 06:56 PM
|
#13
|
Human being with feelings
Join Date: Oct 2018
Posts: 26
|
Quote:
Originally Posted by mpl
As temporary workaround - maybe ix/MIDI_Router JSFX help?
|
Thank you for the good suggestion! It gave me an idea for a solution that might be convenient, perhaps even for other users. As soon as I get it to work properly, I will post details.
|
|
|
05-11-2020, 07:45 AM
|
#14
|
Human being with feelings
Join Date: Oct 2018
Posts: 26
|
As promised, I return with something I created for my purpose and want to share it as it might help others with similar problems.
For the time being one can freely use and modify my Knob GUI Lua script to quickly change MIDI in/out channel-mapping for the currently selected track until there is a better solution, perhaps natively implemented.
See my forum post for the Lua script:
https://forum.cockos.com/showthread....42#post2285942
Thanks mpl for the suggestion!
|
|
|
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:31 PM.
|