def __test(pattern): ann = Annotation(namespace='pattern_jku') ann.append(time=0, duration=1.0, value=pattern) ann.append(time=1.0, duration=1.0, value=pattern) ann.validate()
def test_ns_tempo_valid(): ann = Annotation(namespace='tempo') ann.append(time=0, duration=0, value=1, confidence=0.85) ann.validate()
def __test(pitch): ann = Annotation(namespace='pitch_class') ann.append(time=0, duration=1.0, value=pitch) ann.append(time=1.0, duration=1.0, value=pitch) ann.validate()
def test_ns_mood_thayer_valid(): ann = Annotation(namespace='mood_thayer') ann.append(time=0, duration=1.0, value=[0.3, 2.0]) ann.validate()
def test_ns_time_valid(): ann = Annotation(namespace='onset') for time in np.arange(5.0, 10.0): ann.append(time=time, duration=0.0, value=None, confidence=None) ann.validate()
def test_ns_beat_invalid(): ann = Annotation(namespace='beat') for time in np.arange(5.0): ann.append(time=time, duration=0.0, value='foo', confidence=None) ann.validate()
def test_ns_beat_position_valid(): ann = Annotation(namespace='beat_position') ann.append(time=0, duration=1.0, value=dict(position=1, measure=1, num_beats=3, beat_units=4)) ann.validate()
def test_ns_beat_valid(): # A valid example ann = Annotation(namespace='beat') for time in np.arange(5.0): ann.append(time=time, duration=0.0, value=1, confidence=None) for time in np.arange(5.0, 10.0): ann.append(time=time, duration=0.0, value=None, confidence=None) ann.validate()
def test_ns_pitch_midi_valid(): ann = Annotation(namespace='pitch_midi') seq_len = 21 # should be odd times = np.arange(seq_len) durations = np.zeros(seq_len) values = np.linspace(-108., 108, seq_len) # includes 0 (odd symmetric) confidences = np.linspace(0, 1., seq_len) confidences[seq_len//2] = None # throw in a None confidence value for (t, d, v, c) in zip(times, durations, values, confidences): ann.append(time=t, duration=d, value=v, confidence=c) ann.validate()
def __test(tag): ann = Annotation(namespace='tag_medleydb_instruments') ann.append(time=0, duration=1, value=tag) ann.validate()
def __test(value, confidence): ann = Annotation(namespace='tempo') ann.append(time=0, duration=0, value=value, confidence=confidence) ann.validate()
def __test(tag): ann = Annotation(namespace='tag_gtzan') ann.append(time=0, duration=1, value=tag) ann.validate()
def __test(tag, confidence=None): ann = Annotation(namespace='tag_msd_tagtraum_cd2') ann.append(time=0, duration=1, value=tag, confidence=confidence) ann.validate()
def __test(keymode): ann = Annotation(namespace='key_mode') ann.append(time=0, duration=0, value=keymode, confidence=None) ann.validate()
def __test(value): ann = Annotation(namespace='pitch_midi') ann.append(time=0, duration=0, value=value, confidence=0.5) ann.validate()
def __test(data): ann = Annotation(namespace='onset') ann.append(**data) ann.validate()
def __test(value): ann = Annotation(namespace='multi_segment') ann.append(time=0, duration=1, value=value) ann.validate()
def __test(lyric): ann = Annotation(namespace='lyrics') ann.append(time=0, duration=1, value=lyric) ann.validate()
def __test(chord): ann = Annotation(namespace='chord_roman') ann.append(time=0, duration=1.0, value=chord) ann.validate()
def __test(tag): ann = Annotation(namespace='tag_cal500') ann.append(time=0, duration=1, value=tag) ann.validate()
def __test(label): ann = Annotation(namespace='segment_salami_function') ann.append(time=0, duration=1, value=label) ann.validate()
def __test(value): ann = Annotation(namespace='mood_thayer') ann.append(time=0, duration=1.0, value=value) ann.validate()
def __test(label): ann = Annotation(namespace='vector') ann.append(time=0, duration=1, value=label) ann.validate()
def __test(value): ann = Annotation(namespace='beat_position') ann.append(time=0, duration=1.0, value=value) ann.validate()