Changing Piano Roll editor to support 12 tones per octave

• Jun 21, 2018 - 05:36

I was thinking of doing some hacking on the code and wanted to post here before getting deep into it. I was thinking of changing the Piano Roll Editor so that it would have rows for all twelve tones in the octave rather than the seven scale degrees currently displayed.

The 12 tone grid style is the style used by most commercial program's piano rolls. It would also allow a much smoother layout where every semitone is equally separated. The current system awkwardly inserts semitones between scale degrees outside of bar lines. If you write a chromatic scale, instead of it going up evenly, there are noticeable jumps between B/C and E/F.

I'd also like to change the vertical scaling mechanism in the editor which right now simply performs a transform() on the rendered graphics - this is both inefficient and leads to scaling artifacts. It would be better to establish a semitone width and then use that to layout the grid vertically.

If all goes well, I may even be able to add drag and drop support to allow note editing in the editor.

Anyhow, let me know if you think this is a good idea.


Comments

While you're at it, there are other bugs in the piano-roll editor that you might look at - although I realize that they are unrelated to your specific issue:
1) When opened, the cursar does not go to the measure selected in the score; you have to drag the cursar to the current measure.
2) When the note duration is changed, the change does not appear immediately; you have to close the editor and reopen it to see the new duration.

Interestingly, IIRC both these things worked correctly in MS 2.0 - some subsequent mod seems to have caused this behavior.

I have also been saying for a long time that the note durations should be scaled to fractions of a beat, instead of 1000 = full duration.

In reply to by dhfx

I've been looking at the way note durations are implemented in the editor and am a little confused about how the NoteEvents are being used. According to Marc in this post (https://musescore.org/en/node/273653), note events are generated during playback which makes me think that the note event data could be discarded and rebuilt at any time and hence the piano roll editor should ignore them. However, the piano roll works by taking all the NoteEvents that are attached to the Notes and displaying and editing their data directly.

This stikes me as potentially incorrect behavior. While I do agree that the editor should be able to change note length, doing it by editing the NoteEvent seems to me to be incorrect behavior.

Do you still have an unanswered question? Please log in first to post your question.