Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 06-29-2017, 11:19 AM   #1
tusitala
Human being with feelings
 
tusitala's Avatar
 
Join Date: Apr 2010
Location: London (UK)
Posts: 412
Default BUG: Map Input To channel function buggy?

Hi, I mapped buttons on my external controller to trigger the commands:
Map Input To Channel 1/2/3/4/5 etc etc and use kontakt with articulations in different channels.

but i have the feeling that this function is somehow broken, as there's a noticeable "lag" when using this switching channel...I mean pressing the button to map channel 3 for example doesn't immediately work, and if i play on my keyboard i can still hear the previous channel playing, and sometimes i need to press the button again to make it work.

sometimes i get "stuck" midi notes and have to press the "panic" button inside kontakt to go back to normal...


can you confirm it's a little buggy and maybe it could be looked at for future releases? i find it's a very handy way of switching articulations with kontakt or other multichannel vsts

thanks!
-t
tusitala is offline   Reply With Quote
Old 06-30-2017, 04:10 AM   #2
gofer
-blänk-
 
gofer's Avatar
 
Join Date: Jun 2008
Posts: 11,359
Default

These are SWS extension actions, right? Bug reports and feature requests are better placed at https://github.com/reaper-oss/sws/issues.

I did a brief test assigning buttons on my controller to a few of these actions (including channel 3) and they seem to work as intended on my end. I don't perceive much of a lag. But they are clearly not intended for switching channels on the fly while playing. To avoid hanging notes they would need to monitor the MIDI stream for notes that are active when you change the channel and remember to trigger their note-off messages on the correct channel. I don't think Reaper actions can monitor and react on a track's MIDI input.

It can most certainly be done with JS plugins. There's a good chance it already exists.

As a not so ideal workaround you could build a set of custom actions by preceeding the map-to-channel-action with "SWS/S&M: Send all notes off to selected tracks". But that would instantly stop all notes...

Last edited by gofer; 06-30-2017 at 04:17 AM.
gofer is offline   Reply With Quote
Old 06-30-2017, 03:37 PM   #3
tusitala
Human being with feelings
 
tusitala's Avatar
 
Join Date: Apr 2010
Location: London (UK)
Posts: 412
Default

Quote:
Originally Posted by gofer View Post
These are SWS extension actions, right? Bug reports and feature requests are better placed at https://github.com/reaper-oss/sws/issues.

I did a brief test assigning buttons on my controller to a few of these actions (including channel 3) and they seem to work as intended on my end. I don't perceive much of a lag. But they are clearly not intended for switching channels on the fly while playing. To avoid hanging notes they would need to monitor the MIDI stream for notes that are active when you change the channel and remember to trigger their note-off messages on the correct channel. I don't think Reaper actions can monitor and react on a track's MIDI input.

It can most certainly be done with JS plugins. There's a good chance it already exists.

As a not so ideal workaround you could build a set of custom actions by preceeding the map-to-channel-action with "SWS/S&M: Send all notes off to selected tracks". But that would instantly stop all notes...
Thank you gofer!
Actually I don't know if this function is given by SWS extensions...is it? of course i will post my requests there if it's better.

i will try adding the "send all notes off to selected tracks" command and see if that works.

i encountered not only lags but sometimes it didn't work at all...

can i ask you another thing about this, if you have the time for it?
i have my nanokontrol studio with buttons already mapped to cc32 vith values from 0 to 15...in the reaper action menu i want to assign them to "map input ti channel 1" then 2/3/4/5 etc etc until 16...
i select that action, map the command pressing the right button on my nanokontrol, and it works, but i can only map one as when i map a second one reaper pops out a message telling me i already used that cc...
i understand the cc itself is the same (cc32) for all the buttons i mapped, but the values are different...do you know why this happens?

I'm investigating JS plugins in this respect...i found a "midi channelise" that does that, but i can't understand how to map keycommands or CCs to its functions, as its parameters don't show up in the actions menu (i couldn't find them anyway)

thank you so much for your help!

all the best
-t
tusitala is offline   Reply With Quote
Old 07-01-2017, 03:55 AM   #4
gofer
-blänk-
 
gofer's Avatar
 
Join Date: Jun 2008
Posts: 11,359
Default

You're welcome

The only actions I can find to switch the track MIDI input mapping are called "SWS/S&M: Map selected tracks MIDI input to channel [n]". You can always tell SWS extension actions by the SWS prefix. S&M stands for Jeffos who wrote this particular set of (as well as lots of other) actions - he certainly has his own type of humor).


Assigning multiple actions to the same CC number but different value is unfortunately not supported by Reaper as of yet. You'd need to give your buttons individual CC numbers if you wanted to go that route.

Dark Star's MIDI Channelizer seems to be exactly what you need though and does the trick without stopping notes when you change the channel. They sound with the old channel until you lift the finger off the key, which is the ideal behavior, so I recommend to use that instead of the clunky all notes off method.

Normally JS plugins use Reaper's plugin parameter automation for controlling them via MIDI, but this particular one is different. If you hit the "Edit" button in the header of Channelizer's plugin window you get to read DarkStar's instructions on how to use this plugin (don't change stuff in that edit window if you don't know what you're doing, that's the actual code and chances are you break it)

To get it to work:
Back in the actual plugin GUI click the blue-ish edit button (the one below that big display that says "Any" or numbers from 01 to 16) twice until it says "Edit the cc number". Now you can click on the "Channel CC#..." rectangle in the middle of the GUI and drag until it shows CC# 32 (because that's what your buttons send). Click the "Edit" button again to get out of edit mode.
Now you're almost there, you want to save this setting as default preset for this plugin (click the + sign in the header).

One thing left to do:
Incoming CC32 is now used to switch between channels, but the plugin was created for a fader or knob, so the 16 channels (plus "Any" which I assume to just pass through all channel data) are distributed evenly across the 128 values. You need to find out which values switch to which channel and change your buttons accordingly. Actually, I can do that real quick right now that I have configured a slider, so here goes:

"Any": v 0-7
Ch 01: v 8-15
Ch 02: v 16-22
Ch 03: v 23-30
Ch 04: v 31-37
Ch 05: v 38-45
Ch 06: v 46-52
Ch 07: v 53-60
Ch 08: v 61-67
Ch 09: v 68-75
Ch 10: v 76-82
Ch 11: v 83-90
Ch 12: v 91-97
Ch 13: v 98-105
Ch 14: v 106-112
Ch 15: v 113-120
Ch 16: v 121-127

You can use any channel you like for your buttons, as long as they send CC32 they will switch all following MIDI to the channel spcified by the value they send.

I think it's best to insert the MIDI Channelizer in the input FX chain of the track you are recording the MIDI on (as opposed to the regular track FX chain) so that the changed MIDI data gets recorded.
gofer is offline   Reply With Quote
Old 07-01-2017, 04:36 AM   #5
tusitala
Human being with feelings
 
tusitala's Avatar
 
Join Date: Apr 2010
Location: London (UK)
Posts: 412
Default

Quote:
Originally Posted by gofer View Post
You're welcome

The only actions I can find to switch the track MIDI input mapping are called "SWS/S&M: Map selected tracks MIDI input to channel [n]". You can always tell SWS extension actions by the SWS prefix. S&M stands for Jeffos who wrote this particular set of (as well as lots of other) actions - he certainly has his own type of humor).


Assigning multiple actions to the same CC number but different value is unfortunately not supported by Reaper as of yet. You'd need to give your buttons individual CC numbers if you wanted to go that route.

Dark Star's MIDI Channelizer seems to be exactly what you need though and does the trick without stopping notes when you change the channel. They sound with the old channel until you lift the finger off the key, which is the ideal behavior, so I recommend to use that instead of the clunky all notes off method.

Normally JS plugins use Reaper's plugin parameter automation for controlling them via MIDI, but this particular one is different. If you hit the "Edit" button in the header of Channelizer's plugin window you get to read DarkStar's instructions on how to use this plugin (don't change stuff in that edit window if you don't know what you're doing, that's the actual code and chances are you break it)

To get it to work:
Back in the actual plugin GUI click the blue-ish edit button (the one below that big display that says "Any" or numbers from 01 to 16) twice until it says "Edit the cc number". Now you can click on the "Channel CC#..." rectangle in the middle of the GUI and drag until it shows CC# 32 (because that's what your buttons send). Click the "Edit" button again to get out of edit mode.
Now you're almost there, you want to save this setting as default preset for this plugin (click the + sign in the header).

One thing left to do:
Incoming CC32 is now used to switch between channels, but the plugin was created for a fader or knob, so the 16 channels (plus "Any" which I assume to just pass through all channel data) are distributed evenly across the 128 values. You need to find out which values switch to which channel and change your buttons accordingly. Actually, I can do that real quick right now that I have configured a slider, so here goes:

"Any": v 0-7
Ch 01: v 8-15
Ch 02: v 16-22
Ch 03: v 23-30
Ch 04: v 31-37
Ch 05: v 38-45
Ch 06: v 46-52
Ch 07: v 53-60
Ch 08: v 61-67
Ch 09: v 68-75
Ch 10: v 76-82
Ch 11: v 83-90
Ch 12: v 91-97
Ch 13: v 98-105
Ch 14: v 106-112
Ch 15: v 113-120
Ch 16: v 121-127

You can use any channel you like for your buttons, as long as they send CC32 they will switch all following MIDI to the channel spcified by the value they send.

I think it's best to insert the MIDI Channelizer in the input FX chain of the track you are recording the MIDI on (as opposed to the regular track FX chain) so that the changed MIDI data gets recorded.

Dear gofer,
You're a star! thank you so much!!!

Actually i didn't know about DarkStar's Midi channelizer, but i will try that now! what i was trying to use is this one: http://thepiz.org/plugins/?p=pizmidi

Anyway I'll follow your thorough indications and see how it goes...
from what i read my only gripe would be that i have to remap my nanokontrol buttons so that their values are within those ranges you suggested...but i mapped them with incremental values because on my VSL tracks i use another plugin that converts them to Program Changes, which allows me to navigate through VSL presets...
So i was trying to find a consistent way of having one mapping and different plugins for different tracks (i only use two types of tracks in my template...VSL with program changes and Kontakt with multichannel articulations)

Do you see any way i could get to this result? is there a way to make the channelizer to react to incremental values instead of ranges?

anyway...THANK YOU SO MUCH!!!

all the best
-t
tusitala is offline   Reply With Quote
Old 07-01-2017, 05:36 AM   #6
gofer
-blänk-
 
gofer's Avatar
 
Join Date: Jun 2008
Posts: 11,359
Default

Ah, InsertPizHere, I always forget about this great source for almost any MIDI need. That plugin seems to work as well, just without all the other bells and whistles DarkStar included to his one.
In that one you'd learn the plugin parameter "Channel" to your desired CC (click the "Param" button in the header to get to the learn feature, channel is the only parameter this plugin offers). But it has a similar behavior as DarkStar's MIDI Channelizer in terms of value ranges.

I was thinking about this one: http://forum.cockos.com/showthread.php?t=147684

Quote:
Originally Posted by tusitala View Post
Do you see any way i could get to this result? is there a way to make the channelizer to react to incremental values instead of ranges?

I am pretty sure that the JS plugin can be tweaked to your liking. Don't be shy and send DarkStar a PM with your request. He's a very fine guy and I'll be astonished if he won't help you out with a special tusitala version of the channelizer if he sees your question and has a bit of time left to burn away.

Failing that it would also be possible to write a little JS plugin which just remaps your CC32 values 0-15 to the values the channelizer needs and insert it it in the FX chain before the channelizer. That should be very straightforward, just a couple of lines of code someone with a clue could pull off within less than a minute. Alas, I don't have much of a clue regarding JS scripting, so it would take me longer (on the other hand, weather is shitty, ideal for a bit of time spent in my closet solving a little script riddle, so maybe the next coffee pulls me right in ).
gofer is offline   Reply With Quote
Old 07-01-2017, 08:39 AM   #7
gofer
-blänk-
 
gofer's Avatar
 
Join Date: Jun 2008
Posts: 11,359
Default

Ok, it wasn't the very next coffee, but the weather is still ugly, so I had a look. Turned out that tweaking DarkStar's plugin was even easier and more straightforward than writing a helper plugin.
I changed it so that values 0-15 of the channel switching CC number will switch to channels 1-16 and any value above that switches to "Any". I also changed the default channel switching CC number to 32, just because it was so easy, you can still change that CC number if you need to. Everything else (**knocks on wood**) should still be working as in the original version.

I am certain that DarkStar won't mind me uploading the altered version for you. I did PM him for permission, but he's offline at the moment, so I'll just attach the edited code and pull it again if he has any issues with it.

The attached text file won't look right without the DS_files folder in the same directory (although it's just defining various colors). So you need to put it into exactly the same directory as the original Channelizer_DS file (probably [your Reaper User data directory] / Effects / MIDI). They will live happily next to each other without interference. Not sure which OS you are using, but at least in Windows you can just delete the .txt extension if you like (it doesn't hurt if you don't, either). I needed it only to be able to attach it to a forum post.

Thanks for that little brain twister, I just needed that little distraction on a grey summer day Hope it works out nicely.
Attached Files
File Type: txt Channelizer_DS_tusitala version.txt (32.1 KB, 203 views)
gofer is offline   Reply With Quote
Old 07-01-2017, 09:27 AM   #8
tusitala
Human being with feelings
 
tusitala's Avatar
 
Join Date: Apr 2010
Location: London (UK)
Posts: 412
Default

Quote:
Originally Posted by gofer View Post
Ok, it wasn't the very next coffee, but the weather is still ugly, so I had a look. Turned out that tweaking DarkStar's plugin was even easier and more straightforward than writing a helper plugin.
I changed it so that values 0-15 of the channel switching CC number will switch to channels 1-16 and any value above that switches to "Any". I also changed the default channel switching CC number to 32, just because it was so easy, you can still change that CC number if you need to. Everything else (**knocks on wood**) should still be working as in the original version.

I am certain that DarkStar won't mind me uploading the altered version for you. I did PM him for permission, but he's offline at the moment, so I'll just attach the edited code and pull it again if he has any issues with it.

The attached text file won't look right without the DS_files folder in the same directory (although it's just defining various colors). So you need to put it into exactly the same directory as the original Channelizer_DS file (probably [your Reaper User data directory] / Effects / MIDI). They will live happily next to each other without interference. Not sure which OS you are using, but at least in Windows you can just delete the .txt extension if you like (it doesn't hurt if you don't, either). I needed it only to be able to attach it to a forum post.

Thanks for that little brain twister, I just needed that little distraction on a grey summer day Hope it works out nicely.


Dear gofer...I have no words :-) THANK YOU VERY VERY VERY MUCH!!!
You have been unbelievably kind! I just quickly tested and everything works perfectly!
I also didn't even know about "input FX chains" as opposed to normal inserts, you made me discover this new (for me) feature as well!
here's a picture of my nerdy happiness :



I have verified that it all works perfectly when live recording...when step inputting in the score or piano roll, even if i hear the articulations i select (that are on different channels) everything gets written as channel 1 anyway regardless of what i choose...but this is the normal behaviour that i see every other program (Logic and DP) has as well and couldn't find a solution to this, but maybe it's just the nature of things and i should just accept it...i don't have any knowledge that would help investigate further.
If you have any insight about it let me know...


anyway...i wish i could buy you a beer now! :-)

THANKS THANKS THANKS!

all the best!
-t
tusitala is offline   Reply With Quote
Old 07-01-2017, 09:51 AM   #9
tusitala
Human being with feelings
 
tusitala's Avatar
 
Join Date: Apr 2010
Location: London (UK)
Posts: 412
Default

...and of course...THANKS DARKSTAR!!! :-)
tusitala is offline   Reply With Quote
Old 07-01-2017, 01:23 PM   #10
gofer
-blänk-
 
gofer's Avatar
 
Join Date: Jun 2008
Posts: 11,359
Default

Great to hear that Glad I could help and have fun along the way.

I confirm the step input behavior when using "MIDI inputs as step input mode".
I find it quite weird that it ignores the channel mapping even when it takes place on the input FX chain and like you I'd expect it to obey the track's channel mapping as well. Also, I would have thought that step input would obey "Set channel for new events to [nn]", but it ignores that setting, too. Using "F1 - F12 as step input mode" the "new events channel" is being obeyed.

MIDI input step recording seems to have it's own way of catching the MIDI data stream, circumventing the track input entirely (including the "map to channel" setting and any input FX). You can tell that by the fact that you don't even need a MIDI input specified on the track and the track doesn't need to be record armed. As long as the MIDI editor has focus it will catch all notes on any MIDI input port that's enabled in preferences (plus the virtual midi keyboard).

Seems that this implementation must be good for something, but it should still be possible to (optionally) at least use the channel specified as "channel for new events" to remap the incoming channel data so the resulting notes match that setting. That's something only the devs can solve, I'm afraid . Although, I have learned otherwise on many occasions already.

Only way around I'd see would be to map the channels in an additional MIDI-pre-processing application and send the altered data to Reaper via a virtual MIDI port. You can control that application with your Nanocontrol buttons, but maybe it would clash with your VSL control method. Myself I use a small thing I cobbled up in Max to interfere with the MIDI from and to my shiny new Novation Impulse. Mainly to get the rotary encoders to actually send relative CC outside of automap (curse you, Novation), but it allows for a lot of other stuff and is still growing. What's making this relevant here is that Novation's implementation forced me to skip the Impulse's own channel selection and realize it in Max as well, but my implementation lacks the graceful handling of note-offs. Maybe I can get behind what DarkStar does there and recreate that in Max somehow? If not I will probably use DarkStar's plugin as a default input plugin on my MIDI tracks. In any case I've got something good out of it, too, so you deserve a beer as well

I must say that I quite enjoy to switch channels with dedicated buttons right at the keyboard and stay on a single track. I like the directness of this approach. Feels better than the rotary I used for it. The Impulse has only 9 buttons, but that template is definitely a keeper to experiment with. Thank you.
gofer is offline   Reply With Quote
Old 07-02-2017, 08:18 AM   #11
tusitala
Human being with feelings
 
tusitala's Avatar
 
Join Date: Apr 2010
Location: London (UK)
Posts: 412
Default

Quote:
Originally Posted by gofer View Post
That's something only the devs can solve, I'm afraid . Although, I have learned otherwise on many occasions already.
Yeah, let's hope that this could be implemented...do you think we could make a feature request? or is it something that could be developed as an extension by the "extension guys" :-) ?
as i wrote already...Logic has the same behaviour...so it might be something inherent to the whole midi protocol...but then again Reaper is the most beautiful piece of software in the world so we might as well have a little faith and maybe someday someone will come up with a solution.


I'm happy my request made you find a new or different way of switching articulations!

I always used this multichannel method...
I started using it because i had an m-audio oxygen midi controller that allowed to switch the out coming channel with two buttons on the keyboard itself...that was the best because it worked for step input as well...but now i don't have that keyboard anymore and wanted to find a "software solution" to recreate this workflow.

I find it brilliant (at least for my workflow and for the way i set up my orchestral template) because it doesn't need "chase", and it allows for multiple articulations at the same time within the same track (for example both Legato and sordinos in the same violins track).
And you can choose to show notes colors based on their channels so that's really easy to have a visual feedback of what's playing.

Here's another tip: i put a script inside kontakt (but i'm sure we can as well use a script in the reaper insert fx) that routes all CCs to channel 1...this means that even if you are playing an articulation that's on channel 6 (let's say Tremolos), you can still control and record it's dynamics with the mod wheel on channel one...this way the dynamics will be consistent on all the articulations and you wouldn't need to map the controllers to all the other channels :-)

hope this helps :-)
tusitala is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:06 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.