Network transition chord progressions
Project description
Chord Progression Network
Network transition chord progression generator
DESCRIPTION
This class generates network transition chord progressions. The transitions are given by a net of scale positions, and the chord "flavors" are defined by a chord_map of types. The chords that are returned are either named chords or lists of three or more named notes with octaves.
The chord types are as follows:
'' (i.e. an empty string) means a major chord.
'm' signifies a minor chord.
'7' is a seventh chord
'M7' is a major 7th chord and 'm7' is a minor 7th.
'dim' is a diminished chord and 'aug' is augmented.
'9', '11', and '13' are extended 7th chords.
'M9', 'M11', and 'M13' are extended major-7th chords.
'm9', 'm11', and 'm13' are extended minor-7th chords.
For the major scale (ionian mode), this chord_map is ['', 'm', 'm', '', '', 'm', 'dim']. The dorian mode is ['m', 'm', '', '', 'm', 'dim', '']. A chromatic scale is all minors. This can be set in the constructor, or seen by printing it after Generator construction.
The tonic attribute means that if the first chord of the progression is being generated, then for 0 choose a random successor of the first chord, as defined by the net attribute. For 1, return the first chord in the scale. For any other value, choose a random value of the entire scale.
The resolve attribute means that if the last progression chord is being generated, then for 0 choose a random successor. For 1, return the first chord in the scale, and for any other value, choose a random value of the entire scale. In all other cases (i.e. the middle chords of the progression), choose a random successor.
By default, all chords and notes with accidentals are returned as sharps. If you want flats, set the flat attribute to True in the constructor.
If the substitute attribute is set to True, then the progression chords are subject to extended, "jazz" chord, including tritone substitution. For now, for this work-in-progress advanced option, please see the substitution() method in the source...
SYNOPSIS
from chord_progression_network import Generator
g = Generator( # defaults
max=8,
scale_note='C',
scale_name='major',
octave=4,
net={
1: [1, 2, 3, 4, 5, 6],
2: [3, 4, 5],
3: [1, 2, 4, 6],
4: [1, 3, 5, 6],
5: [1, 4, 6],
6: [1, 2, 4, 5],
7: [],
},
chord_map=[ '', 'm', 'm', '', '', 'm', 'dim' ],
tonic=1,
resolve=1,
flat=False,
chord_phrase=False,
substitute=False,
verbose=False,
)
phrase = g.generate()
MUSICAL EXAMPLES
from music21 import chord, stream
from chord_progression_network import Generator
g = Generator(verbose=True)
phrase = g.generate()
s = stream.Score()
p = stream.Part()
for notes in phrase:
p.append(chord.Chord(notes, type='whole'))
s.append(p)
s.show()
from music21 import chord, duration, stream
from chord_progression_network import Generator
from random_rhythms import Rhythm
r = Rhythm(durations=[1, 3/2, 2])
motifs = [ r.motif() for _ in range(4) ]
s = stream.Score()
p = stream.Part()
g = Generator()
for m in motifs:
g.max = len(m)
phrase = g.generate()
for i, d in enumerate(m):
c = chord.Chord(phrase[i])
c.duration = duration.Duration(d)
p.append(c)
s.append(p)
s.show()
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 Distribution
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 chord_progression_network-0.1.11.tar.gz.
File metadata
- Download URL: chord_progression_network-0.1.11.tar.gz
- Upload date:
- Size: 43.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b746d83d1a3a0ed861dc172d495fa5b236ed59cb9cc76185ff82b1ea92ce0e51
|
|
| MD5 |
c3989295b5a3c846e0422feb7be79e10
|
|
| BLAKE2b-256 |
cd78f63b25fb7fc1e687df43fd3a236fcee8163b5d0a05ba6fd339d08ed272e2
|
File details
Details for the file chord_progression_network-0.1.11-py3-none-any.whl.
File metadata
- Download URL: chord_progression_network-0.1.11-py3-none-any.whl
- Upload date:
- Size: 30.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54204c7213d62c51dda7cd48b250dd2ef29ca222daaa6a4c19235247fbf511c3
|
|
| MD5 |
1dfd3051436d04b706ed2267f92e5ec7
|
|
| BLAKE2b-256 |
e86f4aca5bb193b154d578dfd0a4acbdd756086490af4a2fb9d956966b700a78
|