
Making a Raspberry Pi-Powered AI to Play Piano - qrv3w
https://rpiai.com/piano/
======
SunChrono
Those interested in computer generated music may find some pragmatic ideas in
this paper from 1989:

[http://peterlangston.com/Papers/amc.pdf](http://peterlangston.com/Papers/amc.pdf)

~~~
qrv3w
Thanks this is wonderful! I think my implementation is very close to the
"riffology" described in the paper. Lots of other great ideas in this to
pursue!

------
dnautics
I wonder if the author has considered connecting it to more sophisticated
models. Carykh, for example trained a lexical RNN to read transcribed MIDI,
specifically training it to learn jazz.

~~~
qrv3w
Yes, I plan on adding something like this in the future! However, my goal is
to do learning in real-time in the style of the current pianist. NNs need
quite a lot of data to train correctly so it might be hard to do in realtime.
Although there could be a neat hybrid (some kind of iterative NN...).

~~~
dharma1
You could try this - it has online/realtime learning and runs on little
resources (including raspberry pi)

[https://github.com/ogmacorp/EOgmaNeo](https://github.com/ogmacorp/EOgmaNeo)

~~~
qrv3w
That looks awesome! Thanks.

~~~
dharma1
No probs. Looking forward to playing with what you build :)

------
ultrasounder
The best part of this whole post was the approach the OP took to actually
design this. A methodical process of writing the design document, Prototyping
with Python and then rewriting the application in Golang to take advantage of
speed. Which begs my question to the Sw folks in this thread, why is Golang
faster than Python?. I didn't realize that Golang compiler was available for
ARMV7 devices such as RPi.

~~~
Strang
That's not "begging the question," it's "raising the question."

[https://afterdeadline.blogs.nytimes.com/2008/09/25/begging-t...](https://afterdeadline.blogs.nytimes.com/2008/09/25/begging-
the-question-again/)

------
fefb
Can't you use the generative adversarial networks?

Where the discriminator IA would learn to identify good melodies from real
data. After that, the generator would try to make a good melodie to be approve
for the discriminator IA. Thus you could play the generator melodie .

~~~
qrv3w
Yeah, I'm thinking about trying this too. I think this is like Google's
approach for A.I. Duet.

------
SOLAR_FIELDS
Next step is to rig up some mechanisms to pull the keys down and we have a
modern day pianola that can improvise. Fascinating. Should be not too
difficult to play blues or other pentatonic melodies, since they lend
themselves well to improvisation. Using tabs or music from blues legends such
as Stevie Ray or BB King would likely yield some very interesting results.

I find it interesting that we start with teaching AI music the same way we
oftentimes start with children, the pentatonic scale, because it's simple and
more difficult to play the "wrong" notes.

------
dri_ft
The author may have been led down a blind alley when he (?) infers from a
screenshot that Dan Tepfer is using Processing for this. You can also see that
he's running SuperCollider (the icon on the right-hand side of the list of
apps), a programming language oriented around procedural music composition and
sound synthesis, which is to my mind a much more natural fit for this kind of
work.

~~~
qrv3w
Thanks! I didn't know about that! I will update the article and check out
SuperCollider :)

------
felispamukis
amazing work and great documentation OP. thank you.

consider emulations of your piano playing on two interconnected systems, each
conceiving themselves as the AI and the other player as you.

initiate one of the AI using a masterpiece of yours, unknown to either. would
that be considered putting your current state of pianoplayership into
silicone?

~~~
qrv3w
Oh this is a neat idea, thanks! I may have to try this too.

------
syntaxing
The method of paper to code is really interesting. Does anyone have additional
articles or books about this method?

~~~
qrv3w
I do not know of any formal methodology. Personally I just feel like I can
think better when I draw things out.

