magenta / note-seq

A serializable note sequence representation and utilities.
Apache License 2.0
217 stars 57 forks source link

Array representation #47

Open meliksahturker opened 3 years ago

meliksahturker commented 3 years ago

How can I use note-seq to represent and convert polyphonic MIDI file as array/n-dim matrix?

Since monophonic melody can be represented as 1-D array of integers with quantization, I assume polyphonic ones can be represented as n-D array?

My aim is to obtain raw array of notes(integers) and train custom NN other than magenta.

I spent some time on source code and unofficial documentation @wtong98 provided here with no solution.

AI-Guru commented 3 years ago

I guess one way would be quantizing the note sequence, which will make the time dimension discrete and then use a custom mapper.

Also, you could check out the PianoRoll class which is part of note_seq.