Exemple #1
0
    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()
Exemple #2
0
def test_ns_tempo_valid():

    ann = Annotation(namespace='tempo')

    ann.append(time=0, duration=0, value=1, confidence=0.85)

    ann.validate()
Exemple #3
0
    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()
Exemple #4
0
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()
Exemple #5
0
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()
Exemple #6
0
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()
Exemple #7
0
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()
Exemple #8
0
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()
Exemple #9
0
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()
Exemple #10
0
    def __test(tag):
        ann = Annotation(namespace='tag_medleydb_instruments')

        ann.append(time=0, duration=1, value=tag)

        ann.validate()
Exemple #11
0
    def __test(value, confidence):
        ann = Annotation(namespace='tempo')

        ann.append(time=0, duration=0, value=value, confidence=confidence)

        ann.validate()
Exemple #12
0
    def __test(tag):
        ann = Annotation(namespace='tag_gtzan')

        ann.append(time=0, duration=1, value=tag)

        ann.validate()
Exemple #13
0
    def __test(tag, confidence=None):
        ann = Annotation(namespace='tag_msd_tagtraum_cd2')

        ann.append(time=0, duration=1, value=tag, confidence=confidence)

        ann.validate()
Exemple #14
0
    def __test(keymode):
        ann = Annotation(namespace='key_mode')

        ann.append(time=0, duration=0, value=keymode, confidence=None)

        ann.validate()
Exemple #15
0
 def __test(value):
     ann = Annotation(namespace='pitch_midi')
     ann.append(time=0, duration=0, value=value, confidence=0.5)
     ann.validate()
Exemple #16
0
    def __test(keymode):
        ann = Annotation(namespace='key_mode')

        ann.append(time=0, duration=0, value=keymode, confidence=None)

        ann.validate()
Exemple #17
0
    def __test(data):
        ann = Annotation(namespace='onset')
        ann.append(**data)

        ann.validate()
Exemple #18
0
    def __test(value):
        ann = Annotation(namespace='multi_segment')

        ann.append(time=0, duration=1, value=value)

        ann.validate()
Exemple #19
0
    def __test(lyric):
        ann = Annotation(namespace='lyrics')

        ann.append(time=0, duration=1, value=lyric)

        ann.validate()
Exemple #20
0
    def __test(chord):
        ann = Annotation(namespace='chord_roman')

        ann.append(time=0, duration=1.0, value=chord)

        ann.validate()
Exemple #21
0
    def __test(tag):
        ann = Annotation(namespace='tag_cal500')

        ann.append(time=0, duration=1, value=tag)

        ann.validate()
Exemple #22
0
    def __test(lyric):
        ann = Annotation(namespace='lyrics')

        ann.append(time=0, duration=1, value=lyric)

        ann.validate()
Exemple #23
0
    def __test(label):
        ann = Annotation(namespace='segment_salami_function')

        ann.append(time=0, duration=1, value=label)

        ann.validate()
Exemple #24
0
    def __test(chord):
        ann = Annotation(namespace='chord_roman')

        ann.append(time=0, duration=1.0, value=chord)

        ann.validate()
Exemple #25
0
    def __test(value, confidence):
        ann = Annotation(namespace='tempo')

        ann.append(time=0, duration=0, value=value, confidence=confidence)

        ann.validate()
Exemple #26
0
 def __test(value):
     ann = Annotation(namespace='mood_thayer')
     ann.append(time=0, duration=1.0, value=value)
     ann.validate()
Exemple #27
0
    def __test(label):
        ann = Annotation(namespace='vector')

        ann.append(time=0, duration=1, value=label)

        ann.validate()
Exemple #28
0
 def __test(value):
     ann = Annotation(namespace='pitch_midi')
     ann.append(time=0, duration=0, value=value, confidence=0.5)
     ann.validate()
Exemple #29
0
 def __test(value):
     ann = Annotation(namespace='beat_position')
     ann.append(time=0, duration=1.0, value=value)
     ann.validate()
Exemple #30
0
 def __test(value):
     ann = Annotation(namespace='mood_thayer')
     ann.append(time=0, duration=1.0, value=value)
     ann.validate()