# CC to Key Switch Converter Scripts



## Big Bob (Sep 16, 2014)

As a result of a discussion in another thread *Here*, I decided to write these scripts for my toolbox and possibly some of you might find these useful also. 

There is both an instrument and a multi script version and the default configuration supports a maximum of 16 key switches. However, the scripts can easily be reconfigured for any number of key switches from 10 to 32. If you actually need more than 32 key switches, you can load several instances of the scripts set to different CC numbers and/or MIDI channels.

The initial control panel for the default instrument script looks like this.







The download package contains pre-compiled versions of both scripts in the form of .nkp files which can be loaded into either K4 or K5. The source code is also included along with some minimal documentation in the form of 3 pdf 'how to' sheets.

Unzip the attachment to view the Control Panel Setup pdf which also contains a package download link at the bottom.

Rejoice,

Bob


----------



## JT3_Jon (Sep 16, 2014)

Very Cool BOB!! Thank you very much for doing this and making it available for the community!! Its incredibly awesome of you!!!


----------



## wonshu (Sep 17, 2014)

Yes, thank you!


----------



## damstraversaz (Sep 22, 2014)

thanks a lot, that's really useful !


----------



## Museum (Sep 4, 2015)

Hi Big Bob,
This is exactly what I have been looking for!
The only thing is, for the life of me I can`t get it to work..

I have set the desired CC to be controlled under 'CC #', and the MIDI port to Omni. I have set 2 keyswitches, one with CC range 0-63 and the other at 64-127 (for ON/OFF control). But the keyswitches just won`t activate the CC.
Have I missed something? Thanks for your time!


----------



## Big Bob (Sep 4, 2015)

I'm sorry but I guess I've forgotten everything I once knew about this script.  

However, your explanation sounds backwards to me. Doesn't this script convert CC ranges to keyswitches? 



> But the keyswitches just won`t activate the CC.


It sounds a little to me like you are trying to convert from a keyswitch to a CC.

Maybe you could provide a little more detail as to exactly what you are trying to do and how? Are you using the multiscript version or the instrument script version, etc?

Rejoice,

Bob


----------



## Museum (Sep 4, 2015)

Hi Bob, thanks for your prompt reply,
Here is what I'm trying to do, please tell me if this is what this script was built for:

I'm using a VST which relies on Midi CC for toggle of a particular control (range 0-63=OFF, 64-127=ON).
Now my wish is to use your script to assign these ranges to Keyswitches, so that it can become say C0=OFF, C#0=ON.

I have tried both instrument and multi versions, but no luck.
Thanks for your help!


----------



## Big Bob (Sep 4, 2015)

As I suspected that is just the reverse of what this script is intended to do. To convert from keyswitch to CC you might want to take a look at this thread where I suggested a few ways to do that.

http://vi-control.net/community/threads/sips-on-off-on-a-key-switch.48088/

Rejoice,

Bob


----------



## Museum (Sep 5, 2015)

Ha ha... Oh well, my bad. I believed _CC to Keyswitch_ actually meant turning CC into Keyswitches.
Thanks for your support though! It really amazed me that you shared the script in the first place!
Keep on helping others to rejoice!


----------



## Museum (Sep 5, 2015)

Also, thanks so much for the link to the factory multiscript 'Note Numbers to CC', which was what I was looking for!
Have a great one!

Museum


----------



## almound (Sep 9, 2015)

Big Bob said:


> As a result of a discussion in another thread *Here*, I decided to write these scripts for my toolbox and possibly some of you might find these useful also.



Thank you, thank you, thank you! Your script is fine, but not exactly what I needed. But the info at the link you provided should obviate the need to write into my notation program the extremely low (or high) key-switches that I'm forced to do now. Yeah!!!!!!!


----------



## hellish_victor (Dec 22, 2015)

Thank you for share this !


----------



## reddognoyz (Dec 22, 2015)

Bob this script is fantastic and a really big help for me. I've tried it out with the spifie percussion and it works like a charm. Thank you for this.


----------



## rockin6string (Sep 21, 2016)

*Constantly triggering a Keyswitch via CC#64*

Hey Bob, thanks for the nice skript! Can you help me solve a little problem of mine, cause I think your skript isn't too far away from that:

I want to set Scarbee Rickenbacker Bass in sustain mode via the sustain pedal. This is originally done by the Keyswitch at note A-1 which needs to be pressed down for that.
[Meanwhile the sustain pedal serves for accessing the slide mode. There's a dialogue at the instruments interface where you can redefine the CC# for that slide mode, but you can't define a CC# to active sustain mode (like at Scarbee MM-Bass) :-/ ]

But I really want that majestic Rickenbacker for live performance, and would be cool not to hold down all the time that A-1 key to get that nice sounding sustain mode, but to use the pedal.

I'm not into the Kontakt skript language, but do you think there's a possibility to add a feature to your skript to constantly trigger a keyswitch? Like saying "having no other last information than CC#64 Velocity127, you constantly trigger that keyswitch at A-1"?


----------



## hawpri (Sep 21, 2016)

So you know, Bob passed away in April.
http://vi-control.net/community/threads/big-bob.53061/

Maybe someone else can help answer your questions, though. There are a lot of knowledgable people around here.


----------



## rockin6string (Sep 21, 2016)

Oh, I didn't know that :-/... I hope that this fine guy has found a wonderful place up there in heaven


----------



## K5Addict2107 (Nov 30, 2016)

Hey Bob I have a question and im sorry if this off topic and sorry for being such a noob and i have spent time with the ksp reference manual in addition to the developers script. Trial and error and nights of headaches lol. I am making a drum pad script please excuse the crudity of it , it is 16 drum pads that trigger notes. I have used ui sliders for this in hope to right and midi learn these pads so the point is to use your midi controller to midi learn these pads and the GUI will follow by triggering the pads. This makes a nice visual experience for a user. The script works however the GUI pads *will not right click midi learn to the midi controller piano key :/ super aggravating* to say the least what am i doing wrong ?? i could add 1 pad here cause of the 1000 character limit sorry i have the full script if you need it but here is the script ..

on init
set_script_title("drum test - Kontakt Addict2017")
set_ui_height_px(225)
make_perfview

declare %pad[16] 
declare $count 
declare ui_switch $drum_pad2
declare %pad_id[16] 
%pad_id[1] := get_ui_id($drum_pad2)
$count := 0
while ($count < 16)
set_control_par(%pad_id[$count], $CONTROL_PAR_HEIGHT,75)
set_control_par(%pad_id[$count], $CONTROL_PAR_WIDTH,75)
set_control_par_str(%pad_id[$count], $CONTROL_PAR_PICTURE, "later")
$count := 0
while ($count < 16)
set_control_par(%pad_id[$count], $CONTROL_PAR_HEIGHT,75)
set_control_par(%pad_id[$count], $CONTROL_PAR_WIDTH,75)
set_control_par_str(%pad_id[$count], $CONTROL_PAR_PICTURE, " later2")
inc ($count)
end while 
inc ($count)
move_control_px($drum_pad2, 20, 70)
make_persistent ($drum_pad2)
read_persistent_var ($drum_pad2)
end while
end on
on ui_control ($drum_pad2) 
if ($drum_pad2=1)
else
$drum_pad2 := 1
$drum_pad2 := 1
play_note(48,100,0,0)
%pad[1] := $drum_pad2
end if
end on


----------



## d.healey (Nov 30, 2016)

K5Addict2107 said:


> Hey Bob I have a question and im sorry if this off topic and sorry for being such a noob and i have spent time with the ksp reference manual in addition to the developers script. Trial and error and nights of headaches lol. I am making a drum pad script please excuse the crudity of it , it is 16 drum pads that trigger notes. I have used ui sliders for this in hope to right and midi learn these pads so the point is to use your midi controller to midi learn these pads and the GUI will follow by triggering the pads. This makes a nice visual experience for a user. The script works however the GUI pads *will not right click midi learn to the midi controller piano key :/ super aggravating* to say the least what am i doing wrong ?? i could add 1 pad here cause of the 1000 character limit sorry i have the full script if you need it but here is the script ..


If you actually read this thread you would have seen that sadly Bob passed away earlier this year.

Didn't you post a whole thread about this already?


----------



## K5Addict2107 (Nov 30, 2016)

@ d Healy sorry I am new to V Control this is my 2nd day. I heard froma friend he was awesome and had a good understanding for kontakt im sorry to hear about his loss. As for the post perhaps but i moved previous posts to this forum as it his kontakt related. Learning the navagation here on V-Control so please be patient with me im a noob.


----------



## d.healey (Nov 30, 2016)

K5Addict2107 said:


> @ d Healy sorry I am new to V Control this is my 2nd day. I heard froma friend he was awesome and had a good understanding for kontakt im sorry to hear about his loss. As for the post perhaps but i moved previous posts to this forum as it his kontakt related. Learning the navagation here on V-Control so please be patient with me im a noob.


No worries, simple rule for most online forums is post once in the relative sub-forum and wait patiently


----------



## Lindon (Dec 1, 2016)

d.healey said:


> No worries, simple rule for most online forums is post once in the relative sub-forum and wait patiently


AFTER doing a search....


----------



## Embertone (Oct 10, 2017)

Does anyone know if Big Bob's scripts are still available somewhere? Would be useful for some tests...

<3


----------



## EvilDragon (Oct 11, 2017)

https://vi-control.net/community/threads/bobs-legacy.60988/


----------



## PlingPlang (Sep 4, 2022)

Unfortunately this script "cc2keysw.zip" is not included in the Bob legacy uploads that are mentioned in the thread ED posted.

I would REALLY appreciate if someone who still has it could upload it here. The name is

"CC to Key Switch Converter"

There are alternatives but they are lacking one or two parameters. This one looks like it has everything I need.

Thanks a lot.


----------

