Mercurial > hg > syncopation-dataset
comparison Syncopation models/basic_functions.py @ 21:b6daddeefda9
working on KTH
author | csong <csong@eecs.qmul.ac.uk> |
---|---|
date | Tue, 07 Apr 2015 23:16:13 +0100 |
parents | b959c2acb927 |
children | 2dbc09ca8013 |
comparison
equal
deleted
inserted
replaced
20:b959c2acb927 | 21:b6daddeefda9 |
---|---|
115 for h in H_pre: | 115 for h in H_pre: |
116 H = concatenate(H, concatenate([h], repeat([weightSequence[level]],subdivisionSequence[level]-1))) | 116 H = concatenate(H, concatenate([h], repeat([weightSequence[level]],subdivisionSequence[level]-1))) |
117 else: | 117 else: |
118 print 'Error: a subdivision factor or metrical weight is not defined for the request metrical level.' | 118 print 'Error: a subdivision factor or metrical weight is not defined for the request metrical level.' |
119 return H | 119 return H |
120 | |
121 def calculate_time_span_ticks(numerator, denominator, ticksPerQuarter): | |
122 return (numerator * ticksPerQuarter *4) / denominator | |
120 | 123 |
121 # # The get_subdivision_seq function returns the subdivision sequence of several common time-signatures defined by GTTM, | 124 # # The get_subdivision_seq function returns the subdivision sequence of several common time-signatures defined by GTTM, |
122 # # or ask for the top three level of subdivision_seq manually set by the user. | 125 # # or ask for the top three level of subdivision_seq manually set by the user. |
123 # def get_subdivision_seq(timesig, L_max): | 126 # def get_subdivision_seq(timesig, L_max): |
124 # subdivision_seq = [] | 127 # subdivision_seq = [] |