Altar of Wisdom Posted March 9, 2023 Share Posted March 9, 2023 Hey all, Just made this simple script for Scripter, mainly as a workaround for plugins that don't show mod wheel in their piano roll, but you can use it to trigger any CC message down to the plugin. Used it for example to to some midi learn onto zebra, without having any midi keyboard connected. You can even automate the sliders of the script so it'll generate the corresponding midi messages (track automation doesn't allow you to write CC automation, you need to do that in midi regions). Hope that helps anyone 😉 File should be put in: /Users/username/Music/Audio\ Music\ Apps/Plug-In\ Settings/Scripter GenerateCC.pst 4 Quote Link to comment Share on other sites More sharing options...
Nick5x5 Posted March 13, 2023 Share Posted March 13, 2023 Awesome script. I was looking for something very similar. Do you know if it would be possible to have several different midi CC numbers and values in one script? Thanks. 1 Quote Link to comment Share on other sites More sharing options...
Altar of Wisdom Posted March 14, 2023 Author Share Posted March 14, 2023 Sure, there you go, for up to 4 different CCs 😉 Generate4CC.pst 3 Quote Link to comment Share on other sites More sharing options...
Altar of Wisdom Posted March 14, 2023 Author Share Posted March 14, 2023 2 1 Quote Link to comment Share on other sites More sharing options...
Nick5x5 Posted March 14, 2023 Share Posted March 14, 2023 Thanks Altar! That is amazing. I was trying to reverse engineer how to make a script, but this ain't html. I'm over my head. I'll do some research on how to do this, since it seems pretty powerful. Thanks again! Quote Link to comment Share on other sites More sharing options...
Altar of Wisdom Posted March 14, 2023 Author Share Posted March 14, 2023 Thanks for your nice comment ! Actually that's not html but javascript, with a few classes designed for handling midi and transport. Most tutorials on JS will probably be of good help to get you going 😉 Quote Link to comment Share on other sites More sharing options...
Altar of Wisdom Posted April 11, 2023 Author Share Posted April 11, 2023 Made the whole "UI" more compact, added midi channel selector, and pitch bend + aftertouch messages 😄 Generate4CC.pst 1 2 1 Quote Link to comment Share on other sites More sharing options...
Chuck Oyiko Posted October 13, 2023 Share Posted October 13, 2023 Dude this is awesome! You've blessed us enough already, but is it possible to add a "randomize all" button? Quote Link to comment Share on other sites More sharing options...
Richard Herczeg Posted October 14, 2023 Share Posted October 14, 2023 On 4/11/2023 at 11:53 AM, Altar of Wisdom said: Made the whole "UI" more compact, added midi channel selector, and pitch bend + aftertouch messages 😄 Thank you. Useful. Good. Quote Link to comment Share on other sites More sharing options...
Chuck Oyiko Posted November 14, 2023 Share Posted November 14, 2023 So took a crack at this a couple of times myself. ParameterChanged() doesn't seem to work reliably, (not even in the tutorial script). No go on both Sonoma, Mojave, and Catalina. But it did work ONCE, before suddenly stopping. Sorry for the lack of sufficiency here, but is this a known issue? Quote Link to comment Share on other sites More sharing options...
TheUncannyValley Posted December 15, 2023 Share Posted December 15, 2023 On 4/11/2023 at 2:53 AM, Altar of Wisdom said: Made the whole "UI" more compact, added midi channel selector, and pitch bend + aftertouch messages 😄 Thank you so much for creating & sharing this script! I foresee a lot of cool uses for it. Quote Link to comment Share on other sites More sharing options...
Jordi Torres Posted December 15, 2023 Share Posted December 15, 2023 @Altar of Wisdom, Thanks for sharing your script! I noticed something peculiar with the implementation of your Pitch Bend parameter. You set a range of -127/127 in the Pitch Bend slider, and then in your ParameterChanged function you multiply the values by 128. This results in some values being outside the normal Pitch Bend range of -8192/8191. So, any values below -64 or above 63 will produce malformed Pitch Bend data (which will be ignored by whichever instrument receives it): This could be solved by using the full range and using the values "as is" (without multiplying them): { name: 'Pitch Bend', type: 'lin', minValue: -8192, maxValue: 8191, numberOfSteps: 16383, defaultValue: 0, } else if (param == 1) // Pitch Bend { var pb = new PitchBend; pb.value = value; pb.channel = channel; pb.send(); } J. 4 Quote Link to comment Share on other sites More sharing options...
Altar of Wisdom Posted December 17, 2023 Author Share Posted December 17, 2023 On 12/15/2023 at 5:23 PM, Jordi Torres said: @Altar of Wisdom, Thanks for sharing your script! I noticed something peculiar with the implementation of your Pitch Bend parameter. You set a range of -127/127 in the Pitch Bend slider, and then in your ParameterChanged function you multiply the values by 128. This results in some values being outside the normal Pitch Bend range of -8192/8191. So, any values below -64 or above 63 will produce malformed Pitch Bend data (which will be ignored by whichever instrument receives it): This could be solved by using the full range and using the values "as is" (without multiplying them): { name: 'Pitch Bend', type: 'lin', minValue: -8192, maxValue: 8191, numberOfSteps: 16383, defaultValue: 0, } else if (param == 1) // Pitch Bend { var pb = new PitchBend; pb.value = value; pb.channel = channel; pb.send(); } J. Yes, sure, it's a bit awkward that some implemtentations use -128/127 and others -8192/8191, so I end up not being sure what to do. And Using -8192/8191 gives a huge range to that slider, no ? Quote Link to comment Share on other sites More sharing options...
Jordi Torres Posted December 17, 2023 Share Posted December 17, 2023 3 hours ago, Altar of Wisdom said: And Using -8192/8191 gives a huge range to that slider, no ? True, and with some synths you would hear no immediate change if you increase/decrease by one step at a time, but moving the slider up and down with the mouse gives the desired effect and no out-of-range values. You could use a smaller range (as to be able to hear immediate change in pitch when increasing/decreasing by one step), but to not have values out of range in that context, you need to do some scaling of the range. For example, to keep that range you have in your preset (-127 to 127) while scaling it, you could do something like this on you Pitch Bend plugin parameter: { name: 'Pitch Bend', type: 'lin', minValue: -127, maxValue: 127, numberOfSteps: 254, defaultValue: 0, } Then add a scaling function which you would call inside ParameterChanged: function scalePBRange(pbValue) { // Define the slider range const sliderMin = -127; const sliderMax = 127; // Define the full Pitch Bend range const pbMin = -8192; const pbMax = 8191; // Calculate the scaling factor const scaleFactor = (pbMax - pbMin) / (sliderMax - sliderMin); // Scale the value const scaledValue = Math.round(pbValue * scaleFactor + (pbMin + pbMax) / 2); // Ensure the scaled value is within the new range return Math.min(Math.max(scaledValue, pbMin), pbMax); } // Call scaling function inside ParameterChanged else if (param == 1) // Pitch Bend { var pb = new PitchBend; pb.value = scalePBRange(value); pb.channel = channel; pb.send(); } J. 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.