Old 01-05-2012, 06:33 PM   #1
reddiesel41264
Human being with feelings
 
reddiesel41264's Avatar
 
Join Date: Jan 2012
Location: North East UK
Posts: 493
Default Multi Channel MIDI Keyswitch

Hello,

I'm new here. I came to reaper about 3 days ago when I got sick of Cubase's inflexibilities.

I think I am a convert, but still experimenting

Any-hoo I was using Bidule's keyswitch module to switch channels on a multitimbral VSTi and I figured I'd check out this JS script business and see if I could knock something together that would do the same thing and wouldn't require me to load Bidule.

After getting my head around this little scripting language I have put together a script that seems to do the job.
You can select a seperate keyswitch for each channel and all incoming MIDI data will be routed to the channel that you select, until another keyswitch key is pressed.


If you find any bugs let me know

Link:-
https://stash.reaper.fm/v/11328/Multi...DI%20Keyswitch

Hope some of you find this useful.
__________________
http://librewave.com - Freedom respecting instruments and effects
http://xtant-audio.com/ - Purveyor of fine sample libraries (and Kontakt scripting tutorials)

Last edited by reddiesel41264; 01-06-2012 at 07:23 AM. Reason: v1.1 Keys now numbered correctly
reddiesel41264 is offline   Reply With Quote
Old 01-06-2012, 01:48 PM   #2
stephane
Human being with feelings
 
Join Date: May 2010
Location: France
Posts: 97
Default

Hello David

Very useful.

However I found a problem with EWQLSO Gold.

This is how to reproduced the problem:

With one instance of Play:
Channel 1: choose 18V Butter Legato
Channel 2: choose 18V Pizz

Set up a KS on C2 key for channel 1
Set up a KS on D2 key for channel 2

Play a note (C4 for example) on keyboard with Butter Legato patch.
Then press D2 to switch to Pizz patch but without releasing the C4 note.

Butter Legato is still playing although Pizz patch is selected

If you play a new note, pizzicato is ok, but the first C4 note (in my example with butter legato) is always here

Hope this will help you (in despite of my bad english )

Thanks for the script.
stephane is offline   Reply With Quote
Old 01-06-2012, 01:59 PM   #3
reddiesel41264
Human being with feelings
 
reddiesel41264's Avatar
 
Join Date: Jan 2012
Location: North East UK
Posts: 493
Default

Glad you're finding it useful. It should be an easy problem to solve, I'll look into it when I get the chance

Until then, maybe just press one keyswitch at a time?
__________________
http://librewave.com - Freedom respecting instruments and effects
http://xtant-audio.com/ - Purveyor of fine sample libraries (and Kontakt scripting tutorials)
reddiesel41264 is offline   Reply With Quote
Old 01-07-2012, 07:23 AM   #4
KevinW
Human being with feelings
 
KevinW's Avatar
 
Join Date: Sep 2009
Location: Dayton, Ohio USA
Posts: 1,714
Default

Quote:
Originally Posted by reddiesel41264 View Post
Glad you're finding it useful. It should be an easy problem to solve, I'll look into it when I get the chance

Until then, maybe just press one keyswitch at a time?
Three days in and you're already generating this kind of thing? Fantastic! Thanks!

I suggest you post a link to this in the tips and tricks section. Too many great ideas seem to get overlooked in the scripting forum.

BTW, welcome to reaperville.
KevinW is offline   Reply With Quote
Old 01-07-2012, 07:27 AM   #5
reddiesel41264
Human being with feelings
 
reddiesel41264's Avatar
 
Join Date: Jan 2012
Location: North East UK
Posts: 493
Default

Thanks! I shall post a link there.
__________________
http://librewave.com - Freedom respecting instruments and effects
http://xtant-audio.com/ - Purveyor of fine sample libraries (and Kontakt scripting tutorials)
reddiesel41264 is offline   Reply With Quote
Old 01-07-2012, 07:06 PM   #6
captain_caveman
Human being with feelings
 
captain_caveman's Avatar
 
Join Date: Dec 2011
Posts: 999
Default

Welcome onboard!

If I could point out a couple of bugs for you....

Code:
// Extract note and status value
  note = msg23 & $x7F;
	status = msg1 & $xF0;
The value you extract there for "note" is only the note number when the message type is a Note On or Note Off message. So...
Code:
note == ks1 ? channel = 0;
... when you execute these instructions, if the message type is a Continuous Controller of the number of ks1 (for example), it will behave in the same way as if note number ks1 was received.

Also, the slight PITA of MIDI is that, because note consists of a Note On and a Note Off message, when changing channels you need to handle the possibility of a Note Off being sent to a channel different from it's original Note On channel (which results in hanging notes).

There are two ways of dealing with this, a Note Stack (where you have an list of Note Ons and Channel that have been played, match up the Note Offs to them as they occur and remove that entry) or with an array of every note (JS doesn't have arrays but you can have (roughly) the same functionality as them).

edit: I should clarify that there is a third way, which is sending an All Notes Off message to all channels which does what it says on the tin. It's not very nice when you are playing something though.

Last edited by captain_caveman; 01-07-2012 at 07:13 PM.
captain_caveman is offline   Reply With Quote
Old 02-26-2013, 11:23 AM   #7
Geoff-h3o
Human being with feelings
 
Join Date: Oct 2008
Location: West Wales
Posts: 766
Default Where (or how) to install?

this looks like just what I need: I've copied it to


C:\Users\Geoff\AppData\Roaming\REAPER\Effects\LOSE R

but no joy.

This is on win 8 x64 running Reaper x86.

Thanks
Geoff-h3o is offline   Reply With Quote
Old 02-26-2013, 02:54 PM   #8
reddiesel41264
Human being with feelings
 
reddiesel41264's Avatar
 
Join Date: Jan 2012
Location: North East UK
Posts: 493
Default

I don't know what the problem could be I'm afraid, I'm running Windows 7 64bit but apart from that I have it in the same folder location and it's loading fine in Reaper. Maybe another Win 8 user could give it a go and we can see if it's an OS issue - although I doubt it is.

Do other user JS plugins work for you? Did you remember to scan for new plugins?
__________________
http://librewave.com - Freedom respecting instruments and effects
http://xtant-audio.com/ - Purveyor of fine sample libraries (and Kontakt scripting tutorials)
reddiesel41264 is offline   Reply With Quote
Old 02-26-2013, 05:11 PM   #9
Geoff-h3o
Human being with feelings
 
Join Date: Oct 2008
Location: West Wales
Posts: 766
Default Oooops

I told a lie I don't where I ended up putting it but it wasn't where I said.
Shows up fine now win 8 no problem. Will get to play with it tommorrow.

Thanks
Geoff-h3o is offline   Reply With Quote
Old 02-26-2013, 05:22 PM   #10
reddiesel41264
Human being with feelings
 
reddiesel41264's Avatar
 
Join Date: Jan 2012
Location: North East UK
Posts: 493
Default

Good stuff, hope you find it useful
__________________
http://librewave.com - Freedom respecting instruments and effects
http://xtant-audio.com/ - Purveyor of fine sample libraries (and Kontakt scripting tutorials)
reddiesel41264 is offline   Reply With Quote
Old 09-01-2013, 01:27 AM   #11
G-Sun
Human being with feelings
 
G-Sun's Avatar
 
Join Date: May 2010
Location: Norway
Posts: 7,318
Default

Thanks!
Is this documented on the wiki?
http://wiki.cockos.com/wiki/index.ph..._Documentation
__________________
Reaper x64, win 11
Composer, text-writer, producer
Bandcamp
G-Sun is offline   Reply With Quote
Old 09-01-2013, 03:19 AM   #12
reddiesel41264
Human being with feelings
 
reddiesel41264's Avatar
 
Join Date: Jan 2012
Location: North East UK
Posts: 493
Default

I can't see it there
__________________
http://librewave.com - Freedom respecting instruments and effects
http://xtant-audio.com/ - Purveyor of fine sample libraries (and Kontakt scripting tutorials)
reddiesel41264 is offline   Reply With Quote
Old 09-01-2013, 03:41 AM   #13
G-Sun
Human being with feelings
 
G-Sun's Avatar
 
Join Date: May 2010
Location: Norway
Posts: 7,318
Default

Quote:
Originally Posted by reddiesel41264 View Post
I can't see it there
Ok, started here:
http://wiki.cockos.com/wiki/index.ph...MIDI_Keyswitch

Please change/update as you see needed
__________________
Reaper x64, win 11
Composer, text-writer, producer
Bandcamp
G-Sun is offline   Reply With Quote
Old 10-10-2016, 11:01 AM   #14
SEA
Human being with feelings
 
SEA's Avatar
 
Join Date: Jun 2007
Location: By The Sea
Posts: 2,238
Default Need Some Help With this ;-)

I am trying to use this with StylusRMX and when I have the plug enable Stylus won't play back or trigger the midi notes. When I have the plug disabled then I can hear the midi part being played back.

So what am I missing?

Thanks!
__________________
JamieSEA

http://www.facebook.com/jamieseamusic
SEA 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 02:37 PM.


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