Skip to content

Latest commit

 

History

History
executable file
·
43 lines (33 loc) · 1.8 KB

README.md

File metadata and controls

executable file
·
43 lines (33 loc) · 1.8 KB

fake_piano

Play any piece on the piano with no musical knowledge.

The notes played on the piano will be replaced in realtime by those specified in a MIDI file previously configured, allowing you to playback the original melody pressing random keys.

Although the program has been designed to use a digital piano as input device and a MIDI port as output, it is possible to use any input or output providing its implementation.

Installation

Minimum requirements

Python3 is required to execute the scripts. Aditionally, you may need to install these tools for proper functioning.

  • Mido - MIDI file and message handling
pip install mido
pip install python-rtmidi

Optional requirements

To extend compatibility with other input/output devices it may be necessary to install their corresponding third party drivers or libraries.

pip install pyFluidSynth
  • pynput - Necessary for KeyboardOutput to work.
pip install pynput
pip install pyPS4Controller

Usage

The program consists of two basic parts, the reading of MIDI files and their playback. The classes corresponding to each main task are Reader and Player respectively.

The Reader object is used to read a MIDI file and create a Playable object which the Player is able to play.

The Player object is responsible for reading the messages sent by the chosen input device and modifying them before sending them to the configured output device.