jazzElements¶
The primary goal of this package is to help in the analysis of a chord progression and facilitate learning of jazz standards. It will also suggest alternative chords, progressions, scales etc For example, we can enter a progression as a string, ask to analyse then plot the results. Each cell shows the chord, its degree in the corresponding scale, and optionally the corresponding notes.
The full documentation can be found on ReadTheDocs
Hint
The best resource i found to learn about jazz and music theory, check it out:
- “WalkThatBass” youtube channel.
- “TheJazzPianoSite” website.
Warning
I am coding this in parallel to trying to finally understand music theory. This is in active dev with surely a good amount of hacks and bugs. Feel free to contribute/submit issues or ideas.
A chord progression can be defined using a chord string (e.g. ‘|DbM7,E9|AM7,C9|FM7|Bm9,E9|AM7,C9|FM7,Ab9|’) or using a named progression (e.g. ‘Misty’) We can then annotate a chord progression:
>>> prg = Progression('Misty')
>>> prg.annotate()
>>> prg.plot('fn')
or a keyboard representation of chords (top) and scales (bottom):
>>> prg.plot('kbd')

The analysis can be made for example using the major/minor chord progression from the book Tonal Harmony by Stefan Kostka
![]() Major Kostka Progression |
![]() Minor Kostka Progression |
Plot all Chords in a given Scale:
>>> Scale('C minor').plotChords()

Plot m7 for all roots:

Plot implemented chords:

Examples¶
Warning
Dev in progress, more coming soon
Scale¶
Printing the chords built from the modes of the C key:
>>> import pandas as pd
>>> key = 'C'
>>> lst = {}
>>> for mode in Scale.modesLst:
>>> if mode is not 'Chr':
>>> C = Scale(key, mode).chords()
>>> lst[key + ' ' + mode] = [str(c.root) + c.type for c in C]
>>> print(pd.DataFrame(lst,index=range(1,len(lst)+1)).T)
Returns:
>>> 1 2 3 4 5 6 7
>>> C Aeo Cm7 Dø D♯M7 Fm7 Gm7 G♯M7 A♯7
>>> C Dor Cm7 Dm7 D♯M7 F7 Gm7 Aø A♯M7
>>> C Ion CM7 Dm7 Em7 FM7 G7 Am7 Bø
>>> C Loc Cø C♯M7 D♯m7 Fm7 F♯M7 G♯7 A♯m7
>>> C Lyd CM7 D7 Em7 F♯ø GM7 Am7 Bm7
>>> C Mix C7 Dm7 Eø FM7 Gm7 Am7 A♯M7
>>> C Phr Cm7 C♯M7 D♯7 Fm7 Gø G♯M7 A♯m7
Progressions¶
Training on major 2-5-1s¶
To train on 2-5-1 cadences, one can generate the progression then plot the analysis and the associated keyboards. We can then use the keyboard view to play the chords (upper keyboard) with the left hand, and the associated scale (lower keyboard) with the right hand.
>>> # Generating the 4 notes 2-5-1s for every root:
>>> seq=''.join(['|{},{}|{}'.format(
>>> Scale(key,'ion').getDegree(2,nbNotes=4),
>>> Scale(key,'ion').getDegree(5,nbNotes=4),
>>> Scale(key,'ion').getDegree(1,nbNotes=4) ) for key in Note.chrFlat])
>>> prg=Progression(chr,name='Maj 2-5-1s')
>>> prg.annotate()
>>> prg.plot('fn') # Plot the analysis view
>>> prg.plot('kbd') # Plot the keyboard view


Training on minor 2-5-1s¶
Likewise, we can train on 4 notes chords in the harmonic minor 2-5-1s
>>> # Generating the 4 notes 2-5-1s for every root:
>>> seq=''.join(['|{},{}|{}'.format(
>>> Scale(key,'hMin').getDegree(2,nbNotes=4),
>>> Scale(key,'hMin').getDegree(5,nbNotes=4),
>>> Scale(key,'hMin').getDegree(1,nbNotes=4) ) for key in Note.chrFlat])
>>> prg=Progression(chr,name='Min 2-5-1s')
>>> prg.annotate()
>>> prg.plot('fn') # Plot the analysis view
>>> prg.plot('kbd') # Plot the keyboard view


Annotation¶
Implemented cadence Graphs¶
Following are examples of detected cadences. They can be obtained using CadenceGraph().plot()
Kostka transitions (C Major):

Kostka transitions (C Harmonic minor):

Allow all transitions (C Major):

Allow all transitions (C Harmonic Major):

Only allow main cadences (C Major):

Only allow main cadences (C Harmonic minor):

Notes¶
Notes are the most basic element, they can be defined as Note(‘E♯’),Note(‘Cb’), and perform simplification (e.g. Note(‘Gb♭#♯’)) or alteration (e.g. Note(‘C’,-2) in semitones).
Uses¶
code | output | |
---|---|---|
Transposition | Note(‘C’)+2 | D♯ |
Note difference | Note(‘A’)-Note(‘F#’) | 3 |
Comparison | Note(‘F##’)==Note(‘Abb’) | True |
Chords¶
Chords are built on notes, and can be instantiated from a string (e.g. c = Chord(‘Em7’) ) or from a list of notes strings (e.g. c = Chord([‘C’,’E’,’G’]) ) or Notes
Basic attributes¶
code | output | |
---|---|---|
Chord notes | Chord(‘Cdim’).notes | [C, E♭, G♭] |
Distances from root in semitones | Chord(‘Cdim’).intArr | [0, 3, 6] |
Chord intervals | Chord(‘Cdim’).intStr | [‘1’, ‘♭3’, ‘♭5’] |
Chord quality | Chord(‘Cdim’).quality | ‘dim’ |
Basic members¶
Scales¶
Scales can be instantiated as s=Scale(root=’C’, mode=’ion’) or Scale(‘C hm’). Attributes ———-
code | output | |
---|---|---|
Root | Scale(‘D# min’).root | Note(‘D♯’) |
Mode | Scale(‘D# min’).mode | ‘Aeo’ |
Name | Scale(‘D# min’).name | ‘D♯ Aeo’ |
Hint
A good way to remember modes order is the mnemonic “(I) (D)on’t (P)articularly (L)ike (M)odes (A) (L)ot”
Basic operations¶
Progression¶
Progressions hold chords, and the analysis results. They are instantiated using a chord string as in ‘|Fm7,Bb7|EbM7|%|Bbm7,Eb7|’ or using a named progression e.g. ‘Misty’
Warning
Dev in progress, more coming soon
Annotate¶
Warning
Dev in progress, more coming soon
jazzElements¶
The primary goal of this package is to help in the analysis of a chord progression and facilitate learning of jazz standards. It will also suggest alternative chords, progressions, scales etc For example, we can enter a progression as a string, ask to analyse then plot the results. Each cell shows the chord, its degree in the corresponding scale, and optionally the corresponding notes.
The full documentation can be found on ReadTheDocs
Hint
The best resource i found to learn about jazz and music theory, check it out:
- “WalkThatBass” youtube channel.
- “TheJazzPianoSite” website.
Warning
I am coding this in parallel to trying to finally understand music theory. This is in active dev with surely a good amount of hacks and bugs. Feel free to contribute/submit issues or ideas.
A chord progression can be defined using a chord string (e.g. ‘|DbM7,E9|AM7,C9|FM7|Bm9,E9|AM7,C9|FM7,Ab9|’) or using a named progression (e.g. ‘Misty’) We can then annotate a chord progression:
>>> prg = Progression('Misty')
>>> prg.annotate()
>>> prg.plot('fn')
or a keyboard representation of chords (top) and scales (bottom):
>>> prg.plot('kbd')

The analysis can be made for example using the major/minor chord progression from the book Tonal Harmony by Stefan Kostka
![]() Major Kostka Progression |
![]() Minor Kostka Progression |
Plot all Chords in a given Scale:
>>> Scale('C minor').plotChords()

Plot m7 for all roots:

Plot implemented chords:
