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.
Metadata
Release files for acordes 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| acordes-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Release files / acordes-1.1.0-py3-none-any.whl
| Download URL | acordes-1.1.0-py3-none-any.whl |
|---|---|
| Size | 8.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4f83d3df9c182df19f124af8dc79dad9f74810cc5d40bd0c7c655c3377b9b7e4
|
|
BLAKE2b-256 checksum How to use checksums |
237bdfae9be33628b13a5c837ed4b822278097e951d508d90d338bd6558a856d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.2
|
Security for acordes 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.