17
17
18
18
#define USE_MIDI
19
19
20
+ // ESP32 default pin definition:
21
+ // For older prototypes or custom implementations, simply change the GPIO numbers in the table below
22
+ // to match your hardware (note that the GPIO assignment of Prototype 2 is the same as Prototype 4).
23
+ // analog pins setup: snare | kick | hi-hat | hi-hat-ctrl | crash | tom1 | ride | tom2 | tom3
24
+ static int analog_pins4[] = { 36 , 33 , 32 , 25 , 34 , 39 , 27 , 12 , 15 };
25
+ static int analog_pins_rimshot4[] = { 35 , -1 , 26 , -1 , 14 , -1 , 13 , -1 , -1 };
26
+ const int number_pads4 = sizeof ( analog_pins4 ) / sizeof ( int );
27
+
28
+
20
29
#include " edrumulus.h"
21
30
22
31
#ifdef USE_MIDI
@@ -35,21 +44,21 @@ MIDI_CREATE_DEFAULT_INSTANCE();
35
44
# endif
36
45
#endif
37
46
47
+ // local variables and defines
38
48
Edrumulus edrumulus;
39
- const int midi_channel = 10 ; // default for edrums is 10
40
- const int hihat_pad_idx = 2 ;
41
- const int hihatctrl_pad_idx = 3 ;
42
- int number_pads = 0 ; // initialization value, will be set in setup()
43
- int status_LED_pin = 0 ; // initialization value, will be set in setup()
44
- bool is_status_LED_on = false ; // initialization value
45
- int selected_pad = 0 ; // initialization value
46
-
49
+ const int midi_channel = 10 ; // default for edrums is 10
50
+ const int hihat_pad_idx = 2 ; // this definition should not be changed
51
+ const int hihatctrl_pad_idx = 3 ; // this definition should not be changed
52
+ int number_pads = number_pads4; // initialization value, may be overwritten by get_prototype_pins()
53
+ int status_LED_pin = 0 ; // initialization value, will be set in get_prototype_pins()
54
+ bool is_status_LED_on = false ; // initialization value
55
+ int selected_pad = 0 ; // initialization value
47
56
48
57
void setup ()
49
58
{
50
59
// get the pin-to-pad assignments
51
- int * analog_pins = nullptr ;
52
- int * analog_pins_rimshot = nullptr ;
60
+ int * analog_pins = analog_pins4; // initialize with the default setup
61
+ int * analog_pins_rimshot = analog_pins_rimshot4; // initialize with the default setup
53
62
const int prototype = Edrumulus_hardware::get_prototype_pins ( &analog_pins,
54
63
&analog_pins_rimshot,
55
64
&number_pads,
0 commit comments