QC

A Baroque Spanish MIDI pipe organ pedal board

Avoid letting inspiration find you without the proper musical tools. With this pedal board, you can now play that “Tiento de Contras” that you always wanted to practice at home :)

Devices and components

YIXISI 250V 2.54mm Dupont Pin Connector, Crimp Connector, Pin Connector, Wire Jumper and Male Crimp Pins, Kit for Replacing or Repairing Broken Wire Connectors on Board

BRICO Sencys Water-Repellent Wood Glue 250g

BRICO Vynex furniture hinge for cabinet doors - Zinc-plated steel - 20x16 mm - 6 pieces

BRICO Screw Spax Yellox Countersunk Head Pozi 2x10 mm

BRICO Fix-O-Moll Easy Glider self-adhesive flat furniture glides, gray, 22 mm, 12 pieces

Sencys galvanized thumb screws 2x20mm, 5 pieces

QWORK Flat Cable, Rainbow Color Ribbon Cable, 10 Pin, 1.27mm Pitch for 2.54mm Connectors, 6M

BRICO Wood 125x61cm - 5mm

4x25mm screw

Screw 2.50x20mm

BRICO Les Anciens Ébénistes wood varnish satin light oak 250ml

BRICO Climatube Basic pipe insulation Ø15x13mm /1m

GERUI Pro Micro 32U4 compatible with Arduino

BRICO Wood 18X35mm - 270cm

Youmile 20pcs AC 1A 125V 3 Pin SPDT NO Micro Switch + Hinge Lever NC Momentary Push Button Micro End Switch for Arduino

BRICO Alberts Chair Support - Blue Galvanized Steel - Reinforced Rounded Ends - 20x20x16mm - 4 pieces

Freenove Universal Breakout Board Compatible with Arduino Nano Micro Raspberry Pi Pico 1 2W ESP32 ESP8266, Protective Terminal Block with Pin Connector, GPIO Status LED, 5V 3.3V

Materials and tools

WinGluge Tin Soldering Kit 60W Electric Soldering Kit, Adjustable Temperature 200-450℃ with On/Off Switch 5 Soldering Tips for Home Maintenance, DIY

YINSAN 120pcs Precision Screwdriver Kit

IKEA Basic mixed tools

BRICO Baseline drill bit set - 4 pieces

Arch Marquetry

Coarse Saw Blades, 12Pcs Spiral Tooth Jewelers Scroll Saw Blades - Tip End for Wood, Metal, Plastic, Saws (3#)

Software and tools

Raspbian

Project description

Summary

Steps

Peel the insulation off the wire.

Make sure some of the plastic insulation is held firmly by the bottom crimp of the connector.

Make sure the exposed wire reaches all the way to the top of the connector.

Cut off any excess wire protruding from the connector.

Test each pin on the board using the test software included in the download section (without switches), using a jumper wire.

Wire each switch and test them individually before assembly.

Mount the switches and test again before installing the pedals.

Install the hook into the small piece of wood.

Hold the piece of wood in your hand and press the pedal.

Check how the hook activates the switch.

Make sure the switch engages when the pedal is fully depressed.

Move the pedal slightly left and right to confirm that side play is not preventing the switch from activating.

Make sure the hook does not apply excessive force to the switch, as this could cause long-term damage.

Plug the microcontroller into the breakout board.

Connect the GND pin to any ground pin so that all ground pins are shared.

Program the board using the Arduino IDE (I used a Raspberry Pi).

Make sure the MIDI library is installed and the correct card type is selected.

Final code for using midi

Final code for using midi

1#include "MIDIUSB.h"
2
3// ==================== CONFIG ====================
4// MIDI channel (0–15 in code, 1–16 for humans)
5const byte MIDI_CHANNEL = 3; // Channel 4 as midi channels 1-16 are in the library MIDIUSB numbered 0-15
6
7// Pins to use
8const int pins[] = {A0,A1,A2,A3,4,5,7,8,9,14,15};
9const char* pinNames[] = {"A0","A1","A2","A3","4","5","7","8","9","MISO","SCLK"};
10
11// Pin type: 0 = note, 1 = CC/event
12const int pinType[] = {0,0,0,0,1,1,0,0,0,1,0};
13
14// MIDI note or CC number for each pin
15// Notes: C3=36, D3=38, E3=40, F3=41, G3=43, A3=45, Bb3=46, B3=47 CC/event: 20–27 for example
16const int pinMidi[] = {38,40,41,43,20,21,47,45,46,22,36};
17
18
19const int numPins = sizeof(pins)/sizeof(pins[0]);
20// ================================================
21
22bool pinState[numPins] = {false};
23
24void setup() {
25 for(int i=0;i<numPins;i++){
26 pinMode(pins[i], INPUT_PULLUP);
27 }
28}
29
30void loop() {
31 for(int i=0;i<numPins;i++){
32 bool pressed = digitalRead(pins[i]) == LOW;
33
34 if(pressed && !pinState[i]){
35 if(pinType[i] == 0){
36 noteOn(MIDI_CHANNEL, pinMidi[i], 127);
37 } else {
38 ccOn(MIDI_CHANNEL, pinMidi[i], 127);
39 }
40 pinState[i] = true;
41 }
42 else if(!pressed && pinState[i]){
43 if(pinType[i] == 0){
44 noteOff(MIDI_CHANNEL, pinMidi[i], 0);
45 } else {
46 ccOff(MIDI_CHANNEL, pinMidi[i], 0);
47 }
48 pinState[i] = false;
49 }
50 }
51}
52
53// ==================== MIDI HELPERS ====================
54void noteOn(byte channel, byte pitch, byte velocity){
55 midiEventPacket_t noteOn = {0x09, (uint8_t)(0x90 | channel), pitch, velocity};
56 MidiUSB.sendMIDI(noteOn);
57 MidiUSB.flush();
58}
59
60void noteOff(byte channel, byte pitch, byte velocity){
61 midiEventPacket_t noteOff = {0x08, (uint8_t)(0x80 | channel), pitch, velocity};
62 MidiUSB.sendMIDI(noteOff);
63 MidiUSB.flush();
64}
65
66void ccOn(byte channel, byte cc, byte value){
67 midiEventPacket_t ccMsg = {0x0B, (uint8_t)(0xB0 | channel), cc, value};
68 MidiUSB.sendMIDI(ccMsg);
69 MidiUSB.flush();
70}
71
72void ccOff(byte channel, byte cc, byte value){
73 midiEventPacket_t ccMsg = {0x0B, (uint8_t)(0xB0 | channel), cc, value};
74 MidiUSB.sendMIDI(ccMsg);
75 MidiUSB.flush();
76}

Downloadable files

Project files for the developer IDE

A tester to test PINs and final code.

Project files.zip

Documentation

Card PIN scheme

A diagram showing all the PINs on the board.

Esquema basico pins.jpg

Basic measurements for the wooden parts of the crankset.

Adjust the dimensions to your liking.

Measurements.jpg

Assigning the PIN code to the pedals.

To use working PINS and eliminate broken ones.

PIN Assignments.jpg

A typical Spanish Baroque pipe organ pedalboard

Shown as an example

https://www.organartmedia.com/images/stories/garcia-martinez/12-manual_and_pedal_stubs.jpg




Note: Content and images are from: https://projecthub.arduino.cc/, with some modifications.
If you want it removed due to copyright reasons, please leave a comment. Thank you.
I want to share this article more widely so that everyone knows about Arduino and your project.

Easy remote control

Remotely control an LED with ease. Devices and components Arduino Nano 33 BLE with headers Box 525 Resistors precision 1% - 17 values Breadb...