Closed Yannik1337 closed 3 years ago
That's a limitation of the piano-roll representation, but there are some ways to overcome this.
Thank you for your fast response.
Since this is a limitation of the piano-roll representation, do you know how this case is handled in a plain midi file setting? As far as I know, there is (theoretically) no limit to the time resolution, meaning one could have e.g. 512 notes per bar.
In the plain midi setting, how can one differentiate between a note pressed over one bar and 512 repeatedly struck notes?
Thanks in advance!
In MIDI, you can set a resolution (in pulses per quarter note, PPQN) at the beginning of the file. MIDI has a note-off message that indicates the end of a note. In other words, a pair of note-on and note-off message defines a note. That makes it possible to differentiate a single long note from repeatedly played notes.
Thank you for your fast response.
If you don't mind, I have a further question: For sheet music, we often have changes of the time signature; one bar in 4/4, the next in 3/4. How can this be handled in the piano roll representation? How does your library handle this case?
There is a downbeat
array designed for this. Basically, it's a boolean array that has a one at downbeat for indicating time signature changes. Reading downbeat
array from MIDI is supporting, but MIDI output is not working for now.
Reading
downbeat
array from MIDI is supporting, but MIDI output is not working for now.
If I understand this correctly, I currently can get such an array from a MIDI file, but I currently can not construct a MIDI file, given a piano roll array and secondary downbeat array?
Yes. You can still output MIDI files, but there will be no time signature messages for now.
On Fri, Jan 8, 2021 at 1:51 AM Yannik1337 notifications@github.com wrote:
Reading downbeat array from MIDI is supporting, but MIDI output is not working for now.
If I understand this correctly, I currently can get such an array from a MIDI file, but I currently can not construct a MIDI file, given a piano roll array and secondary downbeat array?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/salu133445/pypianoroll/issues/12#issuecomment-756274628, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFK27V3UDCQAFOCPPDOG5ZTSYXYBNANCNFSM4VQ4NSOQ .
Thank you for taking the time to answer all my questions - really appreciate that.
I am following your "Getting Started" section here:
How can one differentiate between a note kept pressed over a long duration (e.g. one bar), and a note played repeatedly over the same time range?
Consider a 4/4 signature, with 16 notes of 16th duration. They would be stroked repeatedly. Now, for the same bar, one could hold a whole note, which in terms of duration is the same as 16 16th notes.
How and where can this difference be modeled? In my code I tried to set the note individually at every step, but they get merged into a note hold over the according duration.
Thanks for your help!