From fb85212cbc8e7a2866c6dda916e810df2a4ea4e0 Mon Sep 17 00:00:00 2001 From: Houyhnhnm Date: Tue, 5 Jun 2018 15:38:15 +0200 Subject: compute barlines preferentially for most prominent downs --- grammar.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'grammar.py') diff --git a/grammar.py b/grammar.py index 44e110b..7afec1b 100644 --- a/grammar.py +++ b/grammar.py @@ -47,7 +47,7 @@ class Phonology(object): def makeFootprint(self): # select footprint rule - weights = array([rule[1] for rule in self.functions]) + weights = array([rule[1] for rule in self.footprints]) normalized_weights = weights.astype(float) / weights.sum() footprintChoices = array(self.footprints) index = choice(len(footprintChoices), p=normalized_weights) @@ -65,9 +65,9 @@ class Phonology(object): foot['span'] = choice(footRule['span']) foot['gait'] = choice(footRule['gait']) # timing options are per note: - foot['step'] = [] - for steps in footRule['step']: - foot['step'].append( choice(steps) ) + foot['sync'] = [] + for steps in footRule['sync']: + foot['sync'].append( choice(steps) ) footprint.append(foot) return footprint -- cgit v1.2.3