Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix get_piano_roll pedal implementation #195

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

TimFelixBeyer
Copy link
Contributor

@TimFelixBeyer TimFelixBeyer commented Nov 6, 2020

I'm not entirely sure whether I precisely understand the desired output of get_piano_roll.
However, after comparing it with https://github.com/magenta/note-seq/tree/master and the piano-roll from there I think there are two small issues with it:
One is an off-by-one error and the other happens when a note offset happens just before/after the pedal is pressed down:

Due to rounding, the pedal might be pressed after the note offset has already occurred.
For example, both offset a and offset b round to t0, and would be held:

t0--------->t0+fs
|      *     |  pedal
| *          | offset a -> should not be held
|          * | offset b -> should be held

Again I'm not sure whether the spec of get_piano_roll is different from other piano rolls.
I think regardless of that, the pedal issue should be addressed.

A small issue that happens when a note offset happens just before/after the pedal is pressed down.

Due to rounding, the pedal might be pressed after the note offset has already occurred.
For example, both offset a and offset b round to t0, and would be held:
t0-->t0+fs
|      *     |  pedal
| *          | offset a -> should not be held
|          * | offset b -> should be held
@craffel
Copy link
Owner

craffel commented Nov 6, 2020

@maezawa-akira added the sustain pedal functionality, maybe he can comment?

@TimFelixBeyer
Copy link
Contributor Author

It seems like @maezawa-akira is not active on GitHub anymore.
How would you like to proceed?

@page200
Copy link

page200 commented Mar 22, 2022

after comparing it with https://github.com/magenta/note-seq/tree/master and the piano-roll from there

@TimFelixBeyer I can't find the documentation under this link. Do you have code at hand for creating a piano roll from a MIDI file in magenta?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants