33Key Arduino midi piano help needed

Hi all, I have a question.
Is it possible to make a midi keyboard with my Arduino Uno and my 33 key piano

It has 4 rows, and 12 key columns

Can this be done without any other IC chips?
If so please suggest a method

Possibly. But you've given us no details of your "33 key piano". More information will be needed if you want any real help.

If you don't need any MIDI except basic NoteOn and NoteOff with no velocity, aftertouch, pitchbend, modulation or anything sophisticated then it may be fairly easy. It depends how easy it is to get at the key matrix.

Steve

Yes it's just basic note on off,
I have an Arduino Uno, I have 11 digital pins for the keys.
4 analogue pins for the columns

Do you know any code I could use or libraries not using a shift register.

I'm not sure how the keyboard matrix works as this is all new to me.
But it's as follows from how I can explain the wiring.

A0:Row 1
A1:Row 2
A2:Row 3
A4:Row 4

0:Key1
1:Key2
2:Key3
3:Key4
4:Key 5
5:Key 6
6:Key 7
7:Key 8
8:Key 9
9:Key 10
10:Key 11
11:Key 12

I also wrote a bit code to check each a0-a3 row for checking which key was high (pressed) but it didn't do each row separate, so I pressed key A1 being key a on row 1.
Went through all the keys and all the rows it said the same key. Row 2 said A1 too and 3 and 4

Do you know if there are any diodes in the matrix? And if so, how are they wired? I would expect something like this:

Pieter

This might help: Control Surface library: NoteButtonMatrixKeyboard example

All test pass, but I haven't been able to test it on the actual hardware, because I don't have a keyboard matrix at hand at the moment.

Pieter

PieterP:
This might help: Control Surface library: NoteButtonMatrixKeyboard example

All test pass, but I haven't been able to test it on the actual hardware, because I don't have a keyboard matrix at hand at the moment.

Pieter

I tried that, however it picks up all the key pressed tried with hairless Midi connected to ableton but it comes up as orange midi. Hairless set to 115200, the velocity is so low at 3, I'm so close but really need help as to why this is not giving me 127 velocity so Ableton picks it up

casperround64:
I tried that, however it picks up all the key pressed tried with hairless Midi connected to ableton but it comes up as orange midi.

I don't understand what you mean. And what is orange MIDI?

casperround64:
the velocity is so low at 3, I'm so close but really need help as to why this is not giving me 127 velocity so Ableton picks it up

Does it work if you use

USBDebugMIDI_Interface midi = 115200;

or HairlessMIDI_Interface midi; instead?
If you use the debug interface, open the serial monitor in the Arduino IDE and post what it prints.

Right in serial monitor I get note on/off on push and release of the key.
"Note On Channel: 1 Data 1: 0x37 Data 2: 0x7F"
However hairless can't read this and keeps saying unexpected data byte 0x37

The debug prints are fine, so it should work with Hairless as well.

Did you use the HairlessMIDI_Interface for testing with Hairless? The debug interface is just for printing the MIDI message, it doesn't work with Hairless. Did you set the baud rate to 115200?

I've added "HairlessMIDI_Interface midi;" but it comes up with does not name a type.

hopefully if i show my code you can possibly help me whee im going wong

/**

  • @brief This is an example to demonstrate the use of a ButtonMatrix.
  • Connections

    • A0-A3: The row pins of the button matrix (with the cathodes of the diodes)
    • 2-13: The column pins of the button matrix
    • A4-A5: Two push buttons (to ground) to transpose the keyboard
  • The internal pull-up resistors will be used.
  • Behavior

  • The keys of the keyboard should note on/off events when pressed/released.
  • The notes can be transposed by pressing the buttons connected to pins A4-A5.
  • Written by Pieter P, 27-01-2019
  • GitHub - tttapa/Control-Surface: Arduino library for creating MIDI controllers and other MIDI devices.
    */

#include <Control_Surface.h>
#include <MIDI.h>

HairlessMIDI_Interface midi;
// A transposer that can transpose the keyboard one octave lower or higher
Transposer<-12, +12> transposer;

// Buttons to transpose the keyboard
IncrementDecrementSelector<transposer.N> transposebuttons = {
transposer,
{A4, A5},
Wrap::NoWrap,
};

using namespace MIDI_Notes;
Bankable::NoteButtonMatrix<4, 12> keyboard = {
transposer,
{A0, A1, A2, A3}, // Row pins (driven Lo-Z LOW!)
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, // Column pins (input-pullup)
// All notes
{{
{
note(C, 2),
note(Db, 2),
note(D, 2),
note(Eb, 2),
note(E, 2),
note(F, 2),
note(Gb, 2),
note(G, 2),
note(Ab, 2),
note(A, 2),
note(Bb, 2),
note(B, 2),
},
{
note(C, 3),
note(Db, 3),
note(D, 3),
note(Eb, 3),
note(E, 3),
note(F, 3),
note(Gb, 3),
note(G, 3),
note(Ab, 3),
note(A, 3),
note(Bb, 3),
note(B, 3),
},
{
note(C, 4),
note(Db, 4),
note(D, 4),
note(Eb, 4),
note(E, 4),
note(F, 4),
note(Gb, 4),
note(G, 4),
note(Ab, 4),
note(A, 4),
note(Bb, 4),
note(B, 4),
},
{
note(C, 5),
note(Db, 5),
note(D, 5),
note(Eb, 5),
note(E, 5),
note(F, 5),
note(Gb, 5),
note(G, 5),
note(Ab, 5),
note(A, 5),
note(Bb, 5),
note(B, 5),
},
}},
};

void setup() { Control_Surface.begin(); }

void loop() { Control_Surface.loop(); }

I'm sorry, that was a problem with the library (my main testing platform is Teensy, and I forgot to include the HairlessMIDI_Interface for other Arduinos).

It should be fixed now (d5aaf6e), and you can download the latest version of the library.

On top of that, you don't have to include MIDI.h (it'll cause conflicts).

Thank you so much its woking now, just got to map my keys

Great to hear!
If you have any questions or remarks, just let me know. The library is still under development, so any feedback is welcome.