Plugin coding: selection vs staves vs cursors

• Jul 1, 2019 - 15:26

I tried to find documentation about how cursors and staff numbers behave when the user selects a region "a few staves short of a full score", as it were. I think asking here might be quicker than developing code to explor it. Yes, I looked in the "MS Plugin Developer's handbook" and could not find this addressed. Is this not the right place to ask?


Comments

Cursor has access to a track which is the internal counter of all voices across the full score (counting vertically).
As each staff has 4 voices allocated to it, you can convert a track to a staff & voice using /4 and %4 respectively.

When you rewind a Cursor to the SELECTION_START position, then (assuming a selection exists) it'll position itself at the "top-left" position of the selection. You can query which track/staffIdx/voice that is respectively. As far as I'm aware, it always positions itself at the first voice of the first staff within the selection (wonders what happens in combination with the selection filter now)

Similarly, if you move the Cursor to SELECTION_END it'll be at the "bottom-right" position of the selection.

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