def run(self, args): s = score.Score().load(args.infile) events = feats.event_list(s.data) histogram, lim = feats.rhythm_histogram(events, args.resolution) for i in xrange(args.resolution): print histogram[i], print " "
def find_best_note_distribution(self, args): best_file_name = None best_score = 9000000000 for filename in args.infile: if best_file_name is None: # Avoids returning empty values best_file_name = filename with open(filename, 'rb') as handler: a = sc.Score().load(handler) event_list = feats.event_list(a.data) if len(event_list) > 0: # Avoids empty scores (max_range, mean_range, std_range) = \ feats.relative_range(event_list) if max_range < best_score: best_score = max_range best_file_name = filename print best_file_name
def find_best_note_distribution(self, args): best_file_name = None best_score = 9000000000 for filename in args.infile: if best_file_name is None: # Avoids returning empty values best_file_name = filename with open(filename, 'rb') as handler: a = sc.Score().load(handler) event_list = feats.event_list(a.data) if len(event_list) > 0: # Avoids empty scores rhythm_histogram = feats.rhythm_histogram(event_list)[0] e = scipy.stats.entropy(rhythm_histogram) if e < best_score: best_score = e best_file_name = filename print best_file_name
def run(self, args): s = score.Score().load(args.infile) events = feats.event_list(s.data) histogram = feats.interval_histogram(events, args.fold,\ args.time_tolerance, args.duration) for i in xrange(args.fold): print histogram[i], if args.statistics is True: h = numpy.array(histogram) print numpy.mean(h), print numpy.std(h), print numpy.sum(numpy.array([h[i] * numpy.log2(h[i])\ for i in xrange(len(h))\ if h[i] > 0])), for i in xrange(4): m = numpy.argmax(h) print m, h[m] = 0 print " "
def run(self, args): s = score.Score().load(args.infile) events = feats.event_list(s.data) (maxRange, meanRange, devRange) = feats.relative_range(events,\ args.time_tolerance, args.duration) print maxRange, meanRange, devRange
def run(self, args): s = score.Score().load(args.infile) events = feats.event_list(s.data) (dMean, dDev, dMin, dMax) = feats.note_density(events) print dMean, dDev, dMin, dMax