vexflow icon indicating copy to clipboard operation
vexflow copied to clipboard

One-line (etc.) staves have unusual line configuration

Open mscuthbert opened this issue 3 years ago • 2 comments

Generally a one-line staff is thought of as having the middle line shown, not the lowest or the highest. (This way it goes through the center of the alto or percussion clef). Here is how music21j configures non-5-line staves in Vexflow:

            if (rendOp.staffLines === 0) {
                vexflowStave.setNumLines(0);
            } else if (rendOp.staffLines === 1) {
                // Vex.Flow.Stave.setNumLines hides all but the top line.
                // this is better
                vexflowStave.setConfigForLines([
                    { visible: false },
                    { visible: false },
                    { visible: true },  // show middle
                    { visible: false },
                    { visible: false },
                ]);
            } else if (rendOp.staffLines === 2) {
                vexflowStave.setConfigForLines([
                    { visible: false },
                    { visible: false },
                    { visible: true },  // show offset middle
                    { visible: true },
                    { visible: false },
                ]);
            } else if (rendOp.staffLines === 3) {
                vexflowStave.setConfigForLines([
                    { visible: false },
                    { visible: true },
                    { visible: true },  // show 3 middle
                    { visible: true },
                    { visible: false },
                ]);
            } else {
                vexflowStave.setNumLines(rendOp.staffLines);
            }

There would be some backwards incompatibility, I imagine, but it would create a much better experience.

mscuthbert avatar Aug 30 '22 00:08 mscuthbert

@mscuthbert do you want me to change that? I only use 5 lines staves.

rvilarl avatar Dec 25 '22 19:12 rvilarl

I think so, but it's pretty backwards incompatible, so I'd put it in a 5.0 branch. But yes, people expect a one-line staff to be the middle line (and a 2 line staff to be the middle and one adjacent line -- probably middle and below?; a 3-line staff to be the three middle lines. A four-line staff though should probably be the four lowest lines, since people tend to count from the lowest in chant notation.

mscuthbert avatar Dec 27 '22 07:12 mscuthbert