GtrJazz Posted March 12, 2020 Share Posted March 12, 2020 Hi, Does anyone know a free script available that allows articulations Id switching in the automation lane or program change messages in piano roll view? Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted March 12, 2020 Share Posted March 12, 2020 I did one recently for someone on another forum, its not general purpose so you'll have to tweak it. Let me dig it up. Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted March 12, 2020 Share Posted March 12, 2020 Here is a simple script. I don't have time to edit it or explain it today... but if you can make sense out of it, you can tweak it yourself..... can answer questions later... var articulation = []; articulation[1] = {word:"Articulation 1", pitch:"C0"}; articulation[2] = {word:"Articulation 2", pitch:"C#0"}; articulation[3] = {word:"Articulation 3", pitch:"D0"}; articulation[4] = {word:"Articulation 4", pitch:"D#0"}; articulation[5] = {word:"Articulation 5", pitch:"E0"}; articulation[6] = {word:"Articulation 6", pitch:"F0"}; articulation[7] = {word:"Articulation 7", pitch:"F#0"}; articulation[8] = {word:"Articulation 8", pitch:"G0"}; articulation[9] = {word:"Articulation 9", pitch:"G#0"}; articulation[10] = {word:"Articulation 10", pitch:"A0"}; var VELOCITY=1; /*************************************************************** ***************** DO NOT EDIT BELOW HERE ********************** ***************************************************************/ function HandleMIDI(event) { event.ksSend(); } Event.prototype.ksSend = function() { this.send(); }; NoteOn.prototype.ksSend = function() { SwitchMap.send(this); }; var wordFlg=-1; /************************************************* * Setup SwitchMap object with pre-created * events based on the user provided articulation * array *************************************************/ var SwitchMap = {map:[]}; /************************************************* * send function that will be called for all * NoteOn events to potenetially send keyswitches ***/ SwitchMap.send = function (event) { if( wordFlg >= 0 ) { var node = this.map[wordFlg]; // If switches are defined, send them if(node != undefined) { for(var s=0;s<node.length;s++) { var e = node[s]; e.channel = event.channel; e.port = event.port; e.send(); } } wordFlg = -1; } // Send main note event event.send(); }; /*********************************************** * init function to load up the switches defined * in articulation[] array, preallocate events ***/ SwitchMap.init = function() { this.map = []; for (var a = 1; a < articulation.length; a++) { var userArt = articulation[a]; if (userArt != undefined) { this.configure(a, userArt); } } }; /********************************************** * use this function to configure each * user provided entry **/ SwitchMap.configure = function(artid, ksconfig) { // make sure wrapped by array if(this.map[artid] == undefined) this.map[artid] = []; var on = new NoteOn; if(typeof ksconfig.pitch == "string") { on.pitch = MIDI.noteNumber(ksconfig.pitch); } else { on.pitch = ksconfig.pitch; } if(ksconfig.velocity == undefined) { on.velocity = VELOCITY; } else { on.velocity = ksconfig.velocity; } this.map[artid].push(on); var off = new NoteOff; off.pitch = on.pitch; off.velocity = on.velocity; this.map[artid].push(off); }; /************************************************ * Callback called by LogicPro at the right time ***/ function Initialize() { SwitchMap.init(); } function ParameterChanged(id, val) { if(id==0) { wordFlg=val; } } // build words array for automation var words = ["Reset"]; for(var i=1;i<articulation.length;i++) { words.push(articulation[i].word); } var PluginParameters = []; PluginParameters.push({ type: "menu", name: "Your Articulation Lane", defaultValue: 0, hidden: true, disableAutomation: false, valueStrings: words }); Quote Link to comment Share on other sites More sharing options...
GtrJazz Posted March 12, 2020 Author Share Posted March 12, 2020 Thanks so much. Quote Link to comment Share on other sites More sharing options...
GtrJazz Posted March 12, 2020 Author Share Posted March 12, 2020 So I copied your script into the scripter and the articulation are showing up in the automation lane but it doesn’t trigger and keyswitches from kontakt loaded on my Vienna ensemble sever. Any help would be appreciated Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted March 13, 2020 Share Posted March 13, 2020 Yes it works. its designed to send the keyswitch right before the note...not at the point in time of the automation point. So insert some notes on your region also and play it back, keyswitches will be sent... Quote Link to comment Share on other sites More sharing options...
GtrJazz Posted March 13, 2020 Author Share Posted March 13, 2020 I must be missing a step because non of the key switches are triggered inside kontakt. Unless I’m missing a setting inside Vienna ensemble on my slave machine. Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted March 13, 2020 Share Posted March 13, 2020 I don't see any reason why it wouldn't work in kontakt. Send me your LPX project Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted March 13, 2020 Share Posted March 13, 2020 Its possible you have to get middle C right. Scripter is based on the Yamaha C3 standard for Middle C. Some kontakt libraries I have used seem to use the Roland C4 standard. So.. I think if you use Kontakt's midi monitor you may see the keyswitches are coming in but they're off by an octave so its not changing your articulations in the way you expect. Use Kontakt midi monitor to verify that keyswitches are coming in, then modify the Script if you have to so that the correct octave is being sent from Scripter. Quote Link to comment Share on other sites More sharing options...
GtrJazz Posted March 14, 2020 Author Share Posted March 14, 2020 Thanks. When I get home tomorrow I’ll give it a try. If I don’t get it working I’ll send you my project file. Thanks again for all the help Quote Link to comment Share on other sites More sharing options...
GtrJazz Posted June 4, 2020 Author Share Posted June 4, 2020 This script has been working great. Curious if anyone knows if it’s possible to assign a key command to toggle view from this script automation lane to midi draws views? 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.