Artificial intelligence and art. We have seen them create images, process videos, and write films, but what about music? Developing a compatible interface between an AI and any classical instrument would be an extraordinary project by itself, but what we have here today is PianoAI, a platform loaded on a Raspberry Pi that connects to a MIDI keyboard and "improvises" notes that it learned with the help of a pianist.

PianoAI: An artificial intelligence with a Raspberry Pi learns to play the piano
PianoAI

Artificial intelligence is a very active topic of debate, and we have even seen some notable differences among the big names in the industry. Without going too far, Mark Zuckerberg thinks that the "AI apocalypse" is an exaggeration; however, Elon Musk has emphasized its risks on more than one occasion. In the meantime, artificial intelligences continue learning. Training methods are increasingly efficient and precise, and another important factor is that they assimilate their mistakes quickly. A good example is manifested through PianoAI.

How PianoAI works

Basically, the goal of this artificial intelligence is to accompany and "fill the holes" of a melody with its own notes, as long as the pianist takes the trouble to share a bit of feedback beforehand. The original Python-based version sounds quite bad, although with a good dose of training it managed to improve, but it never abandoned that slowness and disconnect seen in the video. Its developer (whom we know as Zack) then switched to Go, which allowed it to achieve superior performance and use the resources of a Raspberry Pi at the same time (initially it ran the code using a traditional computer).

On its official page we can find many additional details about the complete development process, including the most serious problems it had to face. At one point it tried to apply neural networks, but the results were so bad that it leaned toward Markov chains. All the code is available on GitHub, and in the future PianoAI will probably add other functions, such as saving sessions in MIDI format and integrating a greater number of routines.

Official site:

Access the code: