Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update MIDI Delay X v0.4 > v0.5 #398

Merged
merged 2 commits into from
Dec 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions MIDI/talagan_MIDI Delay X.jsfx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
desc:MIDI Delay X
author: Ben 'Talagan' Babut
version: 0.4
version: 0.5
donation:
https://www.paypal.com/donate/?business=3YEZMY9D6U8NC&no_recurring=1&currency_code=EUR
license:
MIT (Do whatever you like with this code).
changelog:
- [Bug/Behaviour Fix] Once an event programmation date is decided, do not make this trigger date subject to change by automation.
- Added "bypass during recording" option.
about:
# MIDI Delay X

Expand Down Expand Up @@ -37,10 +37,9 @@ about:
slider1:s_amount=0<0,1,0.0001>Amount (0.0-1.0)
#--
slider3:s_max_delay=0<0,1000,1>Max Delay (ms)
# slider2:0<0,16,0.25>Max Delay (QN)
# slider3:0<0,10000,1>Max Delay (samples)
#--
#--

slider5:s_bypass_during_recording=1<0,1,1{No,Yes}>Bypass during recording

slider7:0<0,16,1{All,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16>MIDI Channel
slider8:0<0,16,1{All,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}>MIDI Bus
#--
Expand Down Expand Up @@ -90,9 +89,9 @@ function iround(f) (


function processEvents()
local(delay_samples, delay_sc, delay_isc, first_byte, second_byte,
local(delay_samples, delay_sc, delay_isc, first_byte, second_byte, is_recording,
msg_len, msg_chan, msg_type, msg_has_channel, msg_pos, msg_emitted,
msg_type_matches, chan_matches, bus_matches,
msg_type_matches, chan_matches, bus_matches, play_mode_matches,
packet)
(

Expand Down Expand Up @@ -133,15 +132,16 @@ function processEvents()

first_byte = g_buf_r[HEADER_SIZE];
second_byte = g_buf_r[HEADER_SIZE+1];

msg_has_channel = (msg_len <=3 && first_byte < 0xF0); // first bit should be null

msg_chan = (first_byte & 0x0F);
msg_type = ((first_byte & 0xF0) >> 4);
is_recording = (play_state == 5);

bus_matches = (s_bus<0 || midi_bus == s_bus);
chan_matches = (s_chan<0 || (msg_has_channel && (msg_chan == s_chan)));
msg_type_matches = s_apply_to_other;
bus_matches = (s_bus<0 || midi_bus == s_bus);
chan_matches = (s_chan<0 || (msg_has_channel && (msg_chan == s_chan)));
msg_type_matches = s_apply_to_other;
play_mode_matches = (!is_recording || !s_bypass_during_recording);

(msg_has_channel)?(
msg_type_matches = 0;
Expand All @@ -163,7 +163,7 @@ function processEvents()
);


(bus_matches && chan_matches && msg_type_matches) ? (
(bus_matches && chan_matches && msg_type_matches && play_mode_matches) ? (

// Store the packet in the queue

Expand Down