Ejemplo n.º 1
0
def make_data_set():
    data = []
    for path, subdirs, files in os.walk(tempo_folder):
        for name in files:
            _path = path.replace('\\', '/') + '/'
            _name = name.replace('\\', '/')
            pianoroll = mf.get_pianoroll(_name, _path, melody_fs)
            song = mf.pianoroll_to_note_index(pianoroll)
            data.append(song)
    return data
Ejemplo n.º 2
0
def histo_of_all_songs():
    histo = [0]*128
    for path, subdirs, files in os.walk(tempo_folder):
        for name in files:
            _path = path.replace('\\', '/') + '/'
            _name = name.replace('\\', '/')
#            _name = _name[:-7]
            pianoroll = mf.get_pianoroll(_name, _path, fs)
            histo += np.sum(pianoroll, axis=1)
#            print(histo)
#            print(_name)
    return histo