Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How can I filter out certain midi notes from entering an instrument?

I want to take a preset MIDI instrument and make it ignore every inputted note besides "A." The transposer MIDI effect unfortunately does not do what I want because even if I hit notes that aren't "A," it will still send an "A" to the instrument. I don't want this. Thanks. I'm using version 10.4.1

Posted on Mar 23, 2019 3:10 PM

Reply
Question marked as Best reply

Posted on Mar 25, 2019 1:15 PM

Okay, I figured it out. If anyone's interested, I was able to achieve what I wanted by modifying the script for the Scripter MIDI effect preset "Key Range" and saving it as a new preset. The modified script looks like this:


var activeNotes = [];


function HandleMIDI(event)

{

if (event instanceof NoteOn) {

if (event.pitch % 12 != GetParameter('Pitch') % 12)

return undefined;

else {

activeNotes.push(event);

event.send()

}

}

else if (event instanceof NoteOff) {

for (i=0; i < activeNotes.length; i++) {

if (event.pitch == activeNotes[i].pitch) {

event.send();

activeNotes.splice(i,1);

break;

}

}

}

else { // pass non-note events through

event.send();

}

}


var PluginParameters = [

{ name:'Pitch', type:'lin',

minValue:0, maxValue:127, numberOfSteps:127, defaultValue:115},

];

4 replies
Question marked as Best reply

Mar 25, 2019 1:15 PM in response to Will_Do_Like_Mildew

Okay, I figured it out. If anyone's interested, I was able to achieve what I wanted by modifying the script for the Scripter MIDI effect preset "Key Range" and saving it as a new preset. The modified script looks like this:


var activeNotes = [];


function HandleMIDI(event)

{

if (event instanceof NoteOn) {

if (event.pitch % 12 != GetParameter('Pitch') % 12)

return undefined;

else {

activeNotes.push(event);

event.send()

}

}

else if (event instanceof NoteOff) {

for (i=0; i < activeNotes.length; i++) {

if (event.pitch == activeNotes[i].pitch) {

event.send();

activeNotes.splice(i,1);

break;

}

}

}

else { // pass non-note events through

event.send();

}

}


var PluginParameters = [

{ name:'Pitch', type:'lin',

minValue:0, maxValue:127, numberOfSteps:127, defaultValue:115},

];

How can I filter out certain midi notes from entering an instrument?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.