def note_from_midi_test(file):
    thresh = 40
    s = NoteSequencer(file)

    for k,v in s.get_note_seq():
        note_seq = []
        for x in v:
            n = int(x[2]/thresh)
            if(n > 1):
                note_seq.extend([x[0]]*n)
            else:
                note_seq.append(x[0])
        yield k,note_seq
Beispiel #2
0
def note_from_midi_test(file):
    thresh = 40
    s = NoteSequencer(file)

    for k, v in s.get_note_seq():
        note_seq = []
        for x in v:
            n = int(x[2] / thresh)
            if (n > 1):
                note_seq.extend([x[0]] * n)
            else:
                note_seq.append(x[0])
        yield k, note_seq
def note_from_midi(file):
    thresh = 40
    s = NoteSequencer(file)

    for k,v in s.get_note_seq():
        note_seq = []
        for x in v:
            n = int(x[2]/thresh)
            if(n > 1):
                note_seq.extend([x[0]]*n)
            else:
                note_seq.append(x[0])

        note_array = np.array(note_seq)
        note_array = note_array - note_array.mean()
        #ff = 'aaa' + file + '.txt'
        #vector_to_file(note_array,ff)
        for note in sliding_window(note_array,ws=10,shift_ratio=0.1):
            yield note,file
Beispiel #4
0
def note_from_midi(file):
    thresh = 40
    s = NoteSequencer(file)

    for k, v in s.get_note_seq():
        note_seq = []
        for x in v:
            n = int(x[2] / thresh)
            if (n > 1):
                note_seq.extend([x[0]] * n)
            else:
                note_seq.append(x[0])

        note_array = np.array(note_seq)
        note_array = note_array - note_array.mean()
        #ff = 'aaa' + file + '.txt'
        #vector_to_file(note_array,ff)
        for note in sliding_window(note_array, ws=10, shift_ratio=0.1):
            yield note, file