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();
}