# Organ Bass Pedals

**URL:** <https://forum.arduino.cc/t/organ-bass-pedals/522926>\
**Category:** Programming\
**Created:** [April 27, 2018, 5:27pm UTC](https://forum.arduino.cc/t/organ-bass-pedals/522926 "2018-04-27T17:27:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ElPedro1970](https://avatars.discourse-cdn.com/v4/letter/e/8e8cbc/32.png) [@ElPedro1970](https://forum.arduino.cc/u/ElPedro1970)\
**Post date:** [April 27, 2018, 5:27pm UTC](https://forum.arduino.cc/t/organ-bass-pedals/522926/1 "2018-04-27T17:27:06Z")

</div>

First post...

I did a search, but didn't find what I was looking for.

I have a donor set of 13 pedals. I believe the switches are wired correctly (one ground buss and separate wires from the other side of each switch to a unique pin on my 2560).

I have uploaded this code, per an Instructables. The output of the serial monitor of the Arduino software correctly shows note on and note off when testing. I do not have any knowledge of Arduino or midi. Admittedly, I am just looking for a quick fix:

#define DEBOUNCE 1500

struct key  
{  
int pin;  
int midiKey;  
int debounce;  
};

struct key keys[] =  
{  
{ 22, 25, 2 }, // Db red  
{ 24, 26, 2 }, // D red  
{ 26, 27, 2 }, // Eb orange  
{ 28, 28, 2 }, // E orange  
{ 30, 29, 2 }, // F yellow  
{ 32, 30, 2 }, // Gb green  
{ 34, 31, 2 }, // G green  
{ 36, 32, 2 }, // Ab blue  
{ 38, 33, 2 }, // A blue  
{ 40, 34, 2 }, // Bb violet  
{ 42, 35, 2 }, // B violet  
{ 44, 36, 2 }, // C brown  
{ 48, 24, 2 }, // C brown  
{ 0, 0, 0 } // end of list marker  
};

int keyOffset = 0;

void setup() {  
// put your setup code here, to run once:  
for(int i = 0; keys\*.pin != 0; ++i)\*

- {\*  
 _pinMode(keys\*.pin, INPUT\_PULLUP);  
\__ }_\_  
\__ Serial.begin(9600); // set up Serial library at 9600 bps\*\_  
_\* Serial.println("Setup complete");\*_  
_}_  
_void noteOn(int midiKey)_  
_{_  
_\* Serial.print("Note On: ");\*_  
_\* Serial.println(midiKey);\*_  
_}_  
_void noteOff(int midiKey)_  
_{_  
_\* Serial.print("Note Off: ");\*_  
_\* Serial.println(midiKey);\*_  
_}_  
_void loop() {_  
_\* // put your main code here, to run repeatedly:\*_  
_\* int value;\*_  
_\_ for(int i = 0; keys\*.pin != 0; ++i)  
  {  
  value = digitalRead(keys.pin);  
  if(keys.debounce == 0) // Key has been off\*  
 \* {  
  if(value == LOW) // Key is now on\*  
 \* {  
  noteOn(keys.midiKey); // Send the MIDI note on message\*  
  keys\*.debounce = DEBOUNCE; // Set the note off debounce counter\*  
 \* }  
  }  
  else // Key has been on\*  
 \* {  
  if(value == HIGH) // Key has gone off\*  
 \* {  
  if(--keys.debounce == 0) // If Key has remained off for DEBOUNCE scans,  
  noteOff(keys.midiKey);  
  }  
  else // Key has not gone off\*  
  keys\*.debounce = DEBOUNCE; // Reset debounce counter in case we got\*  
 \* // a small number of key off scans\*  
 \* }  
  }  
 }\*  
 I am attempting to use this set of pedals with a Hammond SKX, which allegedly uses midi channel 3 for the bass pedals.  
 What currently happens when I attempt to use the pedals is this:  
 NO sound comes from the organ when I close contact on any switches on the pedal board.  
 If I am playing any note on the actual organ, and then press a pedal, the sound from the organ stops. When I release the pedal, I can continue playing the manuals of the organ, until I hit another bass pedal.  
 I sincerely apologize for my lack of knowledge, and for potentially missing, via search, the post I needed to see to correct this issue. Thank you in advance for any help provided!\__

---

<div class="post-metadata">

**Author:** ![slipstick](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@slipstick](https://forum.arduino.cc/u/slipstick)\
**Post date:** [April 27, 2018, 5:36pm UTC](https://forum.arduino.cc/t/organ-bass-pedals/522926/2 "2018-04-27T17:36:41Z")

</div>

Please edit your post to put the code in \</\> code tags which will get rid of the italics.

What Arduino? What output circuit are you using? How exactly are you connecting that program to the Hammond?

In that code I can't see your NoteOn and NoteOff doing anything other than Serial.prints. Where are the MIDI messages?

Steve

---

<div class="post-metadata">

**Author:** ![PieterP](https://avatars.discourse-cdn.com/v4/letter/p/ecccb3/32.png) [@PieterP](https://forum.arduino.cc/u/PieterP)\
**Post date:** [April 27, 2018, 7:50pm UTC](https://forum.arduino.cc/t/organ-bass-pedals/522926/3 "2018-04-27T19:50:41Z")

</div>

You are not sending MIDI, you are printing text to a MIDI device, which is probably why it stops playing.

Take a look at my MIDI Controller library, it does all you need, you just have to tell it what pins to use.

> **[GitHub - tttapa/MIDI\_controller: This is a library for creating a MIDI...](https://github.com/tttapa/MIDI_controller)**
>
> This is a library for creating a MIDI controller using an Arduino or Teensy board. - GitHub - tttapa/MIDI\_controller: This is a library for creating a MIDI controller using an Arduino or Teensy board.

Pieter

---

<div class="post-metadata">

**Author:** ![ElPedro1970](https://avatars.discourse-cdn.com/v4/letter/e/8e8cbc/32.png) [@ElPedro1970](https://forum.arduino.cc/u/ElPedro1970)\
**Post date:** [April 28, 2018, 12:54pm UTC](https://forum.arduino.cc/t/organ-bass-pedals/522926/4 "2018-04-28T12:54:21Z")

</div>

I'll check it out! Thank you!!!

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 5, 2021, 11:09pm UTC](https://forum.arduino.cc/t/organ-bass-pedals/522926/5 "2021-05-05T23:09:33Z")

</div>

Closed on May 5, 2021, 11:09pm UTC


