Raspberry Pi Piano Player AI
This is code for providing an augmented piano playing experience. When run, this code will provide computer accompaniment that learns in real-time from the human host pianist. Then the host pianist stops playing for a given amount of time, the computer AI will then improvise in the space using the style learned from the host.
Try it
- Get a MIDI-enabled keyboard and two-way MIDI adapter
- Get a Raspberry Pi (however, a Windows / Linux / OS X computer should also work) and connect it to the MIDI keyboard.
- Build latest version of
libportmidi(if your using Mac just dobrew install portmidi, if Windows just Download it))
sudo apt-get install cmake-curses-gui libasound2-dev
git clone https://github.com/aoeu/portmidi.git
cd portmidi
ccmake . # press in sequence: c, e, c, e, g
make
sudo make install
- Install Go.
- Install
rpiai-piano:
go get -v github.com/schollz/rpiai-piano
- Add
export LD_LIBRARY_PATH=/usr/local/libto your.bashrc. (Unnessecary if you did not buildportmidi). Reload bashsource ~/.bashrcif this is the first time. - Play!
rpiai-piano
TODO
- External script that will start/stop piano based on plugging in Midi
- Put links to code on Youtube videos (link to tree)
- If a config file is not present, use default values and create one for next time (and send a message to the user)
- Add a new button for reseting the system
- Add a function for shutting down
- Add command line functions
Acknowledgements
Thanks to @egonelbre for the Gopher graphic.
Thanks to @rakyll for porting libportmidi to Go.
License
portmidi is Licensed under Apache License, Version 2.0.