how to play a chord on a stringed instrument
Project description
This package will help you determine how to play a chord on a stringed instrument. There are many sites dedicated to guitar or ukulele chords, but for some other instruments, chord tables are harder to find.
"Acordes" means "chords" in Spanish and Portuguese. Some of the possible pronunciations are [aˈkɔɦ.ʤis] (Brazilian Portuguese), [ɐˈkɔɾ.ðɨʃ] (European Portuguese), [aˈkoɾ.ðes] (Spanish).
Installation
You need Python 3.10 or later. Create a virtual environment with a tool of your choice, for example:
python3 -m venv ~/venvs/acordes
Then install the package with pip install acordes.
For convenient interactive usage, add a snippet to your shell configuration file (e.g. .bashrc if you use Bash), for example:
acordes () {
. ~/venvs/acordes/bin/activate
python -i -c 'from acordes import *
from acordes.instruments import *'
}
Usage
>>> from acordes import Tuning
>>> charango = Tuning("G4 C5 E A4 E5")
>>> charango("C7")
----------------- C7 = <C E G A#> -----------------
0 1 2 3 4 5 6 7 8 9 10 11 12
E₅ . . G₅ . . A#₅ . C₆ . . . E₆
. A#₄ . C₅ . . . E₅ . . G₅ . .
E . . G . . A# . C . . . E
C₅ . . . E₅ . . G₅ . . A#₅ . C₆
G₄ . . A#₄ . C₅ . . . E₅ . . G₅
---------------------------------------------------
>>> braguinha = Tuning("D4 G4 B4 D5")
>>> braguinha("Em")
------------------- Em = <E G B> ------------------
0 1 2 3 4 5 6 7 8 9 10 11 12
. . E₅ . . G₅ . . . B₅ . . .
B₄ . . . . E₅ . . G₅ . . . B₅
G₄ . . . B₄ . . . . E₅ . . G₅
. . E₄ . . G₄ . . . B₄ . . .
---------------------------------------------------
Supported tuning descriptions are:
- notes with octave numbers:
D4 G4 B4 D5 - octave-invariant notes:
G C E A - mix of the two:
G4 C5 E A4 E5
Octave-doubled strings are not supported. As a workaround, they can be notated without an octave or with only one of their octaves.
Supported chord descriptions are (examples with C as the root note):
- with two notes: Cm(no5), C(no5), C5
- with three notes: Cdim, Csus2, C, Cm, Csus4, Caug
- with four notes: Cm6, C6, Cm7, CmM7, C7, CM7
If octave numbers are present in the tuning, the notes in the output are colored so that notes of the same color form a non-inverted chord.
The instruments module contains a few predefined tunings. For some instruments,
there is only one tuning, for some there are many:
from acordes.instruments import balalaika
>>> from acordes.instruments import balalaika
>>> balalaika.academic("Em")
------------------- Em = <E G B> -------------------
0 1 2 3 4 5 6 7 8 9 10 11 12
. . B₄ . . . . E₅ . . G₅ . .
E₄ . . G₄ . . . B₄ . . . . E₅
E₄ . . G₄ . . . B₄ . . . . E₅
----------------------------------------------------
>>> balalaika.folk("Em")
------------------- Em = <E G B> -------------------
0 1 2 3 4 5 6 7 8 9 10 11 12
G₄ . . . B₄ . . . . E₅ . . G₅
E₄ . . G₄ . . . B₄ . . . . E₅
. . . . E₄ . . G₄ . . . B₄ .
----------------------------------------------------
It's often hard to decide whether a tuning is the tuning for some instrument. The list is incomplete and subjective. It's intended to be a helper, not a database. Still, if you see something obviously wrong, please report it.
There is also an optional fret_count argument:
In [1]: from acordes.instruments import vihuela, semistrunka
In [2]: semistrunka("C", fret_count=21)
------------------------------------- C = <C E G> --------------------------------------
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
. . E₄ . . G₄ . . . . C₅ . . . E₅ . . G₅ . . . .
. C₄ . . . E₄ . . G₄ . . . . C₅ . . . E₅ . . G₅ .
G₃ . . . . C₄ . . . E₄ . . G₄ . . . . C₅ . . . E₅
. . E₃ . . G₃ . . . . C₄ . . . E₄ . . G₄ . . . .
. C₃ . . . E₃ . . G₃ . . . . C₄ . . . E₄ . . G₄ .
G₂ . . . . C₃ . . . E₃ . . G₃ . . . . C₄ . . . E₄
. . E₂ . . G₂ . . . . C₃ . . . E₃ . . G₃ . . . .
----------------------------------------------------------------------------------------
In [3]: vihuela("C", 7)
--------- C = <C E G> ----------
0 1 2 3 4 5 6 7
E₄ . . G₄ . . . .
. C₄ . . . E₄ . .
G₄ . . . . C₅ . .
. . E₄ . . G₄ . .
. . . C₄ . . . E₄
--------------------------------
Development
Install (you should create an environment first): pip install -e .
Check types: mypy
Run a quick informal test: python -m acordes.example
Run formal tests: pytest
Related Projects
A browser version by formicant can be found here, its source code here.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file acordes-1.1.0-py3-none-any.whl.
File metadata
- Download URL: acordes-1.1.0-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f83d3df9c182df19f124af8dc79dad9f74810cc5d40bd0c7c655c3377b9b7e4
|
|
| MD5 |
bba59100ba0dd4269a0f1b09cc93f239
|
|
| BLAKE2b-256 |
237bdfae9be33628b13a5c837ed4b822278097e951d508d90d338bd6558a856d
|