slSeanWU / MusDr

Evaluation metrics for machine-composed symbolic music. Paper: "The Jazz Transformer on the Front Line: Exploring the Shortcomings of AI-Composed Music through Quantitative Measures", ISMIR 2020
MIT License
60 stars 7 forks source link

convert midi file to csv #2

Closed wzk1015 closed 3 years ago

wzk1015 commented 3 years ago

I want to evaluate midi files with your repo, but the csv format in testdata/symbolic confuses me. How should I convert midi (or remi/cp) into the required csv format? Is there a script to do so?

slSeanWU commented 3 years ago

Hi, if you happen to have your pieces in the REMI format defined by our Jazz Transformer, then you can use the event_to_encodings() funtion in https://github.com/slSeanWU/jazz_transformer/blob/master/src/convert_to_remi.py to produce the required csv.

Unfortunately, since our original dataset (WJazzD) is not in MIDI format, we didn't write/provide the utilities which work with raw MIDIs. But you can try this: https://github.com/YatingMusic/compound-word-transformer/blob/main/dataset/Dataset.md to convert your MIDIs into REMI.

Hope this helps!

wzk1015 commented 3 years ago

I will try that. Thanks a lot!

MarcusLee-awsome commented 2 years ago

I will try that. Thanks a lot!

我想问一下您生成了响应的csv文件了吗?您可以教我一下怎么做到吗?怎么从midi转到csv? 期待您的回复。

Wangxh-07 commented 2 years ago

@wzk1015 您好,请教一下怎么样才能将midi转为这里需要的csv呢?非常感谢

wzk1015 commented 2 years ago

@wzk1015 您好,请教一下怎么样才能将midi转为这里需要的csv呢?非常感谢

Hi, if you happen to have your pieces in the REMI format defined by our Jazz Transformer, then you can use the event_to_encodings() funtion in https://github.com/slSeanWU/jazz_transformer/blob/master/src/convert_to_remi.py to produce the required csv.

Unfortunately, since our original dataset (WJazzD) is not in MIDI format, we didn't write/provide the utilities which work with raw MIDIs. But you can try this: https://github.com/YatingMusic/compound-word-transformer/blob/main/dataset/Dataset.md to convert your MIDIs into REMI.

Hope this helps!

Wangxh-07 commented 2 years ago

image

@wzk1015 我已经转换得到了remi的pkl,请问下一步需要怎么做呢?event_to_encodings()怎么根据pkl选择传入参数呢?再次感谢!

borishanzju commented 2 years ago

同问,得到了remi的pkl,下一步怎么借用event_to_encodings()方法进行生成csv