comparison Syncopation models/TOB.py @ 38:cc38b3047ed9

updated syncopation.y to allow output of sync for a bar list also fixed some problems in models and other modules
author christopherh <christopher.harte@eecs.qmul.ac.uk>
date Mon, 13 Apr 2015 23:06:49 +0100
parents df1e7c378ee0
children
comparison
equal deleted inserted replaced
37:fefbe0d853c6 38:cc38b3047ed9
2 Author: Chunyang Song 2 Author: Chunyang Song
3 Institution: Centre for Digital Music, Queen Mary University of London 3 Institution: Centre for Digital Music, Queen Mary University of London
4 4
5 ''' 5 '''
6 6
7 from basic_functions import ceiling, find_divisor, is_prime 7 from basic_functions import ceiling, find_divisor, is_prime, velocity_sequence_to_min_timespan
8 8
9 def get_syncopation(bar, parameter = None): 9 def get_syncopation(bar, parameters = None):
10 binarySequence = bar.get_binary_sequence() 10 binarySequence = velocity_sequence_to_min_timespan(bar.get_binary_sequence())
11 sequenceLength = len(binarySequence) 11 sequenceLength = len(binarySequence)
12 12
13 syncopation = 0 13 syncopation = 0
14 14
15 # if the length of b_sequence is 1 or a prime number, syncopation is 0; 15 # if the length of b_sequence is 1 or a prime number, syncopation is 0;