For those of you using REAPER DAW:
I’ve managed to develop, with the help of AI, a couple of scripts that represent a huge leap in orchestration layering. These scripts allow you to play the same key without necessarily triggering the voice again, and they are not velocity-dependent..
FGM #Note Valve Pack
A collection of two JSFX scripts designed to manage the flow of MIDI messages using
a "valve" system based on note counts. Ideal for controlling how many notes are allowed
through after a specific threshold and managing MIDI streams in real-time.
1. FGM #Note Valve
This script controls MIDI note flow based on a configurable note threshold and reset
count. The valve opens at a user-specified note, allows a set number of notes to pass
through, and resets after a defined total note count.
Play From: The note number at which the valve opens.
Play For: How many notes to pass through when the valve is open.
Reset After Count: The total number of notes (passed and skipped) before resetting the cycle.
2. FGM #Note Valve -Reset Circle
This variant allows for continuous cycling of note sequences. The valve opens at a
user-defined note, passes a specified number of notes, and resets automatically to repeat
the sequence.
Play From: The note number at which the valve opens.
Play For: How many notes to pass through before automatically resetting the cycle.
-----------------------------------------------------------------------------------------------
😀😀😀😀
🎹🎹🎹🎹
FGM #Note Valve
//// START OF SCRIPT
//
desc: FGM #Note Valve
//
// Script by FGM using AI
//
// FGM #Note Valve
//
[[
This JSFX script controls the flow of MIDI messages using a "valve" system based on note counts.
You can configure:
- The first slider (Play From): Sets the note number at which the valve opens.
- The second slider (Play For): Determines how many notes are passed through
once the valve is open.
- The third slider (Reset After): Sets the total number of notes (played and skipped)
before resetting the cycle.
The valve opens when the note count reaches the first slider's value, allows the specified
number of notes to pass, and resets once the total note count reaches the value set in the
third slider.
]]
slider1: 2<1,10,1> Play From >>>>
slider2: 1<1,10,1> Play For >>>>
slider10: 9<1,20,1> Reset After Count >>>>
slider254: 0<0,0,0{FGM #Note Valve}> >
slider255: 0<0,0,0{SCRIPT BY FGM USING AI}> >
slider256: 0<0,0,0{Granting Full Script In Sight}> >
@init
note_counter = 0; // Tracks total number of notes processed
play_count = 0; // Tracks how many notes have been played
valve_open = 0; // Indicates if the valve is open
@slider
play_from = slider1; // Note number to start playing from
play_for = slider2; // Number of notes to play when the valve is open
reset_after = slider10; // Total number of notes before a reset
@block
while (
midirecv(offset, msg1, msg2, msg3) ? (
status = msg1 & 0xF0; // Extract the status byte (Note On/Off)
channel = msg1 & 0x0F; // Extract the MIDI channel
// Process Note On/Off events
(status == 0x90 || status == 0x80) ? (
// Handle Note On messages (msg3 > 0)
status == 0x90 && msg3 > 0 ? (
// Increment total note counter
note_counter += 1;
// Open valve if note_counter reaches play_from threshold
(note_counter >= play_from) && (play_count < play_for) ? (
valve_open = 1;
midisend(offset, msg1, msg2, msg3); // Pass the note through
play_count += 1; // Increment play count
) : (
valve_open = 0 // Close valve when the play cycle is complete
);
// Check if total note counter has reached the reset threshold
(note_counter >= reset_after) ? (
note_counter = 0; // Reset the cycle counter
play_count = 0; // Reset the play count
valve_open = 0; // Ensure valve is closed
) : 0;
) : (
// Always send Note Off messages for proper note release
(status == 0x80 || (status == 0x90 && msg3 == 0)) ? (
midisend(offset, msg1, msg2, msg3);
) : 0
)
) : (
// Pass through non-Note messages (e.g., CC, program changes)
midisend(offset, msg1, msg2, msg3);
)
)
);
//
//// END OF SCRIPT
-----------------------------------------------------------------------------------------------
😀😀😀😀
🎹🎹🎹🎹
FGM #Note Valve -Reset Circle
//// START OF SCRIPT
//
desc: FGM #Note Valve -Reset Circle
//
// Script by FGM using AI
//
// FGM #Note Valve -Reset Circle
//
[[
This JSFX script manages the flow of MIDI messages using a "valve" mechanism
that opens and closes based on a note counter. The script allows for continuous
cycling of note sequences with the following configurable parameters:
- The first slider (Play From): Defines the note number at which the valve starts to open and allow notes through.
- The second slider (Play For): Specifies the number of notes that will be played once the valve is open.
The script will continuously cycle through this pattern, opening the valve when the specified note is reached,
allowing a set number of notes through, and then resetting the cycle.
]]
// Define sliders for controlling the behavior of the MIDI valve
slider1: 1<1,10,1> Play From >>>>
slider2: 2<1,10,1> Play For >>>>
slider10: 0<0,0,0{Valve will reset as soon as Play From - Play For is done}> >
slider254: 0<0,0,0{FGM #Note Valve -Reset Circle}> >
slider255: 0<0,0,0{SCRIPT BY FGM USING AI}> >
slider256: 0<0,0,0{Granting Full Script In Sight}> >
@init
// Initialize variables for counting and tracking state
note_counter = 0; // Counter to track incoming Note On messages
play_count = 0; // Counter to track how many notes have been played
valve_open = 0; // State variable to track if the valve is open
@slider
// Read the slider values when they are adjusted
play_from = slider1; // Note number to start playing from
play_for = slider2; // Number of notes to play once the valve is open
@block
// Main processing loop to handle incoming MIDI messages
while (
midirecv(offset, msg1, msg2, msg3) ? (
status = msg1 & 0xF0; // Extract the status byte (Note On/Off)
channel = msg1 & 0x0F; // Extract the MIDI channel
// Check if the message is a Note On or Note Off event
(status == 0x90 || status == 0x80) ? (
// Only process Note On events (msg3 > 0)
status == 0x90 && msg3 > 0 ? (
note_counter += 1; // Increment note counter when a Note On message is received
// Open the valve if the note_counter reaches the play_from threshold
note_counter >= play_from ? (
valve_open = 1; // Open the valve to allow notes through
) : (
valve_open = 0 // Close the valve before the threshold is reached
);
// If the valve is open and the number of notes played is less than play_for, pass the note
valve_open && play_count < play_for ? (
midisend(offset, msg1, msg2, msg3); // Send the MIDI message
play_count += 1; // Increment the play count
) : 0;
// If the number of notes played reaches the play_for value, reset the cycle
play_count >= play_for ? (
note_counter = 0; // Reset the note counter
play_count = 0; // Reset the play count
valve_open = 0; // Close the valve to start a new cycle
) : 0;
) : (
// Send Note Off messages to ensure proper release of notes
status == 0x80 || (status == 0x90 && msg3 == 0) ? (
midisend(offset, msg1, msg2, msg3); // Always send Note Off messages
) : 0
)
) : (
// Pass through all other MIDI messages (e.g., CC messages, program changes)
midisend(offset, msg1, msg2, msg3);
)
)
);
//
//// END OF SCRIPT
-----------------------------------------------------------------------------------------------
FGM Wood: Maestro's Keyboard Arsenal - Actions & Effects Scripts
https://forum.cockos.com/showthread.php?t=279068
Discover a suite of easy-to-use tools designed
to elevate your musical projects, capturing the
timeless beauty and emotional power of music.
Customize every detail, even on a per-key basis, and
enjoy playing entire orchestrations simultaneously !!!!
😀😀😀😀
🎹🎹🎹🎹