forked from corrados/edrumulus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
edrumulus_parameters.cpp
225 lines (203 loc) · 9.9 KB
/
edrumulus_parameters.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
/******************************************************************************\
* Copyright (c) 2020-2022
* Author(s): Volker Fischer
******************************************************************************
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) any later
* version.
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
\******************************************************************************/
#include "edrumulus.h"
void Edrumulus::Pad::apply_preset_pad_settings()
{
// apply PRESET settings (might be overwritten by pad-specific properties)
pad_settings.velocity_threshold = 8; // 0..31
pad_settings.velocity_sensitivity = 9; // 0..31
pad_settings.mask_time_ms = 6; // 0..31 (ms)
pad_settings.pos_threshold = 9; // 0..31
pad_settings.pos_sensitivity = 14; // 0..31
pad_settings.rim_shot_treshold = 12; // 0..31
pad_settings.cancellation = 0; // 0..31
pad_settings.curve_type = LINEAR;
pad_settings.pos_sense_is_used = false; // must be explicitely enabled if it shall be used
pad_settings.rim_shot_is_used = false; // must be explicitely enabled if it shall be used
pad_settings.first_peak_diff_thresh_db = 8.0f; // pad specific parameter: allowed difference between first peak and later peak in scan time
pad_settings.mask_time_decay_fact_db = 15.0f; // pad specific parameter: during mask time decay factor for maximum peak in scan time
pad_settings.scan_time_ms = 2.5f; // pad specific parameter: scan time after first detected peak
pad_settings.pre_scan_time_ms = 2.5f; // pad specific parameter: pre-scan time to search for first peak
pad_settings.decay_est_delay_ms = 7.0f; // pad specific parameter: delay after second main peak until decay power estimation starts
pad_settings.decay_est_len_ms = 4.0f; // pad specific parameter: decay power estimation window length
pad_settings.decay_est_fact_db = 16.0f; // pad specific parameter: decay power estimation factor (to get over decay ripple)
pad_settings.decay_fact_db = 1.0f; // pad specific parameter: vertical shift of the decay function in dB
pad_settings.decay_len1_ms = 0.0f; // pad specific parameter: length of the decay 1
pad_settings.decay_grad_fact1 = 200.0f; // pad specific parameter: decay function gradient factor 1
pad_settings.decay_len2_ms = 350.0f; // pad specific parameter: length of the decay 2
pad_settings.decay_grad_fact2 = 200.0f; // pad specific parameter: decay function gradient factor 2
pad_settings.decay_len3_ms = 0.0f; // pad specific parameter: length of the decay 3
pad_settings.decay_grad_fact3 = 200.0f; // pad specific parameter: decay function gradient factor 3
pad_settings.pos_low_pass_cutoff = 150.0f; // pad specific parameter: low-pass filter cut-off in Hz for positional sensing
pad_settings.pos_invert = false; // pad specific parameter: invert the positional sensing metric
pad_settings.rim_use_low_freq_bp = true; // pad specific parameter: use low frequency band-pass filter for rim shot detection
pad_settings.rim_shot_window_len_ms = 3.5f; // pad specific parameter: window length for rim shot detection
switch ( pad_settings.pad_type )
{
case PD120:
pad_settings.velocity_threshold = 6;
pad_settings.velocity_sensitivity = 6;
pad_settings.pos_threshold = 7;
pad_settings.pos_sensitivity = 14;
pad_settings.rim_shot_treshold = 24;
break;
case PDA120LS:
pad_settings.decay_grad_fact2 = 250.0f;
pad_settings.pre_scan_time_ms = 3.5f;
pad_settings.first_peak_diff_thresh_db = 7.0f;
pad_settings.pos_low_pass_cutoff = 370.0f;
break;
case PD80R:
pad_settings.velocity_sensitivity = 5;
pad_settings.rim_shot_treshold = 11;
pad_settings.pos_threshold = 11;
pad_settings.pos_sensitivity = 10;
pad_settings.scan_time_ms = 3.0f;
pad_settings.decay_len2_ms = 75.0f;
pad_settings.decay_grad_fact2 = 300.0f;
pad_settings.decay_len3_ms = 300.0f;
pad_settings.decay_grad_fact3 = 100.0f;
pad_settings.rim_use_low_freq_bp = false;
break;
case PDX8:
pad_settings.velocity_sensitivity = 5;
pad_settings.rim_shot_treshold = 9;
pad_settings.pos_threshold = 20;
pad_settings.pos_sensitivity = 25;
break;
case PD5:
pad_settings.scan_time_ms = 4.0f;
pad_settings.mask_time_ms = 9.0f;
pad_settings.decay_grad_fact2 = 400.0f;
break;
case PD6:
pad_settings.scan_time_ms = 1.5f;
pad_settings.decay_grad_fact2 = 400.0f;
break;
case PD8:
pad_settings.velocity_sensitivity = 5;
pad_settings.pos_threshold = 26;
pad_settings.pos_sensitivity = 11;
pad_settings.rim_shot_treshold = 16;
pad_settings.mask_time_ms = 7;
pad_settings.scan_time_ms = 1.3f;
pad_settings.decay_est_delay_ms = 6.0f;
pad_settings.decay_fact_db = 5.0f;
pad_settings.decay_len2_ms = 30.0f;
pad_settings.decay_grad_fact2 = 600.0f;
pad_settings.decay_len3_ms = 150.0f;
pad_settings.decay_grad_fact3 = 120.0f;
break;
case TP80:
pad_settings.velocity_sensitivity = 10;
pad_settings.pos_threshold = 22;
pad_settings.pos_sensitivity = 23;
pad_settings.scan_time_ms = 2.75f;
pad_settings.decay_est_delay_ms = 11.0f;
pad_settings.decay_len2_ms = 60.0f;
pad_settings.decay_grad_fact2 = 400.0f;
pad_settings.decay_len3_ms = 700.0f;
pad_settings.decay_grad_fact3 = 60.0f;
pad_settings.pos_invert = true;
break;
case FD8:
pad_settings.velocity_threshold = 5;
pad_settings.velocity_sensitivity = 0;
break;
case VH12:
// TODO if the Hi-Hat is open just a little bit, we get double triggers
pad_settings.scan_time_ms = 4.0f;
pad_settings.decay_est_delay_ms = 9.0f;
pad_settings.decay_fact_db = 5.0f;
pad_settings.decay_len2_ms = 27.0f;
pad_settings.decay_grad_fact2 = 700.0f;
pad_settings.decay_len3_ms = 600.0f; // must be long because of open Hi-Hat ringing
pad_settings.decay_grad_fact3 = 75.0f;
break;
case VH12CTRL:
pad_settings.velocity_threshold = 19;
pad_settings.velocity_sensitivity = 28;
break;
case KD7:
pad_settings.velocity_threshold = 11;
pad_settings.velocity_sensitivity = 6;
pad_settings.scan_time_ms = 2.0f;
pad_settings.decay_est_delay_ms = 8.0f;
pad_settings.decay_fact_db = 5.0f;
pad_settings.decay_len1_ms = 4.0f;
pad_settings.decay_grad_fact1 = 30.0f;
pad_settings.decay_len2_ms = 30.0f;
pad_settings.decay_grad_fact2 = 450.0f;
pad_settings.decay_len3_ms = 500.0f;
pad_settings.decay_grad_fact3 = 45.0f;
break;
case KD8:
pad_settings.scan_time_ms = 3.0f;
pad_settings.mask_time_decay_fact_db = 10.0f;
pad_settings.decay_grad_fact2 = 450.0f;
pad_settings.decay_len3_ms = 500.0f;
pad_settings.decay_grad_fact3 = 45.0f;
break;
case KD120:
pad_settings.scan_time_ms = 6.0f;
pad_settings.decay_fact_db = 12.0f;
pad_settings.decay_est_fact_db = 20.0f;
break;
case CY5:
pad_settings.velocity_sensitivity = 6;
pad_settings.scan_time_ms = 3.0f;
pad_settings.mask_time_ms = 8.0f;
pad_settings.decay_fact_db = 3.0f;
break;
case CY6:
pad_settings.scan_time_ms = 6.0f;
pad_settings.decay_len2_ms = 150.0f;
pad_settings.decay_grad_fact2 = 120.0f;
pad_settings.decay_len3_ms = 450.0f;
pad_settings.decay_grad_fact3 = 30.0f;
break;
case CY8:
pad_settings.velocity_threshold = 13;
pad_settings.velocity_sensitivity = 8;
pad_settings.rim_shot_treshold = 30;
pad_settings.curve_type = LOG2;
pad_settings.scan_time_ms = 6.0f;
pad_settings.decay_len1_ms = 10.0f;
pad_settings.decay_grad_fact1 = 10.0f;
pad_settings.decay_len2_ms = 100.0f;
pad_settings.decay_grad_fact2 = 200.0f;
pad_settings.decay_len3_ms = 450.0f;
pad_settings.decay_grad_fact3 = 30.0f;
break;
case DIABOLO12:
pad_settings.scan_time_ms = 2.0f;
pad_settings.mask_time_ms = 8.0f;
pad_settings.first_peak_diff_thresh_db = 13.0f;
pad_settings.mask_time_decay_fact_db = 20.0f;
pad_settings.decay_grad_fact2 = 270.0f;
pad_settings.decay_fact_db = 6.0f;
pad_settings.decay_est_delay_ms = 20.0f;
pad_settings.pos_low_pass_cutoff = 50.0f; // positional sensing seems not to work correctly
break;
case HD1TOM:
pad_settings.velocity_sensitivity = 8;
pad_settings.scan_time_ms = 1.5f;
pad_settings.decay_grad_fact2 = 300.0f;
pad_settings.pos_low_pass_cutoff = 300.0f;
break;
}
}