I love those little fidget toys that sound like bubble wrap popping. I also really like to bother my friends with music that sounds like it's a phone ringtone from the 90s.
This takes a 4x4 keypad (or 4x4 button system) and each button is one note on the D Major scale (starting at C1 to G2).

Future Additions:
- Optimize code
- Long press on keypad for long note hold
- Button to switch scales
EXPANDED TECHNICAL DETAILS
Matrix-Input Musical Instrument
This project transforms a standard numeric keypad into a polyphonic-feel digital synthesizer, ideal for learning basic music theory and matrix scanning.
- 4x4 Keyboard Matrix Scanning: The Arduino uses the
Keypad.hlibrary to scan 16 tactile buttons using only 8 digital pins. The firmware maps each key to a specific musical frequency (e.g., '1' = C4, '2' = D4). - Tone Frequency Lookup: Every keypress triggers the
tone()function on a piezo buzzer. The Arduino looks up the pre-defined frequency from a chromatic scale array, providing accurate pitch reproduction.
Educational Logic
- Octave Scaling: (Advanced version) Includes a "Shift" button that allows the keypad to cycle through three different octaves, expanding the instrument's range from 16 to 48 notes.