Frank Faruk Logo

MIDI Note Range Filter

Controlling Your Musical Palette

Have you ever wanted to limit the range of notes that your MIDI instrument can play? Whether you're a composer, sound designer, or live performer, the MIDI Note Range Filter is a handy tool to have in your arsenal. This simple yet powerful plugin allows you to set a minimum and maximum note value, effectively filtering out any notes that fall outside of this range.

How Does It Work?

The plugin operates on a straightforward principle:

  1. User Input: The user sets the desired low and high note values using two sliders.
  2. MIDI Event Analysis: When a MIDI note-on or note-off event is received, the plugin checks the note number against the specified range.
  3. Filtering: If the note number is within the range, the event is passed through to the destination device. If it's outside the range, the plugin sends an "all notes off" message to ensure the note doesn't sound.

Practical Applications

The MIDI Note Range Filter can be used in a variety of scenarios:

Technical Breakdown

The plugin's core functionality is implemented in a concise and efficient manner:



    // ... (Plugin parameter definitions)

    function HandleMIDI(event) {
        // Get user-defined low and high notes
        var lowNote = Math.floor(GetParameter("Low Note"));
        var highNote = Math.floor(GetParameter("High Note"));

        // Check if the event is a note on or off
        if (event instanceof NoteOn || event instanceof NoteOff) {
            // Get the note number
            var noteNumber = event.pitch;

            // Filter out notes outside the range
            if (noteNumber < lowNote || noteNumber > highNote) {
                MIDI.allNotesOff();
                return;
            }
        }

        // Pass the event through
        event.send();
    }

        

By understanding the basic principles and code implementation, you can customize this plugin to fit your specific needs.

By incorporating this versatile tool into your music production workflow, you can unlock new creative possibilities and streamline your creative process.