Skip to content

Commit

Permalink
support MPS 750x pads (excl. hihat) & Lemon LEHHS12C
Browse files Browse the repository at this point in the history
  • Loading branch information
3hhh committed Nov 8, 2023
1 parent c9a8241 commit 529e668
Show file tree
Hide file tree
Showing 21 changed files with 144 additions and 2 deletions.
Binary file added algorithm/signals/lehhs12c.wav
Binary file not shown.
Binary file added algorithm/signals/lehhs12c_all.wav
Binary file not shown.
Binary file added algorithm/signals/lehhs12c_rim.wav
Binary file not shown.
Binary file added algorithm/signals/lehhs12c_stomps.wav
Binary file not shown.
Binary file added algorithm/signals/mps750x_crash.wav
Binary file not shown.
Binary file added algorithm/signals/mps750x_crash_all.wav
Binary file not shown.
Binary file added algorithm/signals/mps750x_crash_rim.wav
Binary file not shown.
Binary file added algorithm/signals/mps750x_hihat.wav
Binary file not shown.
Binary file added algorithm/signals/mps750x_kick.wav
Binary file not shown.
Binary file added algorithm/signals/mps750x_ride.wav
Binary file not shown.
Binary file added algorithm/signals/mps750x_ride_all.wav
Binary file not shown.
Binary file added algorithm/signals/mps750x_ride_bell.wav
Binary file not shown.
Binary file added algorithm/signals/mps750x_ride_rim.wav
Binary file not shown.
Binary file added algorithm/signals/mps750x_snare.wav
Binary file not shown.
Binary file added algorithm/signals/mps750x_snare_rim.wav
Binary file not shown.
Binary file added algorithm/signals/mps750x_tom.wav
Binary file not shown.
32 changes: 32 additions & 0 deletions algorithm/signalsandsettings.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@
%x = audioread("signals/tp80.wav");padtype='tp80';
%x = audioread("signals/vh12.wav");padtype='vh12';%x = x(900000:end, :);%x = x(376000:420000, :);%x = x(1:140000, :);
%x = audioread("signals/drumtec_diabolo12.wav");x=x(:,1);padtype='diabolo12';
%x = audioread("signals/mps750x_tom.wav");padtype='mps750x_tom';x = x(156000:end, :); %until press rolls: 1:156000, press rolls: 156000:end
%x = audioread("signals/mps750x_snare.wav");padtype='mps750x_tom';x = x(1:172000, :); %until press rolls: 1:172000, press rolls: 172000:end
%x = audioread("signals/mps750x_snare_rim.wav");padtype='mps750x_tom';
%x = audioread("signals/mps750x_kick.wav");padtype='mps750x_kick';
%x = audioread("signals/mps750x_ride_all.wav");padtype='mps750x_cymbal';
%x = audioread("signals/mps750x_crash_all.wav");padtype='mps750x_cymbal';
%x = audioread("signals/lehhs12c_all.wav");padtype='lehhs12c';


% scale to the ESP32 input range to match the signal level of the ESP32
Expand Down Expand Up @@ -108,6 +115,31 @@
case 'pd120'
% note: the PRESET settings are from the PD120 pad
pad.hot_spot_attenuation_db = 3;
case 'lehhs12c'
pad.scan_time_ms = 4;
pad.decay_fact_db = 5;
pad.decay_len_ms2 = 600;
pad.decay_grad_fact2 = 100;
case 'mps750x_tom'
pad.scan_time_ms = 6;
pad.pre_scan_time_ms = 3.5;
pad.decay_grad_fact2 = 150;
pad.decay_len_ms2 = 450;
pad.rim_use_low_freq_bp = false;
case 'mps750x_kick'
pad.first_peak_diff_thresh_db = 3;
pad.scan_time_ms = 6;
pad.pre_scan_time_ms = 3.5;
pad.decay_grad_fact2 = 150;
pad.decay_len_ms2 = 450;
pad.threshold_db = 30;
case 'mps750x_cymbal'
pad.scan_time_ms = 3;
pad.decay_est_delay_ms = 1;
pad.decay_grad_fact2 = 150;
pad.decay_len_ms2 = 450;
pad.threshold_db = 30;
pad.rim_use_low_freq_bp = false;
case 'pda120ls'
pad.decay_grad_fact2 = 250;
pad.decay_fact_db = 5;
Expand Down
9 changes: 8 additions & 1 deletion edrumulus.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,14 @@ class Edrumulus
PD5 = 17,
PDA120LS = 18,
PDX100 = 19,
KT10 = 20
KT10 = 20,
MPS750X_TOM = 21,
MPS750X_SNARE = 22,
MPS750X_KICK = 23,
MPS750X_RIDE = 24,
MPS750X_CRASH = 25,
LEHHS12C = 26,
LEHHS12C_CTRL = 27
};

enum Ecurvetype // note that the enums need assigned integers for MIDI settings transfer
Expand Down
9 changes: 9 additions & 0 deletions edrumulus.ino
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,15 @@ void loop()
midi_note = edrumulus.get_midi_note_open ( pad_idx );
}
}
// special case: MPS 750x ride bell heuristic
if ( edrumulus.get_pad_type(pad_idx) == Edrumulus::MPS750X_RIDE )
{
// heuristic: if the bell is hit, it usually triggers a low velocity rim shot
if ( ( midi_velocity <= 70 ) && ( midi_note == edrumulus.get_midi_note_rim(pad_idx) ) )
{
midi_note = edrumulus.get_midi_note_open_norm(pad_idx);
}
}

MYMIDI.sendNoteOn ( midi_note, midi_velocity, midi_channel ); // (note, velocity, channel)
MYMIDI.sendNoteOff ( midi_note, 0, midi_channel ); // we need a note off
Expand Down
93 changes: 93 additions & 0 deletions edrumulus_parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,99 @@ void Edrumulus::Pad::apply_preset_pad_settings()

switch ( pad_settings.pad_type )
{

case LEHHS12C: // dual trigger
pad_settings.is_rim_switch = true;
pad_settings.scan_time_ms = 4.0f;
pad_settings.decay_fact_db = 5.0f;
pad_settings.decay_len2_ms = 600.0f;
pad_settings.decay_grad_fact2 = 100.0f;
pad_settings.rim_shot_is_used = true;
pad_settings.rim_shot_treshold = 25;
pad_settings.rim_shot_boost = 0;
pad_settings.velocity_threshold = 18;
pad_settings.velocity_sensitivity = 6;
break;

case LEHHS12C_CTRL: // 0-35k poti
pad_settings.is_control = true;
pad_settings.pos_threshold = 6;
pad_settings.pos_sensitivity = 23;
pad_settings.velocity_threshold = 0;
pad_settings.velocity_sensitivity = 31;
break;

/* MPS 750X:
* - recommended circuit: Rs=10k, Rp=10k, Cp=0 (https://github.com/corrados/edrumulus/discussions/98)
* - TRS pins:
* - Toms: hit piezo = T, rim piezo = R, GND = S
* - Cymbals incl. Hihat: bow piezo = S, rim switch = R (none for Hihat), GND = T, ride bell = ?
* - set all MPS750X potis to maximum output with a screw driver (sometimes the direction appears to be indicated incorrectly)
*/

case MPS750X_TOM: // dual trigger
pad_settings.scan_time_ms = 6.0f;
pad_settings.pre_scan_time_ms = 3.5f;
pad_settings.decay_grad_fact2 = 150.0f;
pad_settings.decay_len2_ms = 450.0f;
pad_settings.rim_shot_is_used = false;
pad_settings.velocity_threshold = 2;
pad_settings.velocity_sensitivity = 3;
break;

case MPS750X_SNARE: // dual trigger
pad_settings.scan_time_ms = 6.0f;
pad_settings.pre_scan_time_ms = 3.5f;
pad_settings.decay_grad_fact2 = 150.0f;
pad_settings.decay_len2_ms = 450.0f;
pad_settings.rim_use_low_freq_bp = false;
pad_settings.rim_shot_is_used = true;
pad_settings.rim_shot_treshold = 12;
pad_settings.velocity_threshold = 2;
pad_settings.velocity_sensitivity = 6;
pad_settings.pos_sense_is_used = true;
pad_settings.pos_sensitivity = 3;
break;

case MPS750X_KICK: // single trigger
pad_settings.first_peak_diff_thresh_db = 3.0f;
pad_settings.scan_time_ms = 6.0f;
pad_settings.pre_scan_time_ms = 3.5f;
pad_settings.decay_grad_fact2 = 150.0f;
pad_settings.decay_len2_ms = 450.0f;
pad_settings.velocity_threshold = 10;
pad_settings.velocity_sensitivity = 10;
pad_settings.curve_type = LOG2;
break;

case MPS750X_RIDE: // 3-zone
pad_settings.is_rim_switch = true;
pad_settings.scan_time_ms = 3.0f;
pad_settings.decay_est_delay_ms = 1.0f;
pad_settings.decay_grad_fact2 = 150.0f;
pad_settings.decay_len2_ms = 450.0f;
pad_settings.rim_use_low_freq_bp = false;
pad_settings.rim_shot_is_used = true;
pad_settings.rim_shot_treshold = 18;
pad_settings.rim_shot_boost = 0;
pad_settings.velocity_threshold = 12;
pad_settings.velocity_sensitivity = 6;
break;

case MPS750X_CRASH: // 2-zone
pad_settings.is_rim_switch = true;
pad_settings.scan_time_ms = 3.0f;
pad_settings.decay_est_delay_ms = 1.0f;
pad_settings.decay_grad_fact2 = 150.0f;
pad_settings.decay_len2_ms = 450.0f;
pad_settings.rim_use_low_freq_bp = false;
pad_settings.rim_shot_is_used = true;
pad_settings.rim_shot_treshold = 20;
pad_settings.rim_shot_boost = 0;
pad_settings.velocity_threshold = 12;
pad_settings.velocity_sensitivity = 6;
break;

case PD120: // dual trigger
pad_settings.velocity_threshold = 6;
pad_settings.velocity_sensitivity = 6;
Expand Down
3 changes: 2 additions & 1 deletion tools/edrumulus_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@

# tables
pad_types = ["PD120", "PD80R", "PD8", "FD8", "VH12", "VH12CTRL", "KD7", "TP80", "CY6", "CY8", "DIABOLO12", \
"CY5", "HD1TOM", "PD6", "KD8", "PDX8", "KD120", "PD5", "PDA120LS", "PDX100", "KT10"]
"CY5", "HD1TOM", "PD6", "KD8", "PDX8", "KD120", "PD5", "PDA120LS", "PDX100", "KT10", "MPS750X_TOM", \
"MPS750X_SNARE", "MPS750X_KICK", "MPS750X_RIDE", "MPS750X_CRASH", "LEHHS12C", "LEHHS12C_CTRL" ]
pad_names = ["snare", "kick", "hi-hat", "ctrl", "crash", "tom1", "ride", "tom2", "tom3"]
curve_types = ["LINEAR", "EXP1", "EXP2", "LOG1", "LOG2"]
cmd_names = [ "type", "thresh", "sens", "pos thres", "pos sens", "rim thres", "mask", "curve"]
Expand Down

0 comments on commit 529e668

Please sign in to comment.