As it says in the title, I've wired up a 32 note pedal board from a pipe organ to control the Hauptwerk virtual pipe organ software. The pedal board has 32 individual switches. The board is a Due, being used with native USB. I'm using digital pins 2-10 and 22-44.
Here's my sketch:
#include <Control_Surface.h>
#include <MIDIUSB.h>
#include <MIDIUSB_Defs.h>
#include <frequencyToNote.h>
#include <pitchToFrequency.h>
#include <pitchToNote.h>
USBMIDI_Interface pedals;
const uint8_t velocity = 0b1111111; // Maximum velocity (0b1111111 = 0x7F = 127)
const uint8_t channel = 4; // MIDI channel 4
Digital buttons[] = {
{ 2, pitchC1, channel, velocity }, // button connected to pin 2, sends MIDI note C1 on channel 4 with velocity 127
{ 3, pitchD1b, channel, velocity },
{ 4, pitchD1, channel, velocity },
{ 5, pitchE1b, channel, velocity },
{ 6, pitchE1, channel, velocity },
{ 7, pitchF_1, channel, velocity },
{ 8, pitchG1b, channel, velocity },
{ 9, pitchG1, channel, velocity },
{10, pitchA1b, channel, velocity },
{22, pitchA1, channel, velocity },
{23, pitchB1b, channel, velocity },
{24, pitchB1, channel, velocity }
{25, pitchC2, channel, velocity },
{26, pitchD2b, channel, velocity },
{27, pitchD2, channel, velocity },
{28, pitchE2b, channel, velocity },
{29, pitchE2, channel, velocity },
{30, pitchF_2, channel, velocity },
{31, pitchG2b, channel, velocity },
{32, pitchG2, channel, velocity },
{33, pitchA2b, channel, velocity },
{34, pitchA2, channel, velocity },
{35, pitchB2b, channel, velocity },
{36, pitchB2, channel, velocity }
{37, pitchC3, channel, velocity },
{38, pitchD3b, channel, velocity },
{39, pitchD3, channel, velocity },
{40, pitchE3b, channel, velocity },
{41, pitchE3, channel, velocity },
{42, pitchF_3, channel, velocity },
{43, pitchG3b, channel, velocity },
{44, pitchG3, channel, velocity }
};
void setup() {
Control_Surface.begin();
}
void loop() { // Refresh the buttons (check whether a button's state has changed since last time, if so, send it over MIDI)
Control_Surface.loop();
}
and the error I'm getting on compile is:
In file included from C:\Users\kurts\Documents\Arduino\libraries\Control_Surface_main\src/Display/Helpers/Bresenham.hpp:5:0,
from C:\Users\kurts\Documents\Arduino\libraries\Control_Surface_main\src/Display/MCU/VUDisplay.hpp:102,
from C:\Users\kurts\Documents\Arduino\libraries\Control_Surface_main\src/Control_Surface.h:25,
from C:\Users\kurts\Documents\Arduino\Pedalboard 32\Pedalboard 32.ino:1:
C:\Users\kurts\Documents\Arduino\libraries\Control_Surface_main\src/AH/STL/cmath:16:31: note: #pragma message: FMA math fix
#pragma message("FMA math fix")
^
C:\Users\kurts\Documents\Arduino\Pedalboard 32\Pedalboard 32.ino:14:1: error: 'Digital' does not name a type
Digital buttons[] = {
^
exit status 1
Compilation error: 'Digital' does not name a type