• Stars
    star
    613
  • Rank 73,175 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created over 7 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Piano in your terminal

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

More Repositories

1

tictactoe-voc

TicTacToe Python app for Android, powered by BeeWare suite - https://pybee.org
Python
167
star
2

usolitaire

Solitaire in your terminal, powered by Unicode and https://textual.textualize.io/
Python
92
star
3

xpath_helper

XPath Helper Chrome extension modded
JavaScript
65
star
4

beeware-android-template

Template for starting a native Android app using Python and the BeeWare tools
Python
36
star
5

drawingapp-voc

Drawing App for Android written in Python, powered by BeeWare suite - https://pybee.org
Python
19
star
6

todoapp-voc

Todo App for Android written in Python, powered by BeeWare - https://pybee.org
Python
15
star
7

dotfiles

My dotfiles
Vim Script
12
star
8

code-igniter-cas-library

CodeIgniter CAS library (UNMAINTAINED)
PHP
10
star
9

Fretboard-Studies

A tool for the guitar fretboard student
JavaScript
7
star
10

acabou-o-tempo

Uma versΓ£o digital do jogo Time's Up e em portuguΓͺs
JavaScript
3
star
11

fretprinting

Guitar fretboard diagrams for printing.
JavaScript
3
star
12

tvsubs_rename

Script to mass-rename subtitles
Python
2
star
13

til

Things I learned
Shell
2
star
14

quotes_crawler

Python
1
star
15

dev_services

Config to run locally services for development and testing purposes
Shell
1
star
16

elm-ultimate-tictactoe

Elm
1
star
17

drum-game

Drum game
JavaScript
1
star
18

ultimate-tictactoe

A toy experiment with AngularJS
JavaScript
1
star
19

rcnetwalk

Python
1
star
20

exercicios-gtypist

ExercΓ­cios em portuguΓͺs para o GNU Typist
Shell
1
star
21

cpf_hypothesis_demo

Python
1
star
22

parslepied_scrapy

Experiment with Parslepy and Scrapy
Python
1
star
23

jk

Python library containing useful functions for manipulating iterables
Python
1
star
24

equalizer-game

Can you guess which equalization is being used?
JavaScript
1
star