LSTM 旋律生成 2019-4-16
- python-midi
- import parsers
- parser = parsers.MidiParser()
- sequence = parser.parse("midi file path")
- import parsers
- parser = parsers.MidiParser()
- sequence = parser.parse("midi file path")
- parser = parsers.SequenceParser()
- melody = parser.get_monosyllabic_melody(sequence)
- import parsers
- parser = parsers.MidiParser()
- sequence = parser.parse("midi file path")
- parser = parsers.SequenceParser()
- melody = parser.get_monosyllabic_melody(sequence)
- matrix = parser.monosyllabic_melody_to_matrix(melody)
- 考虑跳音,连音,滑音等,使用16种音符时间,88个音符,加上休止符,转为1424维的one-hot向量
- 运行train.py
- 运行predict.py