summaryrefslogtreecommitdiff
path: root/main.py
blob: 20dcb600acaf1e65d927d87d8b820a09f7eecb37 (plain)
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
45
46
47
48
49
from grammar import *
from lexicon import *
from passage import *
from render import *
from spec import *

'''
modules:

cadence.py		define musical morphemes
projection.py	dependencies and agreement
				antecedent or consequent cadence bundled with prolongation rules for each feature - (dominates) or (dominates, agrees) or (dominates, agrees, submits)
				(1)==Head; (0)==Complement; (1,0)==XP; (1,1)==XBar; (0,1)==X; (0,0)==None; 

phonology.py	distribution of cadential features for given grammar
lexicon.py		repository of lexemes: (cadence, dependencies, prolongation)
passage.py		lexemes unified over binary tree
	spellout()	sequence of unified cadences in passage (for each voice)
render.py 		list of n passages rendered to music21 score object
	export()	to xml, midi, ly'

'''

# lexicon.addCategory()

# g.phonology.print()
# g.morphology.print()

lexicon = Lexicon()
lexicon.populate(g, 4)
lexicon.print()

passage = Passage(height=5, size=23)

realization = passage.spellout(lexicon)
# passage.printSyntax()

# for lex in realization:
# 	lex.print()

passage.setMeter()
print(passage.tree)
print(passage.bars)


# next: go through spellout, create musical data, append to music21 score
# then: add good lexemes, dependency of good lexeme pairs to lexicon pre-population, iteratively...