Skip to main content

jchord - toolkit for working with chord progressions

https://github.com/jonathangjertsen/jchord/actions/workflows/build.yml/badge.svg https://codecov.io/gh/jonathangjertsen/jchord/branch/master/graph/badge.svg

What’s this then?

jchord is a Python package which provides tools for working with chord progressions. jchord:

  • has object representations for notes, chords, and progressions (in the Western 12-tone system)

  • knows about naming conventions for chords, and can convert back and forth between objects and names

  • can be used as a converter between strings, text files, XLSX files, PDFs and MIDI files (see “converter script” below)

Get it

Basic installation:

pip install jchord

Installation with dependencies for reading and writing MIDI/XLSX/PDF files:

pip install jchord[midi,xlsx,pdf]

Convert between formats

If you just want the converter functionality, invoke jchord on the command line:

usage: jchord [-h] [--midi MIDI] [--pdf PDF] file_in file_out

Converts between different representations of the same format

positional arguments:
  file_in      Input progression as string, .txt, .xlsx or .midi
  file_out     Output file as .txt, .xlsx, .midi or .pdf

optional arguments:
  -h, --help   show this help message and exit
  --midi MIDI  comma separated list of arguments for midi, e.g. tempo=8,beats_per_chord=2
  --pdf PDF    comma separated list of arguments for pdf, e.g. chords_per_row=8,fontsize=30

Example:

jchord "Cm A E7 F#m7" example.mid --midi tempo=80,beats_per_chord=1

As a library

Here is an example that parses a chord progression written as a string, transposes it upwards by 2 semitones, converts it back to a string and then creates a midi file from it.:

from jchord import ChordProgression, MidiConversionSettings
prog = ChordProgression.from_string("C -- Fm7 -- C -- G7 -- C -- E7 Am F Bm7b5 E7 Am9 F Bo C69 --")
prog = prog.transpose(+2)
print(prog.to_string())
prog.to_midi(MidiConversionSettings(filename="example.midi", tempo=100, beats_per_chord=2, instrument=4))

Output:

D       --      Gm7     --
D       --      A7      --
D       --      F#7     Bm
G       C#m7b5  F#7     Bm9
G       C#o     D69     --

For more examples, see the documentation.

Documentation

Documentation lives here: jonathangjertsen.github.io/jchord/

Contributing

To contribute, open an issue or create a Pull Request in the Github repo.

Metadata

Release files for jchord 3.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jchord 3.1.1
File Size Uploaded
jchord-3.1.1.tar.gz 31.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jchord 3.1.1
File Interpreter ABI Platform
jchord-3.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 59.1 kB

Release files / jchord-3.1.1.tar.gz

Download URL jchord-3.1.1.tar.gz
Size 31.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f1d78a4ecc4c95033d02537a793e91f00a444423306d06ad2152c4de38aaece4
BLAKE2b-256 checksum
How to use checksums
9c6ff212b97bd1f375009f06b0f4afd679a72cffb6f22f3068c12230818805ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.0

Release files / jchord-3.1.1-py3-none-any.whl

Download URL jchord-3.1.1-py3-none-any.whl
Size 28.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6bddf6928e1965624b832c0c131d80c5761bc55b5123fbab72ae90c82855b315
BLAKE2b-256 checksum
How to use checksums
1c7a4662527ccd98f0db0280b4f9c3c669a4cda6f802edf22ee64521b6e4e96a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.0

Release history Release notifications | RSS feed

This release

3.1.1 This release

2 release files

3.0.0

2 release files

2.0.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page