Skip to content

Instantly share code, notes, and snippets.

View eamonnbell's full-sized avatar

Eamonn Bell (Personal) eamonnbell

View GitHub Profile
@eamonnbell
eamonnbell / NRTfinder.py
Last active December 17, 2015 18:59
Tries to account for chord changes in a Bach Chorale by brute-forcing the 24 unique LPR operations
import music21
# From Hook/Andrew Chung
LRPgroup = ['', 'P', 'LPRP', 'LPR', 'LRL', 'PRPL', 'LRLR', 'RLR', 'LPRPR', 'LRPR', 'PR', 'PRP',
'R', 'RP', 'LP', 'L', 'LPL', 'PL', 'RL', 'PLR', 'LPR', 'LR', 'PRPR', 'RPR']
LRPCombinations = music21.analysis.neoRiemannian.LRP_combinations
def getCanonicalTransform(source, target):
@eamonnbell
eamonnbell / NRTChart.py
Created May 26, 2013 12:41
Show the results of all possible selections of up to MAX_OPS NRTs acting on D minor. Very slow after MAX_OPS = 4.
import music21
import itertools
MAX_OPS = 6
c = music21.chord.Chord('D4 F4 A4')
display = music21.stream.Stream()
LRPcombs = music21.analysis.neoRiemannian.LRP_combinations