![](/media/cache/profiles/7c39a5f991bef4a1e34187677a65871d.jpg.50x50_q85.jpg)
Converting Piano Toy to MIDI Keyboard.
Dependencies: mbed mbed-STM32F103C8T6 USBDevice_STM32F103
How to turn kids' old piano toy to a MIDI keyboard
Inspired by http://www.codetinkerhack.com/2012/11/how-to-turn-piano-toy-into-midi.html I did the same with a Blue Pill module using Mbed.
The old toy was capable to play only one tone at a time:
Zoom in
A bit of reverse-engineering was needed to re-use the original printed boards. The results are below.
Original PCBs with switches traced to the connector pins:
Schematic:
Wiring:
Then I replaced the original chip with a Blue Pill module and added a USB connector:
Zoom in
Works great when connected over an USB cable to a Linux Ubuntu 18.04 machine
Installed software:
Yoshimi
: An excellent MIDI software synthesizer for Linux.
Zoom in
Patchage
: Provides a graphical interface to connect jack and midi inputs and outputs.
Zoom in
How to use it:
- Connect the Keyboard to the PC over an USB cable.
- Run
Yoshimi
. - Run
Patchage
and connect theMbed USB Audio MIDI 1
output toYoshimi
's input (dragMbed Audio MIDI 1
overyoshimi input
and drop)
- To apply the changes close the
Patchage
! - On
Yoshimi
's toolbar click onInstruments
and selectShow Stored ...
- Select a bank and click on the instrument you'd like to play.
Have fun :-)
MidiKey.h
- Committer:
- hudakz
- Date:
- 2020-04-09
- Revision:
- 1:41d2a3984dd7
- Parent:
- 0:75d307e38488
File content as of revision 1:41d2a3984dd7:
#ifndef MIDIKEY_H #define MIDIKEY_H #include "mbed.h" #include "USBMIDI.h" class MidiKey { public: MidiKey(USBMIDI& midi, uint8_t note, DigitalInOut& row, DigitalIn& col) : _midi(midi), _note(note), _row(row), _col(col), _position(0), _lastPos(0) {} virtual ~MidiKey() {} void scan(); private: USBMIDI& _midi; uint8_t _note; DigitalInOut& _row; DigitalIn& _col; uint8_t _position; uint8_t _lastPos; }; #endif // MIDIKEY_H