Jump to content

Articulation Id names in the automation lane


GtrJazz

Recommended Posts

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...

 

artlane.thumb.jpg.84634bba2cc68be7dda462e808552549.jpg

 

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
});
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

  • 2 months later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...