Constant output on keypad matrix midi

Hajo

Member
Hello,

I've put midi on a accordion with a arduino mega. I've changed to a teensy 4.1 for the native midi on usb.

Now I have a strange behavior on the keyboard matrix.

I have a 12 row 4 column matrix for the right hand. It worked fine with the Mega.

Now I get a constant midi output. Even if I don't attach any wires. Just a bare Teensy. I changed the pin (11) in the sketch, but the problem consists.

If I remove the last row on pin 11 it works fine. I can use the keyboard. But add the last row the constant output is back. I get the same note. D#

keypad.h has 12 rows as maximum.

I have to work out other issues to, but want to sort this out before wasting time on a broken teensy if that would be the case.

Could sombody give me a hint, I can't find anything.

Code:
#include <Keypad.h>

static const bool UseRunningStatus = false;

int val = 0;
int lastVal = 0;
unsigned long time_to_Measure = 0;
const int Measure_Period = 2000; // Update measurement every 2000 msec.

//MIDI_CREATE_DEFAULT_INSTANCE();

const byte ROWS = 11; 
const byte COLS = 4; 

//define the cymbols on the buttons of the keypads
char keys[ROWS][COLS] = {
{0,76,88,100},//E 22
{65,77,89,101},//F 23
{66,78,90,102},//F# 24
{67,79,91,103},//G 25
{68,80,92,104},//G# 26
{69,81,93,105},//A 27
{70,82,94,0},//A# 28
{71,83,95,0},//B 31
{72,84,96,0},//C 29
{73,85,97,0},//C# 30
{74,86,98,0}//,//D 32
{75,87,99,0}//D# 33
};


byte rowPins[ROWS] = {0,1,2,3,4,5,6,7,8,9,10,11}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {26,25,24,12}; //connect to the column pinouts of the keypad

const byte ROWSBAS = 6; 
const byte COLSBAS = 4; 
 
char keys2[ROWSBAS][COLSBAS] = {
  {38,44}, //D,G#
  {37,39}, //C#,D#
  {42,46}, //F#,A#
  {47,41}, //B,F
  {40,36}, //E,C
  {45,43} //A,G
  
  };

byte rowPins2[ROWSBAS] = {27,28,29,30,31,32}; //connect to the row pinouts of the keypad
byte colPins2[COLSBAS] = {34,33}; //connect to the column pinouts of the keypad

const byte ROWSBASAK = 6; 
const byte COLSBASAK = 2; 
 
char keysAK[ROWSBASAK][COLSBASAK] = {
  {45,39}, //A,D#,
  {44,38}, //G#,D,
  {43,37}, //G,C#,
  {42,36}, //F#,C,
  {41,47}, //F,B,
  {40,46} //E,A#,
  
  };

byte rowPinsAK[ROWSBASAK] = {27,28,29,30,31,32}; //connect to the row pinouts of the keypad
byte colPinsAK[COLSBASAK] = {36,35}; //connect to the column pinouts of the keypad


// registerdeel
const byte ROWSREG = 7; 
const byte COLSREG = 2; 
char keys3[ROWSREG][COLSREG] = {
  {48,54},
  {49},
  {50},
  {51},
  {52},
  {53}
  //{54}
};
byte rowPins3[ROWSREG] = {13,37,38,39,40,41};
byte colPins3[COLSREG] = {14,15};

Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
Keypad kpd2 = Keypad( makeKeymap(keys2), rowPins2, colPins2, ROWSBAS, COLSBAS); 
Keypad kpd3 = Keypad( makeKeymap(keys3), rowPins3, colPins3, ROWSREG, COLSREG); 
Keypad kpdAK = Keypad( makeKeymap(keysAK), rowPinsAK, colPinsAK, ROWSBASAK, COLSBASAK); 
 

String msg; //for debugging

// master volume part //  
byte analogPin = A2; 

void setup() {
 


kpd.setDebounceTime(100); //debounce 50 miliceconde
//kpd2.setDebounceTime(50); //debounce 50 miliceconde
//kpdAK.setDebounceTime(50); //debounce 50 miliceconde
//kpd.setHoldTime(50);
}

void loop() {
 
  volumepod();
  diskant();
  baskant();
  regdiskant();
 
}
// volume

void volumepod(){
  
if ((millis() - time_to_Measure) > Measure_Period) {

   val = analogRead(A2)/8;   // Divide by 8 to get range of 0-127 for midi
  if (val != lastVal) // If the value does not = the last value the following command is made. This is because the pot has been turned. Otherwise the pot remains the same and no midi message is output.
     {
   usbMIDI.sendControlChange(7, val, 1);
   usbMIDI.sendControlChange(7, val, 2);
   usbMIDI.sendControlChange(7, val, 3);
   usbMIDI.sendControlChange(7, val, 4);
   usbMIDI.sendControlChange(7, val, 5);
   usbMIDI.sendControlChange(7, val, 6);
   usbMIDI.sendControlChange(7, val, 7);
   usbMIDI.sendControlChange(7, val, 8);
   usbMIDI.sendControlChange(7, val, 9);
   usbMIDI.sendControlChange(7, val, 10);
   usbMIDI.sendControlChange(7, val, 11);
   usbMIDI.sendControlChange(7, val, 12);
   usbMIDI.sendControlChange(7, val, 13);
   usbMIDI.sendControlChange(7, val, 13);}         // cc control nummer (7 volume), waarde, kanaal
  
  lastVal = val;
time_to_Measure = millis();
//delay(10); //here we add a short delay to help prevent slight fluctuations, knocks on the pots etc. Adding this helped to prevent my pots from jumpin up or down a value when slightly touched or knocked.
}
}

// diskant knoppen
void diskant(){
    // Fills kpd.key[ ] array with up-to 10 active keys.
    // Returns true if there are ANY active keys.
    if (kpd.getKeys())
    {
        for (int i=0; i<LIST_MAX; i++)   // Scan the whole key list.
        {
            if ( kpd.key[i].stateChanged )   // Only find keys that have changed state.
            {
                int midinote = kpd.key[i].kchar; //convert the midi note to int from char
                
                switch (kpd.key[i].kstate) {  // Report active key state : IDLE, PRESSED, HOLD, or RELEASED
                    case PRESSED: //this messages are for debugging so they are not necessary.
                    //msg = " PRESSED.";
                    usbMIDI.sendNoteOn(midinote, 127, 1); //12 is an octave shift (I developed all the code so C1 was the lowest note. With this, it is C2 instead).
                    usbMIDI.sendNoteOn(midinote, 127, 4);
                    usbMIDI.sendNoteOn(midinote, 127, 5);
                    usbMIDI.sendNoteOn(midinote, 127, 6);
                    usbMIDI.sendNoteOn(midinote, 127, 7);
                    usbMIDI.sendNoteOn(midinote, 127, 8);
                    usbMIDI.sendNoteOn(midinote, 127, 9);
                    usbMIDI.sendNoteOn(midinote, 127, 10);
                    usbMIDI.sendNoteOn(midinote, 127, 11);
                    usbMIDI.sendNoteOn(midinote, 127, 12);
                    usbMIDI.sendPitchBend(-300,4);   //musset midden riet op toon
                    usbMIDI.sendPitchBend(-1035,5);  //Frans musette -18cent
                    usbMIDI.sendPitchBend(+448,6);   //Frans musette +18cent
                    usbMIDI.sendPitchBend(-820,7);   //Italiaans musette -13cent
                    usbMIDI.sendPitchBend(+245,8);   //Italiaans musette +13cent
                    usbMIDI.sendPitchBend(-770,9);   //Bayan musette -12cent
                    usbMIDI.sendPitchBend(+330,10);  //Bayan musette +15cent
                    usbMIDI.sendPitchBend(-610,11);   //Amerikaans musette -8cent
                    usbMIDI.sendPitchBend(+80,12);  //Amerikaans musette +8cent
                break;
                    case RELEASED:
                    //msg = " RELEASED.";
                    usbMIDI.sendNoteOff(midinote, 127, 1);
                    usbMIDI.sendNoteOff(midinote, 127, 4);
                    usbMIDI.sendNoteOff(midinote, 127, 5);
                    usbMIDI.sendNoteOff(midinote, 127, 6);
                    usbMIDI.sendNoteOff(midinote, 127, 7);
                    usbMIDI.sendNoteOff(midinote, 127, 8);
                    usbMIDI.sendNoteOff(midinote, 127, 9);
                    usbMIDI.sendNoteOff(midinote, 127, 10);
                    usbMIDI.sendNoteOff(midinote, 127, 11);
                    usbMIDI.sendNoteOff(midinote, 127, 12); 
                break;
                case HOLD:
              usbMIDI.sendNoteOn(midinote, 127, 1); //12 is an octave shift (I developed all the code so C1 was the lowest note. With this, it is C2 instead).
                    usbMIDI.sendNoteOn(midinote, 127, 4);
                    usbMIDI.sendNoteOn(midinote, 127, 5);
                    usbMIDI.sendNoteOn(midinote, 127, 6);
                    usbMIDI.sendNoteOn(midinote, 127, 7);
                    usbMIDI.sendNoteOn(midinote, 127, 8);
                    usbMIDI.sendNoteOn(midinote, 127, 9);
                    usbMIDI.sendNoteOn(midinote, 127, 10);
                    usbMIDI.sendNoteOn(midinote, 127, 11);
                    usbMIDI.sendNoteOn(midinote, 127, 12);
                    usbMIDI.sendPitchBend(-300,4);   //musset midden riet op toon
                    usbMIDI.sendPitchBend(-1035,5);  //Frans musette -18cent
                    usbMIDI.sendPitchBend(+448,6);   //Frans musette +18cent
                    usbMIDI.sendPitchBend(-820,7);   //Italiaans musette -13cent
                    usbMIDI.sendPitchBend(+245,8);   //Italiaans musette +13cent
                    usbMIDI.sendPitchBend(-770,9);   //Bayan musette -12cent
                    usbMIDI.sendPitchBend(+330,10);  //Bayan musette +15cent
                    usbMIDI.sendPitchBend(-610,11);   //Amerikaans musette -8cent
                    usbMIDI.sendPitchBend(+80,12);  //Amerikaans musette +8cent 
                break;
                case IDLE:
              usbMIDI.sendNoteOff(midinote, 127, 1);
                    usbMIDI.sendNoteOff(midinote, 127, 4);
                    usbMIDI.sendNoteOff(midinote, 127, 5);
                    usbMIDI.sendNoteOff(midinote, 127, 6);
                    usbMIDI.sendNoteOff(midinote, 127, 7);
                    usbMIDI.sendNoteOff(midinote, 127, 8);
                    usbMIDI.sendNoteOff(midinote, 127, 9);
                    usbMIDI.sendNoteOff(midinote, 127, 10);
                    usbMIDI.sendNoteOff(midinote, 127, 11);
                    usbMIDI.sendNoteOff(midinote, 127, 12); 
                   
                   
                break;
                }
  
            }
        }
    }
}


// einde diskant
// bas knoppen
void baskant (){
             
if (kpd2.getKeys())
    {
        for (int i=0; i<LIST_MAX; i++)   // Scan the whole key list.
       
          if ( kpd2.key[i].stateChanged )   // Only find keys that have changed state.
           {
           int midinote = kpd2.key[i].kchar; //convert the midi note to int from char
           
            switch (kpd2.key[i].kstate) {  // Report active key state : IDLE, PRESSED, HOLD, or RELEASED
                    case PRESSED: //this messages are for debugging so they are not necessary.
                    //msg = " PRESSED.";
                    usbMIDI.sendNoteOn(midinote, 127, 2); //(midinote+12, 127, 1) 
                
                break;
                    case RELEASED:
                    //msg = " RELEASED.";
                   // usbMIDI.sendControlChange(123,0,2);
                    usbMIDI.sendNoteOff(midinote, 120, 2);
                
                break;
                case HOLD:
                 usbMIDI.sendNoteOn(midinote, 127, 2);
                break;
                case IDLE:
                //usbMIDI.sendControlChange(123,0,2);
                usbMIDI.sendNoteOff(midinote+12, 120, 2);
                break;
                }
                break;
               delay(30);
                }
              }
            
if (kpdAK.getKeys())
    {
        for (int i=0; i<LIST_MAX; i++)   // Scan the whole key list.
       
          if ( kpdAK.key[i].stateChanged )   // Only find keys that have changed state.
           {
           int midinote = kpdAK.key[i].kchar; //convert the midi note to int from char
           
            switch (kpdAK.key[i].kstate) {  // Report active key state : IDLE, PRESSED, HOLD, or RELEASED
                    case PRESSED: //this messages are for debugging so they are not necessary.
                    //msg = " PRESSED.";
                    usbMIDI.sendNoteOn(midinote, 127, 3); //(midinote+12, 127, 1) 
                  //  usbMIDI.sendNoteOn(midinote+12, 120, 2);
                break;
                    case RELEASED:
                    //msg = " RELEASED.";
                 //   usbMIDI.sendControlChange(123,0,3);
                    usbMIDI.sendNoteOff(midinote+12, 120, 2);//(midinote+12, 127, 1)
                break;
                case HOLD:
                usbMIDI.sendNoteOn(midinote, 127, 3);
                break;
                case IDLE:
                //usbMIDI.sendControlChange(123,0,3);
                usbMIDI.sendNoteOff(midinote+12, 120, 2);
                break;
                }
                break;
               delay(30);
                }
              }
            }  
            
// einde bas
// disregister

void regdiskant(){
if (kpd3.getKeys())
    {
        for (int i=0; i<LIST_MAX; i++)   // Scan the whole key list.
        {
            if ( kpd3.key[i].stateChanged )   // Only find keys that have changed state.
            {
                int midinote = kpd3.key[i].kchar; //convert the midi note to int from char
                
                switch (kpd3.key[i].kstate) {  // Report active key state : IDLE, PRESSED, HOLD, or RELEASED
                    case PRESSED: //this messages are for debugging so they are not necessary.
                    //msg = " PRESSED.";
                    usbMIDI.sendNoteOn(midinote, 127, 1); 
                    usbMIDI.sendNoteOn(midinote, 127, 4); 
                    usbMIDI.sendNoteOn(midinote, 127, 5); 
                    usbMIDI.sendNoteOn(midinote, 127, 6); 
                    usbMIDI.sendNoteOn(midinote, 127, 8); 
                    usbMIDI.sendNoteOn(midinote, 127, 9); 
                    usbMIDI.sendNoteOn(midinote, 127, 10);
                    usbMIDI.sendNoteOn(midinote, 127, 11); 
                    usbMIDI.sendNoteOn(midinote, 127, 12); 
                     
                break;
                    case RELEASED:
                    //msg = " RELEASED.";
                    usbMIDI.sendNoteOff(midinote, 127, 1); //(midinote+12, 127, 1)
                    usbMIDI.sendNoteOff(midinote, 127, 4);
                    usbMIDI.sendNoteOff(midinote, 127, 5);
                    usbMIDI.sendNoteOff(midinote, 127, 6);
                    usbMIDI.sendNoteOff(midinote, 127, 7);
                    usbMIDI.sendNoteOff(midinote, 127, 8);
                    usbMIDI.sendNoteOff(midinote, 127, 9);
                    usbMIDI.sendNoteOff(midinote, 127, 10);
                    usbMIDI.sendNoteOff(midinote, 127, 11);
                    usbMIDI.sendNoteOff(midinote, 127, 12); 
                break;
                case HOLD:
                usbMIDI.sendNoteOn(midinote, 127, 1); 
                    usbMIDI.sendNoteOn(midinote, 127, 4); 
                    usbMIDI.sendNoteOn(midinote, 127, 5); 
                    usbMIDI.sendNoteOn(midinote, 127, 6); 
                    usbMIDI.sendNoteOn(midinote, 127, 8); 
                    usbMIDI.sendNoteOn(midinote, 127, 9); 
                    usbMIDI.sendNoteOn(midinote, 127, 10);
                    usbMIDI.sendNoteOn(midinote, 127, 11); 
                    usbMIDI.sendNoteOn(midinote, 127, 12); 
                break;
                case IDLE:
                usbMIDI.sendNoteOff(midinote, 127, 1); //(midinote+12, 127, 1)
                    usbMIDI.sendNoteOff(midinote, 127, 4);
                    usbMIDI.sendNoteOff(midinote, 127, 5);
                    usbMIDI.sendNoteOff(midinote, 127, 6);
                    usbMIDI.sendNoteOff(midinote, 127, 7);
                    usbMIDI.sendNoteOff(midinote, 127, 8);
                    usbMIDI.sendNoteOff(midinote, 127, 9);
                    usbMIDI.sendNoteOff(midinote, 127, 10);
                    usbMIDI.sendNoteOff(midinote, 127, 11);
                    usbMIDI.sendNoteOff(midinote, 127, 12); 
                break;
                }
                
            }
        }
    }
}

 //einde disregister
 
Hajo:
I believe the Arduino Mega is a 5V device, and I know the Teensy 4.1 is a 3.3V device. Did you compensate for this difference in the hardware?
If not you may have let the smoke out of the Teensy 4.1 (Destroyed it!).

Regards,
Ed
 
SbFreddie,

Thank you for your answer.

The hardware has no power itself. It runs on the power of the Teensy.

Regards.
 
Your code doesn't compile. This array declaration has two errors.
Code:
const byte ROWS = 11; 
const byte COLS = 4;

char keys[ROWS][COLS] = {
{0,76,88,100},//E 22
{65,77,89,101},//F 23
{66,78,90,102},//F# 24
{67,79,91,103},//G 25
{68,80,92,104},//G# 26
{69,81,93,105},//A 27
{70,82,94,0},//A# 28
{71,83,95,0},//B 31
{72,84,96,0},//C 29
{73,85,97,0},//C# 30
{74,86,98,0}//,//D 32   <<< the comma has been commented out
{75,87,99,0}//D# 33
};
Even if you include the comma for D32, you then have the problem that the array is declared to have 11 rows but you initialize it with 12 rows.

Pete
 
There's another array which causes an error but both problems are fixed if you define ROWS to be 12 instead of 11.
Code:
const byte ROWS = 12;

Now it compiles.
Pete
 
Thank you.

You are right. Should be 11 and an extra comma.

I made that error in messiing around with options. And I looked over it on copying for thit thread. My apologies. With row 12 and the comma issue away it still makes the unwanted output.

I'll correct the sketch on the forum. So i don't wast your time.

Regards
 
I fixed the error here and your code does indeed blast out a lot of MIDI stuff, but not only D#.
Here's a piece of a log from MIDI-OX.
Code:
 ===> MIDI-OX Version: 7.0.2.372
 ===> Log Opened: Sun 27-Feb-2022 14:02:28 ===>
 TIMESTAMP IN PORT STATUS DATA1 DATA2 CHAN NOTE EVENT               
 0000003D   2  --     80    40    7F    1  E  4 Note Off              
 0000003D   2  --     83    40    7F    4  E  4 Note Off              
 0000003D   2  --     84    40    7F    5  E  4 Note Off              
 0000003D   2  --     85    40    7F    6  E  4 Note Off              
 0000003D   2  --     86    40    7F    7  E  4 Note Off              
 0000003D   2  --     87    40    7F    8  E  4 Note Off              
 0000003D   2  --     88    40    7F    9  E  4 Note Off              
 0000003D   2  --     89    40    7F   10  E  4 Note Off              
 0000003D   2  --     8A    40    7F   11  E  4 Note Off              
 0000003D   2  --     8B    40    7F   12  E  4 Note Off              
 0000003D   2  --     80    63    7F    1  Eb 7 Note Off              
 0000003D   2  --     83    63    7F    4  Eb 7 Note Off              
 0000003D   2  --     84    63    7F    5  Eb 7 Note Off              
 0000003D   2  --     85    63    7F    6  Eb 7 Note Off              
 0000003D   2  --     86    63    7F    7  Eb 7 Note Off              
 0000003D   2  --     87    63    7F    8  Eb 7 Note Off              
 0000003D   2  --     88    63    7F    9  Eb 7 Note Off              
 0000003D   2  --     89    63    7F   10  Eb 7 Note Off              
 0000003D   2  --     8A    63    7F   11  Eb 7 Note Off              
 0000003E   2  --     8B    63    7F   12  Eb 7 Note Off              
 0000005D   2  --     B0    07    7F    1  ---  CC: Volume            
 0000005D   2  --     B1    07    7F    2  ---  CC: Volume            
 0000005D   2  --     B2    07    7F    3  ---  CC: Volume            
 0000005D   2  --     B3    07    7F    4  ---  CC: Volume            
 0000005D   2  --     B4    07    7F    5  ---  CC: Volume            
 0000005D   2  --     B5    07    7F    6  ---  CC: Volume            
 0000005D   2  --     B6    07    7F    7  ---  CC: Volume            
 0000005D   2  --     B7    07    7F    8  ---  CC: Volume            
 0000005D   2  --     B8    07    7F    9  ---  CC: Volume            
 0000005D   2  --     B9    07    7F   10  ---  CC: Volume            
 0000005D   2  --     BA    07    7F   11  ---  CC: Volume            
 0000005D   2  --     BB    07    7F   12  ---  CC: Volume            
 0000005D   2  --     BC    07    7F   13  ---  CC: Volume            
 0000005D   2  --     BC    07    7F   13  ---  CC: Volume            
 000000A2   2  --     80    40    7F    1  E  4 Note Off              
 000000A2   2  --     83    40    7F    4  E  4 Note Off              
 000000A2   2  --     84    40    7F    5  E  4 Note Off              
 000000A2   2  --     85    40    7F    6  E  4 Note Off              
 000000A2   2  --     86    40    7F    7  E  4 Note Off              
 000000A2   2  --     87    40    7F    8  E  4 Note Off              
 000000A2   2  --     88    40    7F    9  E  4 Note Off              
 000000A2   2  --     89    40    7F   10  E  4 Note Off              
 000000A2   2  --     8A    40    7F   11  E  4 Note Off              
 000000A2   2  --     8B    40    7F   12  E  4 Note Off              
 000000A2   2  --     80    63    7F    1  Eb 7 Note Off              
 000000A2   2  --     83    63    7F    4  Eb 7 Note Off              
 000000A2   2  --     84    63    7F    5  Eb 7 Note Off              
 000000A2   2  --     85    63    7F    6  Eb 7 Note Off              
 000000A2   2  --     86    63    7F    7  Eb 7 Note Off              
 000000A2   2  --     87    63    7F    8  Eb 7 Note Off              
 000000A2   2  --     88    63    7F    9  Eb 7 Note Off              
 000000A2   2  --     89    63    7F   10  Eb 7 Note Off              
 000000A2   2  --     8A    63    7F   11  Eb 7 Note Off              
 000000A2   2  --     8B    63    7F   12  Eb 7 Note Off              
 00000107   2  --     90    4B    7F    1  Eb 5 Note On               
 00000107   2  --     93    4B    7F    4  Eb 5 Note On               
 00000107   2  --     94    4B    7F    5  Eb 5 Note On               
 00000107   2  --     95    4B    7F    6  Eb 5 Note On               
 00000107   2  --     96    4B    7F    7  Eb 5 Note On               
 00000107   2  --     97    4B    7F    8  Eb 5 Note On               
 00000107   2  --     98    4B    7F    9  Eb 5 Note On               
 00000107   2  --     99    4B    7F   10  Eb 5 Note On               
 00000107   2  --     9A    4B    7F   11  Eb 5 Note On               
 00000107   2  --     9B    4B    7F   12  Eb 5 Note On               
 00000107   2  --     E3    54    3D    4  ---  Pitch Bend            
 00000107   2  --     E4    75    37    5  ---  Pitch Bend            
 00000107   2  --     E5    40    43    6  ---  Pitch Bend            
 00000107   2  --     E6    4C    39    7  ---  Pitch Bend            
 00000107   2  --     E7    75    41    8  ---  Pitch Bend            
 00000107   2  --     E8    7E    39    9  ---  Pitch Bend            
 00000107   2  --     E9    4A    42   10  ---  Pitch Bend            
 00000107   2  --     EA    1E    3B   11  ---  Pitch Bend            
 00000107   2  --     EB    50    40   12  ---  Pitch Bend            
 00000108   2  --     90    63    7F    1  Eb 7 Note On               
 00000108   2  --     93    63    7F    4  Eb 7 Note On               
 00000108   2  --     94    63    7F    5  Eb 7 Note On               
 00000108   2  --     95    63    7F    6  Eb 7 Note On               
 00000108   2  --     96    63    7F    7  Eb 7 Note On               
 00000108   2  --     97    63    7F    8  Eb 7 Note On               
 00000108   2  --     98    63    7F    9  Eb 7 Note On               
 00000108   2  --     99    63    7F   10  Eb 7 Note On               
 00000108   2  --     9A    63    7F   11  Eb 7 Note On               
 00000108   2  --     9B    63    7F   12  Eb 7 Note On               
 00000108   2  --     E3    54    3D    4  ---  Pitch Bend            
 00000108   2  --     E4    75    37    5  ---  Pitch Bend            
 00000108   2  --     E5    40    43    6  ---  Pitch Bend            
 00000108   2  --     E6    4C    39    7  ---  Pitch Bend            
 00000108   2  --     E7    75    41    8  ---  Pitch Bend            
 00000108   2  --     E8    7E    39    9  ---  Pitch Bend            
 00000108   2  --     E9    4A    42   10  ---  Pitch Bend            
 00000108   2  --     EA    1E    3B   11  ---  Pitch Bend            
 00000108   2  --     EB    50    40   12  ---  Pitch Bend

At the moment I can't see what's causing it but it must be something pretty obvious :)

Pete
 
It won't cause the main problem but the volumepod function sends two CC 13
Code:
      usbMIDI.sendControlChange(7, val, 12);
      usbMIDI.sendControlChange(7, val, 13);
      usbMIDI.sendControlChange(7, val, 13);
;

Pete
 
Hi Pete,

Thank you so much for testing.

So it is a problem with the sketch.

I take it happened when I altered it for the teensy. I'll build it up from scratch and where I went wrong.

With kind regards,

Hajo
 
Thank you all for the replies.

I rewired the switches to another matrix. Tested extra pull-up and pull-down resistor options. But still I can't get over 24 Mhz CPU speed without getting rubbish.

Along with other problems with reading multiple switches and a new option for the accordion I put the midi in, I want to change the entire system.

I want to use hall effect switches for reading the key pressing. For that I would like some general advice. I'll put a request in another post.

Regards.
 
Code:
byte rowPins[B][ROWS] = {0,[/B]1,2,3,4,5,6,7,8,9,10,11}; //connect to the row pinouts of the keypad,  PIN 0 USED HERE
byte colPins[COLS] = {26,25,24,12}; //connect to the column pinouts of the keypad

const byte ROWSBAS = 6; 
const byte[B] COLSBAS = 4; [/B]
 
char keys2[ROWSBAS][COLSBAS] = {
  {38,44}, //D,G#
  {37,39}, //C#,D#
  {42,46}, //F#,A#
  {47,41}, //B,F
  {40,36}, //E,C
  {45,43} //A,G
  
  };

byte rowPins2[ROWSBAS] = {27,28,29,30,31,32}; //connect to the row pinouts of the keypad
byte colPins2[B][COLSBAS] = {34,33};[/B] //connect to the column pinouts of the keypad

Pin 0 has been assigned to both a row and a column. Since COLSBAS is 4 this line of code:
byte colPins2[COLSBAS] = {34,33}; is really
byte colPins2[COLSBAS] = {34,33,0,0};

I have no knowledge of MIDI, so not sure if that would produce a D# note.
 
Back
Top