1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
from phonology import *
from diagram import *
'''
modules:
cadence.py define musical morphemes
diagram.py define binary tree structures
phonology.py distribution of cadential features for given lexicon
lexicon.py repository of lexemes w/ weighted dependency correlations
passage.py cadences from lexicon mapped to tree diagram
spellout() sequence of unified cadences in passage (for each voice)
score.py list of n passages rendered to music21 score object
export() to xml, midi, ly
'''
phonology = Phonology()
phonology.addFootprintRule([{
'span': [2],
'gait': ['double','triple'],
'foot': [[-1/2, 0, 1/2]],
'step': [[0, 1/2], [0, 1/2], [0, 1/2]],
}])
phonology.addFunctionRule({
'address': ['A1','B1'],
'transposition': [-1,0,1],
})
phonology.addPathRule({
'range': [2,3,4],
'figure': ['rampUp', 'rampDown'],
'tilt': ['float', 'dive'],
})
phonology.print()
lex = phonology.makeCadence(label=1)
lex.print()
syntax = Diagram()
syntax.print()
|