comparison Syncopation models/PRS.py @ 23:df1e7c378ee0

fixed KTH, and WNBD
author csong <csong@eecs.qmul.ac.uk>
date Sun, 12 Apr 2015 13:06:17 +0100
parents b959c2acb927
children cc38b3047ed9
comparison
equal deleted inserted replaced
22:2dbc09ca8013 23:df1e7c378ee0
1 ''' 1 '''
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 from basic_functions import repeat, subdivide, ceiling, get_min_timeSpan, get_rhythm_category 6 from basic_functions import repeat, subdivide, ceiling, velocity_sequence_to_min_timespan, get_rhythm_category
7 7
8 def get_cost(sequence,nextSequence): 8 def get_cost(sequence,nextSequence):
9 sequence = get_min_timeSpan(sequence) # converting to the minimum time-span format 9 sequence = velocity_sequence_to_min_timespan(sequence) # converting to the minimum time-span format
10 10
11 if sequence[1:] == repeat([0],len(sequence)-1): # null prototype 11 if sequence[1:] == repeat([0],len(sequence)-1): # null prototype
12 cost = 0 12 cost = 0
13 elif sequence == repeat([1],len(sequence)): # filled prototype 13 elif sequence == repeat([1],len(sequence)): # filled prototype
14 cost = 1 14 cost = 1