Ebay Classic organs

Collapse

Announcement

Collapse
No announcement yet.

32 note Pedal Teency 2 code

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 32 note Pedal Teency 2 code

    Well....I am an idiot! Its been a while since I downloaded an Arduino Teeny 2 32 pedal code controller and, due to ensuing computer crashes, I can't find the code. WORSE: the arduino board appears to be ruined...possibly as I fussed trying to rewire to a new pedal board.

    So...I now have a new Teensy 2.

    The code I uploaded issues that classic 'bounce file not recognized' (or something to that effect). The code has an 'include<bounce.h> in I believe the definitions area. And in the LOOP is the LIST of bounce keys I presume. Here is the code (yes. its a sketch...that may be the problem>)

    // All in one Pedal board / Expression / Pistons encoder
    // by Tim Howard, Jan 2014
    // Freeware, may be freely copied as required.
    // Thanks to Dennis Chan ( )
    #include <Bounce.h>

    //which MIDI channel to use
    #define MIDICHANNEL 3
    // MIDI value of low C
    #define LOW_C 36
    //how sensitive expression pedals are, reduce to make more sensitive
    #define POTSENSE 10

    // Pin assignments for Teensy 2.0 ++
    //skipping LED pin and pin 3 in case we want LCD display later
    //these are the pins for the 32 pedalboard notes
    byte pedalBoardPins[33]={
    0,1,2,4,5, 7,8,9,10,11, 12,13,14,15,16, 17,18,19,20,21, 22,23,24,25,26, 27,28,29,30,31, 32,33};
    //these are the pins for pistons
    //byte pistonPins[12]= {
    //34,35,36,37, 38,39,40,41,42, 43,44,45};
    //these are the pins for expression pedals
    byte expressionPins[4] = {
    42, 43,44,45};

    //this determines which MIDI control Numbers to use
    byte midicontrol[4] = {1,7,11,13}; //default to Modulation Wheel, Volume, and Expression

    //to hold previous input from expression pedals
    int lastpotvalue[4]= {
    0,0,0,0};

    //to hold currently scanned expression pedals value
    int potValue=0;

    //this is an array of Bounce pin handlers, not all of which will actually be used
    Bounce bouncePins[46] = {
    Bounce(0,5),
    Bounce(1,5),
    Bounce(2,5),
    Bounce(3,5),
    Bounce(4,5),
    Bounce(5,5),
    Bounce(6,5),
    Bounce(7,5),
    Bounce(8,5),
    Bounce(9,5),
    Bounce(10,5),
    Bounce(11,5),
    Bounce(12,5),
    Bounce(13,5),
    Bounce(14,5),
    Bounce(15,5),
    Bounce(16,5),
    Bounce(17,5),
    Bounce(18,5),
    Bounce(19,5),
    Bounce(20,5),
    Bounce(21,5),
    Bounce(22,5),
    Bounce(23,5),
    Bounce(24,5),
    Bounce(25,5),
    Bounce(26,5),
    Bounce(27,5),
    Bounce(28,5),
    Bounce(29,5),
    Bounce(30,5),
    Bounce(31,5),
    Bounce(32,5),
    Bounce(33,5),
    Bounce(34,5),
    Bounce(35,5),
    Bounce(36,5),
    Bounce(37,5),
    Bounce(38,5),
    Bounce(39,5),
    Bounce(40,5),
    Bounce(41,5),
    Bounce(42,5),
    Bounce(43,5),
    Bounce(44,5),
    Bounce(45,5)
    };

    // void setup(){
    //setup pin directions
    // for (int i=0; i<33; i++) {
    // pinMode(pedalBoardPins[i],INPUT_PULLUP);
    // };




    // void loop(){
    //update pedalboard status
    // for (int i=0; i<33; i++) {
    // bouncePins[pedalBoardPins[i]].update();
    // }
    //update pistons status
    //for (int i=0; i<12; i++) {
    //bouncePins[pistonPins[i]].update();

    //process pedalboard notes
    // for (int i=0; i<33; i++) {
    // if (bouncePins[pedalBoardPins[i]].fallingEdge()) {
    // usbMIDI.sendNoteOn(LOW_C + i, 99, MIDICHANNEL);
    // }
    // else if (bouncePins[pedalBoardPins[i]].risingEdge()) {
    // usbMIDI.sendNoteOff(LOW_C + i, 0, MIDICHANNEL);
    // }
    //process pistons
    //for (int i=0; i<12; i++) {
    //if (bouncePins[pistonPins[i]].fallingEdge()) {
    // usbMIDI.sendProgramChange(i+1,MIDICHANNEL);
    //}
    //}

    //process expression panels
    // for (int i=0; i<4; i++) {
    // potValue=analogRead(expressionPins[i]);
    // if (abs(lastpotvalue[i] - potValue) > POTSENSE) {
    //potvalue should be between 0 and 1024, we need a number between 0 and 127
    // int midipotvalue=(potValue / 8)-1; //should result in max value of 127
    // usbMIDI.sendControlChange( midicontrol[i] ,midipotvalue,MIDICHANNEL);
    // lastpotvalue[i]=potValue;}



    CAN SOME CONSIDERATE FORUM MEMBER PLEASE EMAIL HIS PEDAL CONTROL CODE TO MY ATTENTION?

  • #2
    I think this was covered recently on the forum. You have to set the software to the correct board, and make sure the output is set to USB Midi when uploading the sketch. Interesting code though, thanks for posting!

    Current: Allen 225 RTC, W. Bell reed organ, Lowrey TGS, Singer upright grand
    Former: Yamaha E3R
    https://www.exercisesincatholicmythology.com

    Comment


    • #3
      It looks like you need to install the bounce library. In the Arduino IDE, select menu option Tools/Manage Library. Search for the bounce library and add it.

      And by the way, large parts of that code are commented out. Did you do that on purpose?

      Comment


      • Admin
        Admin commented
        Editing a comment
        Good catch. "Large parts commented out" is an understatement. The entire program is commented out save the variable initialization.

      • orgoblo
        orgoblo commented
        Editing a comment
        No. The cc evidently added the hash marks. Thanks about the bounce library. I think what it is: The sketch was lifted from one's IDE (?) arduino work space that DID include these library adjuncts specified in '#include.... I wonder whether my arduino IDE version omits what might be incuded in this fellow's work area. Yah...those slash marks in the cc I show are crazy. NOTHING would run!! Hm...yet 'verify' may well work if I clear up this library issue. Funny!

    • #4
      Interestingly: NO ONE has volunteered the email of their arduino pedal 'encoder' (not sure that is the right word). Maybe they consider it somewhat 'private'? For sure there are a few offered on such as uTube or even this forum. But the same issue: I do 'verify' of the COPIED code and surely get the 'no definition' error. I will load the library definitions and then try to compile again. POINT IS: I was hoping to avoid becoming even an amateur codifier as i have revisited my VTPO. I am sorry the well used and reliable pedal Arduino has somehow been corrupted...the code was perfect. But..that was 10 years ago. I've LOST the file. Boo hoo!

      Comment


    • #5
      I was going to say if you install the correct library and uncomment the appropriate areas of the code, you shouldn't have to do any actual programming, but a quick glance at the code (it's hard to see because there is no indentation) makes me think that the braces are unbalanced and that code would not compile properly.

      My application reads MIDI from my VPO (GrandOrgue), but it doesn't scan the pedals, so I don't have anything I could give you that would help.
      Last edited by tbeck; 08-02-2022, 04:02 PM. Reason: Changed brackets to braces.

      Comment


      • #6
        Thank you forum. I plan to work this a bit later. And thanks so much for the pedal scanner code! I really believe my issue has been lack of library calls.

        To be honest, I have a couple of spare midi keyboards. I have already installed magnetic 'door' sensors on the Rodgers pedal board (has magnets stapled to the pedal faces). i can simply MAKE the midi keyboard Fatar switches with the pedal board magnetic reed switches and VOILA11 MIDI PEDALS! even epxression shoes can be realized via the midi keybaord. Now admittedly: This idea is pretty lazy lame redneck. Yet...NO CODING! No errata to interpret and then correct code. No code hunts. NO ARDUINO anything! And MIDI keyboards are a dime a dozen at GoodWill even! decase the keyboard, extricate the Fatar switch PCB, solder the magnet reed switches to the common and the high side of each fatar switch. Mount the mess as required (eg: maybe under the pedal board; maybe the consoile base??) and done deal. IF the thing fails 10 years down the road, you won't need to REVIEW/RELEAN C++ or such. Just get another MIDI keyboard (I suppose). Well.. it may be by that time the concept of playing organ pedals with our feet will be passe. We will just THINK the pedal plays??

        Comment

        Hello!

        Collapse

        Looks like you’re enjoying the discussion, but you haven’t signed up for an account yet.

        Tired of scrolling through the same posts? When you create an account you’ll always come back to where you left off. With an account you can also post messages, be notified of new replies, join groups, send private messages to other members, and use likes to thank others. We can all work together to make this community great. ♥️

        Sign Up

        Working...
        X