Hacker News new | past | comments | ask | show | jobs | submit login
Making a Raspberry Pi-Powered AI to Play Piano (rpiai.com)
86 points by qrv3w on Sept 6, 2017 | hide | past | favorite | 21 comments

Those interested in computer generated music may find some pragmatic ideas in this paper from 1989:


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!

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.

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...).

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


That looks awesome! Thanks.

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

There's probably a reasonably easy way to do style transfer by running a few moments of play by the player and watching which activations light up and putting it through the generative model.

You could pre-train the network to understand a multitude of styles. It should then be able to pick up and continue a particular style very quickly.

Oh, that's a neat idea! To classify the style and then choose the corresponding emulation... I'll think about it.

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.

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


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 .

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

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.

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.

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

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?

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

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

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

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact