百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
P

PIanoAI

> 编程语言
开源

由基于 Pi 的 AI 提供实时钢琴学习和伴奏

353 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

由基于 Pi 的 AI 提供实时钢琴学习和伴奏

PIanoAI (Piano AI on a Raspberry Pi)

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

See it

Here's an example of me teaching for ~30 seconds and then jamming with the AI: Here are some longer clips of me playing with the AI: clip #2 clip #3

Read about it

Read more about it at rpiai.com/piano.

Try it

  1. Get a MIDI-enabled keyboard and two-way MIDI adapter ($18). Or get a USB-MIDI keyboard ($38).
  2. Get a Raspberry Pi (however, a Windows / Linux / OS X computer should also work) and connect it to the MIDI keyboard.
  3. Build latest version of libportmidi (OS X: brew install portmidi).
bash
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
  1. Download the latest release OR install Go and go get it:
go get -v github.com/schollz/pianoai
  1. Add export LD_LIBRARY_PATH=/usr/local/lib to your .bashrc. (Unnessecary if you did not build portmidi). Reload bash source ~/.bashrc if this is the first time.
  2. Play!
$ pianoai

For some extra jazziness do

$ pianoai --jazzy

Options

Piano keyboard controls

When you play, you can always trigger learning and improvising by hitting the top B or top C respectively, on the piano keyboard (assuming an 88-key keyboard). If you use --manual mode then you can only hear improvisation after triggering. Normally, however, the improvisation will start as soon as it has enough notes and you leave enough space for the improvisation to take place (usually a few beats).

You can save your current data by pressing the bottom A on the piano keyboard and you can play back what you played by hitting the bottom Bb on the piano keyboard. Currently there is not a way to save the AI playing (but its in the roadmap, see below).

Command line options

There are many command-line options for tuning the AI, but feel free to play with the code as well. Current options:

…

Roadmap

Must haves

  • External script that will start/stop piano based on plugging in Midi
  • Save sessions as MIDI

Want haves

  • Player changes velocity according to the host
  • Integrating more AI routines

Similar projects

  • Google A.I. Duet
  • DeepJazz

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.

Get in touch

Like this? Need help? Tweet at me @yakczar.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Go

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言