
Tiny Piano is an 8-key piano covering one octave of the C major scale, from C4 to C5.
Each input is one key. The chip plays the selected note as a square wave and shows its letter on a 7-segment display. It plays one note at a time: the first key pressed is held until it is released. If several keys are pressed at the same moment, the lowest note wins.
The design has three blocks:
Set the clock to 1 MHz and reset the design. Hold one of the inputs high:
| Input | Note | Frequency (Hz) | Display |
|---|---|---|---|
| ui[0] | C4 | 261.6 | C |
| ui[1] | D4 | 293.6 | d |
| ui[2] | E4 | 329.6 | E |
| ui[3] | F4 | 349.2 | F |
| ui[4] | G4 | 391.8 | G |
| ui[5] | A4 | 440.1 | A |
| ui[6] | B4 | 494.1 | b |
| ui[7] | C5 | 523.0 | c |
The note plays while the key is held. With no key held, the audio output is low and the display is blank.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | Key C4 | SEG_A | |
| 1 | Key D4 | SEG_B | |
| 2 | Key E4 | SEG_C | |
| 3 | Key F4 | SEG_D | |
| 4 | Key G4 | SEG_E | |
| 5 | Key A4 | SEG_F | |
| 6 | Key B4 | SEG_G | |
| 7 | Key C5 | AUDIO |