Skip to main content

Terminal Piano App

Project description

UPiano

A Piano in your terminal.

Screenshot

How to run

First, you'll need to install FluidSynth, if you haven't already. See here how to install FluidSynth on your system.

Then, install upiano via pip:

pip install upiano

And then run:

upiano

Make sure your terminal window is big enough. The wider you can make it, the more keys you'll have! ๐ŸŽน ๐Ÿ˜€

How to play

To play with the mouse, click on the notes you want to play.

To play with the computer keyboard, there is a limited and currently hardcoded keymap that corresponds to the following, which will play the notes on the left side:

โ”Œโ”€โ”ฌโ”€โ”€โ”ฌโ”ฌโ”€โ”€โ”ฌโ”€โ”ฌโ”€โ”ฌโ”€โ”€โ”ฌโ”ฌโ”€โ”€โ”ฌโ”ฌโ”€โ”€โ”ฌโ”€โ”ฌโ”€โ”ฌโ”€โ”€โ”ฌโ”ฌโ”€โ”€โ”ฌโ”€โ”ฌโ”€โ”ฌโ”€โ”€โ”ฌโ”
โ”‚ โ”‚โ–ˆโ–ˆโ”‚โ”‚โ–ˆโ–ˆโ”‚ โ”‚ โ”‚โ–ˆโ–ˆโ”‚โ”‚โ–ˆโ–ˆโ”‚โ”‚โ–ˆโ–ˆโ”‚ โ”‚ โ”‚โ–ˆโ–ˆโ”‚โ”‚โ–ˆโ–ˆโ”‚ โ”‚ โ”‚โ–ˆโ–ˆโ”‚โ”‚
โ”‚ โ”‚Wโ–ˆโ”‚โ”‚Eโ–ˆโ”‚ โ”‚ โ”‚Tโ–ˆโ”‚โ”‚Yโ–ˆโ”‚โ”‚Uโ–ˆโ”‚ โ”‚ โ”‚Oโ–ˆโ”‚โ”‚Pโ–ˆโ”‚ โ”‚ โ”‚โ–ˆโ–ˆโ”‚โ”‚
โ”‚ โ””โ”ฌโ”€โ”˜โ””โ”ฌโ”€โ”˜ โ”‚ โ””โ”ฌโ”€โ”˜โ””โ”ฌโ”€โ”˜โ””โ”ฌโ”€โ”˜ โ”‚ โ””โ”ฌโ”€โ”˜โ””โ”ฌโ”€โ”˜ โ”‚ โ””โ”ฌโ”€โ”˜โ”‚
โ”‚A โ”‚ S โ”‚ D โ”‚F โ”‚ G โ”‚  Hโ”‚ J โ”‚K โ”‚ L โ”‚ ; โ”‚' โ”‚  โ”‚
โ””โ”€โ”€โ”ดโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ดโ”€โ”€โ”ดโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ดโ”€โ”€โ”ดโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ดโ”€โ”€โ”ดโ”€โ”€โ”˜

Note that since the terminal doesn't really support key press and release events (it receives a stream of characters instead), there is no way to support two key playing at the same time with the computer keyboard only.

But you can play with the computer keyboard and with the mouse simultaneously, as you can see in this video: https://www.youtube.com/watch?v=0VXit110PcA

Powered by

Made with โค๏ธ by Elias Dorneles

History

This started as a fun pairing project by friends Elias and Nandaja around 2017, after they had finished their Recurse Center retreat and were missing hacking together.

They had fun building a small terminal piano app using urwid for the user interface and playing notes by spawning sox subprocesses. This version is available in the project source code, if you have urwid and sox installed, you can try it by running: python upiano/legacy.py.

Fast-forward to 2023, Elias attended EuroPython and learned the Textual library there, got excited about terminal apps again and decided to reboot this project using the newly acquired knowledge, package and distribute it, and add to the fun by plugging a true synthesizer to it, and playing with its controls.

Changelog:

  • v0.1.2
    • added volume, reverb and chorus sliders
    • fix packaging config, to work on any Python 3.10+
  • v0.1.1
    • added sustain
    • fix mouse handling, and allow playing by "swiping" over keys
  • v0.1.0
    • first version released to PyPI, already using Textual

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

upiano-0.1.2.tar.gz (28.3 MB view details)

Uploaded Source

Built Distribution

upiano-0.1.2-py3-none-any.whl (28.3 MB view details)

Uploaded Python 3

File details

Details for the file upiano-0.1.2.tar.gz.

File metadata

  • Download URL: upiano-0.1.2.tar.gz
  • Upload date:
  • Size: 28.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for upiano-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9bc51582e5833556fe572646daf2c3901fae2c9c17c15a99c1624ffbb586f67e
MD5 474e15328cb455424d10f8cf0d05481b
BLAKE2b-256 facb6b349926bc3fb230548ad1209d0043abdda562e9a5ce21a74e28b98fcb2b

See more details on using hashes here.

File details

Details for the file upiano-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: upiano-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 28.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for upiano-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b8033cb7a257522eaec496ffd46316b1fe21772112a500e5f561f62187c9befb
MD5 3429280182da88129e1b7b13a1bee571
BLAKE2b-256 5b35f48ff792b9ed764dd51ff70276609f04405a04e3d147d1a8c376ca4315f1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page