Skip to main content

Some helpful stuff for displaying song chords (or just the bare chords) for string instruments.

Project description

Some helpful stuff for displaying song chords (or just the bare chords) for string instruments.

Installation

Just run pip install chordist or pipx install chordist.

CLI

When installed, the CLI command chordist will be made available.

$ chordist
usage: chordist [-h] [--instrument {guitar,banjo}] [--file FILE] [--chords-inline] [--collect-chords] [--even-x-distance] [--maxlen MAXLEN] [--variations] [--ascii] [--transpose TRANSPOSE]

options:
  -h, --help            show this help message and exit
  --instrument {guitar,banjo}, -i {guitar,banjo}
                        Default: guitar
  --file FILE, -f FILE  Text file with songs; if absent, all chords for the instrument will be printed
  --chords-inline       Input file uses the 'inlined chords' notation
  --collect-chords      When printing multiple songs, output all chords at the bottom instead of individually for each song
  --even-x-distance     Draw chords on equal distances horizontally
  --maxlen MAXLEN       Maximum output row length (default: 50)
  --variations          Print all available variations of each chord
  --ascii               Print chords in their simplified, ASCII only forms
  --transpose TRANSPOSE
                        Transpose all chords in the input file by this number of half notes

On the input text file

A sequence of 2 or more empty rows will be interpreted as a boundary between two songs.

If a song is prefixed by a line enclosed in ** (two asteriskes), the string within will be used for the song title.

Chords in the input file may be written in an inline fashion, like this:

**Roll in my sweet baby's arms**

[G]Roll in my sweet baby's arms
Roll in my sweet baby's [D7]arms
Gonna [G]lay around the shack
'Til the [C]mail train comes back
And [D7]roll in my sweet baby's [G]arms

... or above the lyrics, like this:

**Roll in my sweet baby's arms**

G
Roll in my sweet baby's arms
                        D7
Roll in my sweet baby's arms
      G
Gonna lay around the shack
         C
'Til the mail train comes back
    D7                      G
And roll in my sweet baby's arms

Use the --chords-inline parameter for the former notation. Note that the notation needs to be consistent throughout the file.

Chords may be written in the fancy, correct way ("A♭⁷", "C♯m⁷") or the simplified/ASCII way ("Ab7", "C#m7").

Defining chords

A chord can be defined like so:

from chordist.banjo import BanjoChord

em = BanjoChord.create("Em", (2, 1, 2), (2, 4, 3))
g = BanjoChord.create("G")

... where the arguments to BanjoChord.create() are the chord name followed by a tuple in the format (fret number, string number, [finger number]) for each pressed string. String numbers are counted from the top/left, which I am sure somebody will take issue with (feel free to change this in your own fork in that case). The finger number can be omitted, in which case a * will be used. It can also be a string, for example x for muted strings.

Bugs/caveats

Not yet able to render the high G string on a 5-string banjo in any useful way.

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

chordist-0.4.0.tar.gz (26.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chordist-0.4.0-py3-none-any.whl (28.2 kB view details)

Uploaded Python 3

File details

Details for the file chordist-0.4.0.tar.gz.

File metadata

  • Download URL: chordist-0.4.0.tar.gz
  • Upload date:
  • Size: 26.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for chordist-0.4.0.tar.gz
Algorithm Hash digest
SHA256 7aa5687d1ba7808aeca1c4778ef90275524d1c8be88837f1008c7cc83c6b640b
MD5 6d2c28fe443c2aa8f5898b1b7062eaf2
BLAKE2b-256 355f45cf937d542a73ba14af12b69aa211ec851cb658d400d1e70394b633d44c

See more details on using hashes here.

File details

Details for the file chordist-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: chordist-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 28.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for chordist-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e99983cb127c5e27919cc7c9f418ebff0d9a0b0b94442782ab64974ea3102d19
MD5 5906d4c58855bdccd632c33fb8864fe0
BLAKE2b-256 79173cd29e426efdae555b1d4d9a9e6b44b25c839bbb098d3b3398bfc30b1390

See more details on using hashes here.

Supported by

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