opensheetmusicdisplay / opensheetmusicdisplay

OpenSheetMusicDisplay renders sheet music in MusicXML format in your web browser based on VexFlow. OSMD is brought to you by PhonicScore.com.
https://opensheetmusicdisplay.org
BSD 3-Clause "New" or "Revised" License
1.43k stars 286 forks source link

Only one staff-line is displayed instead of 5 #1254

Closed mauxion closed 1 year ago

mauxion commented 1 year ago

My scorepartwise is displayed with only 1 staff-line despite the fact that I didn't specify in staff-details->staff-lines

I have this problem only with this file. All other my drum notes created with the same way displayed correct. And when I add staff-details->staff-lines to attributes it works as expected.

OSMD version 1.5.8

Expected: image

Actual: image

My settings:

backend: 'Canvas', drawTitle: false, drawPartNames: false, pageFormat: 'Endless', drawFingerings: false, drawCredits: false, drawMetronomeMarks: false, drawTimeSignatures: false, renderSingleHorizontalStaffline: true, autoResize: false, coloringMode: 0, pageBackgroundColor: '#FFFFFF', performanceMode: false, drawingParameters: 'compacttight', drawUpToMeasureNumber: Number.MAX_SAFE_INTEGER osmd.EngravingRules.RenderClefsAtBeginningOfStaffline = false

Here is file itself: (sorry for .txt format, can't upload .musicxml or .xml) SwingOnRide.txt

Related to:

1252

1253

sschmidTU commented 1 year ago

You should set osmd.EngravingRules.PercussionOneLineCutoff = 0.

image

We should probably think about not having one line percussion parts by default, though they are only used when there are 3 or less different tones by default, in which case they usually save a lot of space in scores with multiple parts while still being easy to read.

mauxion commented 1 year ago

PercussionOneLineCutoff helped, thank you!

mauxion commented 1 year ago

but now I've got another problem. When I have multiple parts, one-line parts looks not correct. "Backbeat" part has staff-details->staff-lines 1.

Expected image

Actual image

sschmidTU commented 1 year ago

Interesting, can you share the file again? We can probably check for the staff-lines attribute and better coordinate it with the positioning and PercussionOneLineCutoff. I haven't seen a score with both one line and multiline drums before.

sschmidTU commented 1 year ago

@mauxion You can try changing PercussionXMLDisplayStepNoteValueShift, though I'm not sure why the notes are so far below the line in this case with default settings. It's possible that different programs export the line height / display step differently. I vaguely remember that it's not always the same mapping. But I could be wrong.

mauxion commented 1 year ago

Sure, here is a file TwoParts.txt

I'm not doing any export from program, this musicxml is generated by my software and I add\remove staff-lines intentionally because I do mix of rhythms\drum beats so I thought that it would be comfortable for user to see parts with one instrument on one line and parts with number of instruments on 5 lines.

This issue is not critical for me, but I really appreciate your help, thx.

JFYI: here is the idea of my app https://www.youtube.com/watch?v=CLCur9BLzFI now I'm working on web version made totaly with kotlin (kotlin multiplaform\koltin-js\kotlin-react)

sschmidTU commented 1 year ago

Then maybe you're not setting display-step correctly. See here: https://www.w3.org/2021/06/musicxml40/musicxml-reference/elements/display-step/

Otherwise, as I said, try adjusting the shift.

I think the line should be an E if I remember correctly, like the bottom line of a treble clef.

mauxion commented 1 year ago

thx, I'll do change for display-step in conjunction with adding staff-lines