Mercurial > hg > syncopation-dataset
diff Syncopation models/basic_functions.py @ 29:7a1730bbf15a
updating files with new text reading code
author | christopherh <christopher.harte@eecs.qmul.ac.uk> |
---|---|
date | Sun, 12 Apr 2015 22:37:56 +0100 |
parents | 5de1cb45c145 |
children | 273450d5980a |
line wrap: on
line diff
--- a/Syncopation models/basic_functions.py Sun Apr 12 22:34:35 2015 +0100 +++ b/Syncopation models/basic_functions.py Sun Apr 12 22:37:56 2015 +0100 @@ -94,6 +94,7 @@ # convert a velocity sequence to its minimum time-span representation def velocity_sequence_to_min_timespan(velocitySequence): + from music_objects import VelocitySequence minTimeSpanVelocitySeq = [1] for divisors in find_divisor(len(velocitySequence)): segments = subdivide(velocitySequence,divisors) @@ -103,8 +104,9 @@ minTimeSpanVelocitySeq.append(s[0]) if sum(minTimeSpanVelocitySeq) == sum(velocitySequence): break - return minTimeSpanVelocitySeq + return VelocitySequence(minTimeSpanVelocitySeq) +""" # convert a note sequence to its minimum time-span representation def note_sequence_to_min_timespan(noteSequence): from music_objects import note_sequence_to_velocity_sequence @@ -129,7 +131,7 @@ note.duration = note.duration/delta_t return noteSequence - +""" # get_note_indices returns all the indices of all the notes in this velocity_sequence def get_note_indices(velocitySequence):