jimdilian Posted October 27, 2017 Share Posted October 27, 2017 is there a script to remap the range of the CC incoming values ? let's say the 0 to 40 and 128 to 100 ? Quote Link to comment Share on other sites More sharing options...
ski Posted October 27, 2017 Share Posted October 27, 2017 It's easy to do, but some clarification is needed. First, CC values range from 0 - 127 (there is no 128). Next... are you looking to make the CC act as a switch? If so, the way I'm interpreting what you wrote would be the following (and here I'm using modwheel, CC1, as an example): If the script detects a modwheel value anywhere from 0 through 126 (representing any modwheel position over almost the entire throw of the wheel) you want the Script to output a single MIDI event of CC1, value 40. If the script detects a modwheel value of 127 (representing the wheel hitting maximum), the Script outputs a single MIDI event of CC1, value 100. Another way to do this would be to simply divide the throw of the modwheel so that on either side of the midway point (0 - 63 or 64 - 127) the Script would generate either a value of 40 or a value or 127 (and just one event each). Or did you have something else in mind? Quote Link to comment Share on other sites More sharing options...
jimdilian Posted October 27, 2017 Author Share Posted October 27, 2017 ok.. you are right.. 0-127.. yes .. I looking to change the values received by the cc4 from 0 to 127 to limit their values, like 0 to 20 and 127 to 100.. with the option to change the values so my drums can interpret the new values.. I don't know if it is a "switch" or...something.. else.. is to change the values only.. it is for the hi hat on some AUis.. so the hi hat ..openness doesn't sound so open.. in toontrack.. changing the values on a script will be simpler than in toontrack.. and others like bfd.. and kontakt drums ..etc. thank you for your answer. Quote Link to comment Share on other sites More sharing options...
jimdilian Posted October 27, 2017 Author Share Posted October 27, 2017 how do you divide the cc4 with a script ? can you help me ? Quote Link to comment Share on other sites More sharing options...
Eric Cardenas Posted October 27, 2017 Share Posted October 27, 2017 You can do this with a script but you could also use the Modifier like this: This setting is scaling things from 40 to 103. Quote Link to comment Share on other sites More sharing options...
David Nahmani Posted October 27, 2017 Share Posted October 27, 2017 You could also do all the remapping you want with a Transformer in the Environment. Here I first used the Scale attribute to quickly create this map, then switch to "Use Map", that way you can give each individual incoming CC value a new destination value. Quote Link to comment Share on other sites More sharing options...
jimdilian Posted October 27, 2017 Author Share Posted October 27, 2017 yes thank you for the answer, those two ways I know already with the transformer and with the modifier, but I need a script for this to see the values reduce from both sides on a script, =( ,, Quote Link to comment Share on other sites More sharing options...
Atlas007 Posted October 30, 2017 Share Posted October 30, 2017 Using Monitors objects (cabled) before and after the Transformer object in David's suggestion could show you those values. Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted October 31, 2017 Share Posted October 31, 2017 If I understand you correctly you are wanting a script that can take a range of 0-127 and remap it to some smaller range. Try this: var controller = 4; var start = 50; var end = 100; function HandleMIDI(event) { if(event instanceof ControlChange && event.number == controller) { event.value = Math.round(((end - start) * event.value ) / 128) + start; } event.send(); event.trace(); } Quote Link to comment Share on other sites More sharing options...
jimdilian Posted November 1, 2017 Author Share Posted November 1, 2017 Thank you Vey Much Dewdman42 ¡ You made My Week ¡ =) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.