Jump to content

Note routing based on velocity - help wanted


jpb1977

Recommended Posts

Hello all,

 

Hoping you can help create a simple(?) MIDI FX script.

 

I have a simple 5 pad + 1 kick midi capable (and velocity sensitive) drum pad. I'd like to add to the capability of the two cymbals by setting a velocity threshold where...

 

on cymbal A) hits above a certain threshold play an open hi-hat sound instead of the standard close (which the note is originally routed to) and...

 

on cymbal B) hits below a certain threshold would play a ride sound instead of the standard crash (which the note is originally routed to)

 

I know this is easily done AFTER the fact with transform midi functions, but I'd like to have it as a MIDI FX plug so that it works "live" in MainStage. I graciously thank anyone who can help me out.

 

jpb

Link to comment
Share on other sites

Wow wow, thank you! I'm away from home right now but you can safely assume general midi standard drum note numbers. But if changing things after the fact is difficult, I'd hate for you to waste time before i get the exact details for you.

 

This it's great, I'm already thinking of even more possibilities where cymbal A at 127 is a different crash, and the 2nd tom at 127 becomes an even deeper floor tom.

 

Once again, thank you. I'll post a video with the setup once we've got it set.

Link to comment
Share on other sites

Ok, standard routing is as follows:

 

Kick - C1

Snare - D1

Tom 1 - C2

Tom 2 - A1

Left Cymbal (Cymbal 1) - A#1 -> alternate routing to G#1 for all velocities below 64 (let's start there to experiment.

Right Cymbal (Cymbal 2) - C#2 -> alternate routing to D#2 for all velocities below 64

 

And if it isn't too difficult...perhaps for version 1.2?...(getting greedy now LOL)

Alternate routing of snare, D1 to D2 for all hits above 120

Alternate routing of tom2, A1 to G1 for all hits above 120

 

And for version 1.3

Third routing of Cymbal 1 to A2 for all 127 hits.

 

Trust me when I say I present these extra options as merely bonus options because at this stage I don't understand how difficult the programming is. I'm already over the moon at the ability to route just the 2 cymbals. Thanks once again, looking forward to the next stage.

Link to comment
Share on other sites

  • 6 months later...

Hi, 

 

I tried to make a MIDI FX script (in MainStage 3) that would change the ride cymbal bow sound (51) to bell sound (53) whenever I hit the cymbal strong enough (velocity >=100). 

 

I made this code (below) and it actually works, but not all the way. After some time of playing MainStage starts to drop notes..  something is abviously wrong. I just don't know what. I noticed this thread on the forum, and it seems that you have already solved this problem. Can I have the code you are talking here? I can see from the sample picture that it is just what I need.

 

Thank you already!

 

- Paavo

 

 

 

 

 

// Velocity Switch

 

//var ride = 51;

//var bell = 53;

//var snare = 38;

//var rim = 40;

//var currentNotes = {};

var didRemap = false;

 

function HandleMIDI(event){

 

   if (event instanceof NoteOn && event.pitch == 51 && event.velocity >= 100) { 

          event.pitch += 2;

          didRemap = true;

      }    

          

    if (event instanceof NoteOff && didRemap == true) {

      // remap the NoteOff event

      event.pitch += 2;

      

      //clear the remap flag

      didRemap = false;

      

      }  

       event.send();

    } 

  

 

 

Link to comment
Share on other sites

I'd try to create the noteoff right away instead of the didremap flag and the noteoff condition.

I'd maybe try and add this to the first chunk in the HandleMIDI function. I assume the script can get confused by the remap if you have stuff triggering simultaneously but i dont know haven't tested:

 

var off = new NoteOff(event);

off.velocity = 0; // this sometimes is needed even if it looks completely redundant :)

off.sendAfterMilliseconds(10);

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