Logic Pro Plugin Scripts

How to install the scripts

Installation

Usage

Contributing

Contributions to this project are welcome. If you encounter any issues or have any feature requests, please open an issue on the project's GitHub repository.


Credits

This plugin was built with the help of Frank Faruk Ceviz and ChatGPT

License

This plug-in is open source and free to use for personal and commercial purposes under the MIT License.



MIDI Note Range Filter


Description: This script is a MIDI plugin that allows users to filter out notes This script is a MIDI plugin that allows users to filter out notes outside a specific range. The plugin includes two sliders that allow users to set the low and high note values. When a MIDI event is received, the plugin checks if it is a note on or note off event and compares the pitch of the event to the low and high note values. If the pitch is outside the range, the plugin sends an "all notes off" message to stop the note from playing and does not pass the event through. If the pitch is inside the range, the plugin passes the event through.

Features

Script:


/* MIDI Note Range Filter
Builded with Frank Faruk Ceviz & ChatGPT */

// Define MIDI plug-in controls
var PluginParameters = [  {
    name: "Low Note",
    type: "lin",
    minValue: 0,
    maxValue: 127,
    numberOfSteps: 127,
    defaultValue: 0
  },
  {
    name: "High Note",
    type: "lin",
    minValue: 0,
    maxValue: 127,
    numberOfSteps: 127,
    defaultValue: 127
  }
];

// Pass events through and filter out notes outside the user-set range
function HandleMIDI(event) {
  // Get the user-set low and high note values from the sliders
  var lowNote = Math.floor(GetParameter("Low Note"));
  var highNote = Math.floor(GetParameter("High Note"));

  // Check if the event is a note on or note off event
  if (event instanceof NoteOn || event instanceof NoteOff) {
    // Get the MIDI note number of the event
    var noteNumber = event.pitch;
 
    // Check if the note is outside the user-set range
    if (noteNumber < lowNote || noteNumber > highNote) {
      // If so, send an "all notes off" message to stop the note from playing
      MIDI.allNotesOff();
   
      // And don't pass the event through
      return;
    }
  }

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



MIDI Note Range Filter with Probability Gate

This plug-in is a MIDI note filter that allows you to set a range of notes to allow through and uses a probability gate to decide which events to pass through.


Script:


/* MIDI Note Range Filter with Probability Gate
Built with Frank Faruk Ceviz & ChatGPT */

// Define MIDI plug-in controls
var PluginParameters = [
  {
    name: "High Note",
    type: "lin",
    minValue: 0,
    maxValue: 127,
    numberOfSteps: 127,
    defaultValue: 127
  },
  {
    name: "Low Note",
    type: "lin",
    minValue: 0,
    maxValue: 127,
    numberOfSteps: 127,
    defaultValue: 0
  },
  {
    name: "Probability",
    type: "linear",
    minValue: 0,
    maxValue: 100,
    numberOfSteps: 100,
    defaultValue: 50,
    unit: "%"
  }
];

var probability = 50;

function HandleMIDI(event) {
  // Get the user-set low and high note values from the sliders
  var lowNote = Math.floor(GetParameter("Low Note"));
  var highNote = Math.floor(GetParameter("High Note"));

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

    // Check if the note is outside the user-set range
    if (noteNumber < lowNote || noteNumber > highNote) {
      // If so, send an "all notes off" message to stop the note from playing
      MIDI.allNotesOff();

      // And don't pass the event through
      return;
    }
  }

  // Check if the event should be sent based on probability
  if (eventShouldSend()) {
    // Send the event
    event.send();
  }
}

function ParameterChanged(param, value) {
  if (param === 2) {
    probability = value;
  }
}

function eventShouldSend() {
  return (Math.ceil(Math.random() * 100) <= probability);
}

// Pass events through and filter out notes outside the user-set range



1.3 MIDI Note Range Filter with Probability Gate and Velocity Slider


This plugin allows you to filter out MIDI notes outside of a user-set range, with the added ability to set a probability gate and note velocity slider. Built with Frank Faruk Ceviz and ChatGPT. 


Script:


/* MIDI Note Range Filter with Probability Gate and Velocity Slider
Built with Frank Faruk Ceviz & ChatGPT */

// Define MIDI plug-in controls
var PluginParameters = [
{
name: "High Note",
type: "lin",
minValue: 0,
maxValue: 127,
numberOfSteps: 127,
defaultValue: 127
},
{
name: "Low Note",
type: "lin",
minValue: 0,
maxValue: 127,
numberOfSteps: 127,
defaultValue: 0
},
{
name: "Probability",
type: "linear",
minValue: 0,
maxValue: 100,
numberOfSteps: 100,
defaultValue: 50,
unit: "%"
},
{
name: "Note Velocity",
type: "lin",
minValue: 1,
maxValue: 127,
numberOfSteps: 126,
defaultValue: 80
}
];

var probability = 50;

function HandleMIDI(event) {
// Get the user-set low and high note values from the sliders
var lowNote = Math.floor(GetParameter("Low Note"));
var highNote = Math.floor(GetParameter("High Note"));

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

// Check if the note is outside the user-set range
if (noteNumber < lowNote || noteNumber > highNote) {
  // If so, send an "all notes off" message to stop the note from playing
  MIDI.allNotesOff();

  // And don't pass the event through
  return;
}
}

// Set the velocity of the event based on the user-set slider value
event.velocity = GetParameter("Note Velocity");

// Check if the event should be sent based on probability
if (eventShouldSend()) {
// Send the event
event.send();
}
}

function ParameterChanged(param, value) {
if (param === 2) {
probability = value;
}
}

function eventShouldSend() {
return (Math.ceil(Math.random() * 100) <= probability);
}

// Pass events through and filter out notes outside the user-set range, and set velocity based on slider value.


1.5 MIDI Note Range Filter with MIDI Volume Slider, Probability Gate, and Note Velocity Wrapping Sliders

This is a JavaScript MIDI plugin for Logic Pro that allows users to filter MIDI note events based on a range of notes defined by two sliders, and set the volume of the events with a separate slider.

The plugin has four controls:

When a MIDI event is received, the plugin checks if it is a note on or note off event, and if so, it checks if the MIDI note number is within the range set by the High Note and Low Note sliders. If the note is outside the range, the plugin sends an "all notes off" message to stop the note from playing and does not pass the event through.

The plugin then sets the velocity of the event based on the MIDI Volume slider, and checks whether the event should be sent based on the Probability slider. If the event should be sent, it sends the event through with the modified velocity, and then restores the original velocity of the event.


Script:



/* MIDI Note Range Filter with Probability Gate and MIDI Volume Slider
Built with Frank Faruk Ceviz & ChatGPT */

// Define MIDI plug-in controls
var PluginParameters = [
  {
    name: "High Note",
    type: "lin",
    minValue: 0,
    maxValue: 127,
    numberOfSteps: 127,
    defaultValue: 127
  },
  {
    name: "Low Note",
    type: "lin",
    minValue: 0,
    maxValue: 127,
    numberOfSteps: 127,
    defaultValue: 0
  },
  {
    name: "Probability",
    type: "linear",
    minValue: 0,
    maxValue: 100,
    numberOfSteps: 100,
    defaultValue: 50,
    unit: "%"
  },
  {
    name: "MIDI Volume",
    type: "lin",
    minValue: 0,
    maxValue: 127,
    numberOfSteps: 127,
    defaultValue: 100
  }
];

var probability = 50;

function HandleMIDI(event) {
  // Get the user-set low and high note values from the sliders
  var lowNote = Math.floor(GetParameter("Low Note"));
  var highNote = Math.floor(GetParameter("High Note"));

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

    // Check if the note is outside the user-set range
    if (noteNumber < lowNote || noteNumber > highNote) {
      // If so, send an "all notes off" message to stop the note from playing
      MIDI.allNotesOff();

      // And don't pass the event through
      return;
    }
  }

  // Store the original velocity of the event
  var originalVelocity = event.velocity;

  // Set the velocity of the event based on the user-set slider value
  event.velocity = Math.round(originalVelocity * (GetParameter("MIDI Volume") / 127));

  // Check if the event should be sent based on probability
  if (eventShouldSend()) {
    // Send the event
    event.send();
  }

  // Restore the original velocity of the event
  event.velocity = originalVelocity;
}

function ParameterChanged(param, value) {
  if (param === 2) {
    probability = value;
  }
}

function eventShouldSend() {
  return (Math.ceil(Math.random() * 100) <= probability);
}

// Pass events through and filter out notes outside the user-set range, and set velocity based on slider value.
// Store the original velocity of the event and restore it after sending the event.