Jump to content

Play certain notes based on velocity using Scripter? [SOLVED]


Danny Wyatt
Go to solution Solved by Dewdman42,

Recommended Posts

How to have a certain velocity range trigger a certain note?

For example from 1 to 63 it's C1 and from 64 to 127 is D1.

I would like to use the Scripter as a solution, because I have a new electronic drum kit and since I already have other scripts for other things I would like to have a single script for everything.

 

Thanks!

Link to comment
Share on other sites

velocity range of what input note?

 

 

Let me explain what I'm looking for:

I bought a new electronic drum kit and the ride cymbal is not triggering the Drum Kit Designer ride's bell, so I want to have for example 1 to 100 to trigger D#2 (Ride Out) and then from 101 up to 127 to trigger F2 (Ride Bell). That way I can just hit the cymbal harder to make it trigger the bell sound.

 

Using that script I will also be able to use the snare pad to trigger D1 (Snare Center) if it's 1-100 and then trigger E1 (Snare Rimshot) if it's 101-127.

 

So basically the default notes are D#2 for the ride pad and D1 for the snare pad.

Hope that helps :)

Link to comment
Share on other sites

  • Solution

I don't have time to test it, but try this:

 


var pitch1 = MIDI.noteNumber("C1");
var pitch2 = MIDI.noteNumber("D1");

var last = pitch1;

function HandleMIDI(event) {

   if(event instanceof NoteOn && event.pitch == pitch1) {
       
       if(event.velocity > 100) {
           event.pitch = pitch2;
           last = pitch2;
       }
       else {
           last = pitch1;
       }
   }
   else if (event instanceof NoteOff && event.pitch == pitch1) {
       event.pitch = last;
   }

   event.send();
}
Link to comment
Share on other sites

I don't have time to test it, but try this:

 


var pitch1 = MIDI.noteNumber("C1");
var pitch2 = MIDI.noteNumber("D1");

var last = pitch1;

function HandleMIDI(event) {

   if(event instanceof NoteOn && event.pitch == pitch1) {
       
       if(event.velocity > 100) {
           event.pitch = pitch2;
           last = pitch2;
       }
       else {
           last = pitch1;
       }
   }
   else if (event instanceof NoteOff && event.pitch == pitch1) {
       event.pitch = last;
   }

   event.send();
}

 

 

It worked as expected. Thank you so much for sharing it! :)

Link to comment
Share on other sites

  • 4 months later...

That's really helpful! I used this method to split velocity ranges to play closed hi hat and Hi Hat Edge/Shank for any velocity above 100, giving me much more expression using my very cheap eKit.. But how do add one more range? ...say between velocity of 80 -100 to produce another note.

So that I can achieve something like...

F#1 0-80 = F#1 (Tight)

F#1 80-100 = F#2 (Closed)

F#1 100-127 = F#3 (Edge)

@Dewdman42🤝🙏

 

 

  • Like 1
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...