comparison Syncopation models/parameter_setter.py @ 20:b959c2acb927

Refactored all models except for KTH, all past testing except for SG.
author csong <csong@eecs.qmul.ac.uk>
date Tue, 07 Apr 2015 19:05:07 +0100
parents 9030967a05f8
children 5de1cb45c145
comparison
equal deleted inserted replaced
19:9030967a05f8 20:b959c2acb927
6 # Set the parameters: subdivision_seq, weight_seq, L_max, strong_beat_level 6 # Set the parameters: subdivision_seq, weight_seq, L_max, strong_beat_level
7 7
8 # {'key': time-signature} : 8 # {'key': time-signature} :
9 # {'value': [subdivision_seq, theoretical beat-level represented by index in the subdivision_seq list]} 9 # {'value': [subdivision_seq, theoretical beat-level represented by index in the subdivision_seq list]}
10 timeSignatureBase = { 10 timeSignatureBase = {
11 '2/2': [[1,2,2,2,2],1], 11 '2/2': [[1,2,2,2,2,2],1],
12 '3/2': [[1,3,2,2,2],1], 12 '3/2': [[1,3,2,2,2,2],1],
13 '4/2': [[1,2,2,2,2],1], 13 '4/2': [[1,2,2,2,2,2],1],
14 '2/4': [[1,2,2,2,2],1], 14 '2/4': [[1,2,2,2,2,2],1],
15 '3/4': [[1,3,2,2,2],1], 15 '3/4': [[1,3,2,2,2,2],1],
16 '4/4': [[1,2,2,2,2],2], 16 '4/4': [[1,2,2,2,2,2],2],
17 '5/4': [[1,5,2,2,2],1], 17 '5/4': [[1,5,2,2,2,2],1],
18 '7/4': [[1,7,2,2,2],1], 18 '7/4': [[1,7,2,2,2,2],1],
19 '3/8': [[1,3,2,2,2],1], 19 '3/8': [[1,3,2,2,2,2],1],
20 '5/8': [[1,5,2,2,2],1], 20 '5/8': [[1,5,2,2,2,2],1],
21 '6/8': [[1,2,3,2,2],1], 21 '6/8': [[1,2,3,2,2,2],1],
22 '9/8': [[1,3,3,2,2],1], 22 '9/8': [[1,3,3,2,2,2],1],
23 '12/8':[[1,2,2,3,2],2], 23 '12/8':[[1,2,2,3,2,2],2],
24 } 24 }
25 25
26 def add_time_signature(timeSignature, subdivisionSequence, beatLevel): 26 def add_time_signature(timeSignature, subdivisionSequence, beatLevel):
27 if is_time_signature_valid(timeSignature,subdivisionSequence,beatLevel): 27 if is_time_signature_valid(timeSignature,subdivisionSequence,beatLevel):
28 if timeSignature in timesigBase: 28 if timeSignature in timesigBase: