Digigurdy-baz
Loading...
Searching...
No Matches
config.h
Go to the documentation of this file.
1#ifndef CONFIG_H
2#define CONFIG_H
3
4#include <Arduino.h>
5
6const String VERSION = "2.9.2";
7const String REL_DATE = "2023-02-05, v" + VERSION;
8
12
14const String EXTRA_LINE = " Rev4.0 Test Build ";
15//const String EXTRA_LINE = " 3.5 TEST ";
16//const String EXTRA_LINE = " MIDI-OUT, LED, SWSPI";
17//const String EXTRA_LINE = " TRIGGER - LED KNOB ";
18//const String EXTRA_LINE = " TSUNAMI - LED KNOB ";
19
20// This block here is for documentation purposes of macros that may be
21// commented out.
22#ifdef _DOXYGEN_
24 #define WHITE_OLED
26 #define BLUE_OLED
29 #define USE_TRIGGER
32 #define USE_TSUNAMI
35 #define USE_GEARED_CRANK
37 #define LED_KNOB
39 #define USE_PEDAL
42 #define ALLOW_COMBO_MODE
45 #define REV4_MODE
46#endif
47
48// One of these OLED options must be enabled.
49//#define WHITE_OLED
50#define BLUE_OLED
51
52//#define USE_GEARED_CRANK
53
54// Only one of these should be defined.
55#define USE_TRIGGER
56//#define USE_TSUNAMI
57
58#define ALLOW_COMBO_MODE
59//#define BAZ_MODE
60
61#define REV4_MODE
62
65const int TSUNAMI_OUT = 0;
66
68#define __TSUNAMI_USE_SERIAL1__
69
71//#define __WT_USE_SERIAL1__
72#define __WT_USE_SERIAL5__
73
74
75//#define LED_KNOB
76
78const int LED_PIN = 40;
79
80
81#define USE_PEDAL
82
84const int PEDAL_PIN = 38;
85
91const float PEDAL_MAX_V = 658.0;
92
94
98
101const float EXPRESSION_VMAX = 120.0;
102
108const int EXPRESSION_START = 90;
109
113const int NUM_SPOKES = 80;
114
117const float V_THRESHOLD = 5.5;
118
124const int SAMPLE_RATE = 1000;
125
129const int MAX_WAIT_TIME = 40000;
130
134const float DECAY_FACTOR = 0.00;
135
136// This is how long in milliseconds to buzz *at least* once it starts.
142const int BUZZ_MIN = 200;
143
144
149
158const int SPIN_SAMPLES = 700;
159
165const int VOL_THRESHOLD = 5;
166
171const int MAX_SPIN = 7600;
172
176const int SPIN_WEIGHT = 2500;
177
183const int SPIN_DECAY = 200;
184
188const int SPIN_THRESHOLD = 5001;
189
194const int SPIN_STOP_THRESHOLD = 1000;
195
201const int BUZZ_SMOOTHING = 250;
202
207const int BUZZ_DECAY = 1;
208
209
210// These are all keybox pins:
211
214
220#ifdef REV4_MODE
221const int pin_array[] = {-1, 2, 24, 3, 25, 26, 4, 27, 5, 28, 29, 6, 30,
222 7, 31, 8, 32, 33, 11, 34, 10, 35, 36, 9, 37};
223#else
224const int pin_array[] = {-1, 2, 24, 3, 25, 26, 4, 27, 5, 28, 29, 6, 30,
225 7, 31, 8, 32, 33, 18, 34, 19, 35, 36, 20, 37};
226#endif
227
228// This is literally just the size of the above array minus one. I need this as a const to
229// declare the KeyboxButton array later on... or I just don't know enough C++ to know how to
230// *not* need it ;-)
233const int num_keys = 24;
234
235// These control which buttons on the keybox have the roles of the X, A/B, 1-6, etc. buttons.
236// Users with non-"standard" keyboxes (if there is such a thing!) may need to adjust these.
237//
238// These are array indexes, so if you count chromatically up your keybox and then subtract 1,
239// that is its index.
243const int X_INDEX = 0;
244
247const int A_INDEX = num_keys - 2;
248
251const int B_INDEX = num_keys - 5;
252
255const int BUTTON_1_INDEX = 1;
256
259const int BUTTON_2_INDEX = 3;
260
263const int BUTTON_3_INDEX = 4;
264
267const int BUTTON_4_INDEX = 6;
268
271const int BUTTON_5_INDEX = 8;
272
275const int BUTTON_6_INDEX = 9;
276
279const int TPOSE_UP_INDEX = num_keys - 1;
280
283const int TPOSE_DN_INDEX = num_keys - 3;
284
285
286// These are less-commonly-changed options:
287
290const int CRANK_PIN = 15;
291
294const int BUZZ_PIN = 16;
295
297const int BIG_BUTTON_PIN = 39;
298
299#ifdef REV4_MODE
301const int EX1_PIN = 19;
303const int EX2_PIN = 13;
305const int EX3_PIN = 12;
307const int EX4_PIN = 41;
309const int EX5_PIN = 40;
311const int EX6_PIN = 17;
313const int EX7_PIN = 14;
315const int EX8_PIN = 18;
317const int EX9_PIN = 22;
319const int EX10_PIN = 23;
320
321#else
323const int EX1_PIN = 41;
325const int EX2_PIN = 17;
327const int EX3_PIN = 14;
329const int EX4_PIN = 21;
331const int EX5_PIN = 22;
333const int EX6_PIN = 23;
334#endif
335
337#endif
const String VERSION
Definition: config.h:6
const String REL_DATE
Definition: config.h:7
const int EX7_PIN
The pin to the EX7 button.
Definition: config.h:313
const int EX9_PIN
The pin to the EX9 button.
Definition: config.h:317
const int EX1_PIN
The pin to the EX1 button.
Definition: config.h:301
const int TPOSE_UP_INDEX
The position of the "T-UP" key on the keybox.
Definition: config.h:279
const int CRANK_PIN
The pin running to the crank.
Definition: config.h:290
const int BUZZ_PIN
The analog pin running to the buzz potentiometer/knob.
Definition: config.h:294
const int BIG_BUTTON_PIN
The pin running to the arcade, "auto-crank" button.
Definition: config.h:297
const int EX5_PIN
The pin to the EX5 button.
Definition: config.h:309
const int EX8_PIN
The pin to the EX8 button.
Definition: config.h:315
const int PEDAL_PIN
Pin used for the accessory pedal, if USE_PEDAL is enabled.
Definition: config.h:84
const int num_keys
The number of keys on the keybox.
Definition: config.h:233
const int pin_array[]
The ordered layout of the keybox keys/buttons.
Definition: config.h:221
const int X_INDEX
The position of the "X" key on the keybox.
Definition: config.h:243
const String EXTRA_LINE
This is a freeform line displayed on the About screen.
Definition: config.h:14
const int EX3_PIN
The pin to the EX3 button.
Definition: config.h:305
const float PEDAL_MAX_V
The max voltage reported by the accessory pedal.
Definition: config.h:91
const int BUTTON_3_INDEX
The position of the "3" key on the keybox.
Definition: config.h:263
const int BUTTON_5_INDEX
The position of the "5" key on the keybox.
Definition: config.h:271
const int A_INDEX
The position of the "A" key on the keybox.
Definition: config.h:247
const int EX10_PIN
The pin to the EX10 button.
Definition: config.h:319
const int TSUNAMI_OUT
The audio output channel used by the Tsunami unit.
Definition: config.h:65
const int EX4_PIN
The pin to the EX4 button.
Definition: config.h:307
const int EX2_PIN
The pin to the EX2 button.
Definition: config.h:303
const int BUTTON_4_INDEX
The position of the "4" key on the keybox.
Definition: config.h:267
const int B_INDEX
The position of the "B" key on the keybox.
Definition: config.h:251
const int BUTTON_2_INDEX
The position of the "2" key on the keybox.
Definition: config.h:259
const int BUTTON_1_INDEX
The position of the "1" key on the keybox.
Definition: config.h:255
const int TPOSE_DN_INDEX
The position of the "T-DOWN" key on the keybox.
Definition: config.h:283
const int LED_PIN
Pin used for the LED buzz indicator, if LED_KNOB is enabled.
Definition: config.h:78
const int BUTTON_6_INDEX
The position of the "6" key on the keybox.
Definition: config.h:275
const int EX6_PIN
The pin to the EX6 button.
Definition: config.h:311
const int BUZZ_SMOOTHING
The amount of buzz "smoothing" to start with when buzzing registers.
Definition: config.h:201
const int SPIN_THRESHOLD
The amount of spin necessary to make sound.
Definition: config.h:188
const int SPIN_STOP_THRESHOLD
The amount of spin below which sound stops.
Definition: config.h:194
const int SPIN_SAMPLES
The number of voltage samples per update.
Definition: config.h:158
const int MAX_SPIN
The maximum "spin" value.
Definition: config.h:171
const int SPIN_WEIGHT
The amount of spin to add when motion is detected.
Definition: config.h:176
const int BUZZ_DECAY
The amount of buzz "smoothing" to subtract when buzzing is not registering.
Definition: config.h:207
const int VOL_THRESHOLD
The lower voltage threshold for the crank to register motion.
Definition: config.h:165
const int SPIN_DECAY
The amount of spin to subtract when motion is not detected.
Definition: config.h:183
const int BUZZ_MIN
The minimum duration of buzz sounds.
Definition: config.h:142
const float EXPRESSION_VMAX
The crank speed in RPMs at which expression volume will max out.
Definition: config.h:101
const int MAX_WAIT_TIME
The maximum amount of time in microseconds to wait for crank movement.
Definition: config.h:129
const int SAMPLE_RATE
The delay between crank samples in microseconds.
Definition: config.h:124
const float V_THRESHOLD
The crank speed at which sound begins to play in RPMs.
Definition: config.h:117
const float DECAY_FACTOR
The multiplier applied to the velocity when no movement is detected.
Definition: config.h:134
const int NUM_SPOKES
The number of "spokes" on the optical crank wheel.
Definition: config.h:113
const int EXPRESSION_START
The minimum expression volume.
Definition: config.h:108