Jump to content

Velocity->volume translater script


Recommended Posts

Based on arnte's script for VolcaFM ( https://www.logicprohelp.com/viewtopic.php?t=127024 )

Here is a short Logic Pro Scripter script that maps the velocity of MIDI events to part level control events for the various different Volca Beats parts

(It's currently incomplete, I only did the ones I'm using. Should be pretty straightforward to flesh out with the manual and a bit of hacking...)

 

function HandleMIDI(e) {

if (e instanceof NoteOn) {
       var cc = new ControlChange(); 
       switch (e.pitch) {
         case 36:  cc.number = 40; break;  // kick
         case 38:  cc.number = 41; break;  // snare
         case 39:  cc.number = 46; break;  // clap 
         case 42:  cc.number = 44; break;  // closed hat
         case 46:  cc.number = 45; break;  // open hat
         case 49:  cc.number = 49; break;  // crash
         default: break;
       }
       cc.value = e.velocity;
       cc.send(); 
       cc.trace();
      e.send();
      e.trace();
   } else {
       e.send();
       e.trace();
   }
}

Link to comment
Share on other sites

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