Organ Bass Pedals

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!_

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

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.

Pieter

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