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.45k stars 289 forks source link

Some drum related notation query #887

Open nitzanrh opened 4 years ago

nitzanrh commented 4 years ago

Hi there,

I'm working on implementing OSMD with a drum related app, and there are a few 'conventions' in the drum notation world that I find OSMD not supporting/not presenting properly:

  1. Accents placements: it seems that OSMD does not respect the "placement" tag in XML for accents (ie above or below)
  2. Flams: Flams are usually notated as grace notes which tie to the following note. OSMD does not respect the tie
  3. Rolls: notated as tremolo lines. OSMD tremolo lines appear somewhat 'thin'
  4. Ghost notes: notated as notes with parentheses. OSMD does not respect the XML notehead parentheses tag
  5. Open and closed hi hats: notated as + and o signs. OSMD does not respect the 0 sign, as well as not respecting the placement tag for + sign

Attached is the XML file: (https://github.com/opensheetmusicdisplay/opensheetmusicdisplay/files/5251738/playbackTest.xml.zip)

Screenshot of the file rendered in OSMD osmd

Screenshot of the file rendered in a different XML rendering software (other than ignoring the parentheses, all looks fine) otherRenderingSoftware

I understand that all of these are VERY specific rendering situations, as most of them are unique to the drums/percussion world. My question is whether there are any plans to fix/add any of them. If not, I would appreciate your guidance as to how to go about fixing them on my own :)

Cheers, Nitzan

sschmidTU commented 4 years ago
nitzanrh commented 4 years ago

Hi sschimdUT,

Thanks for your quick reply on the matter, and for pushing the fixes so quickly!

I built the js.min file from the latest Github build and I'm trying to use the new EngravingRules, but I don't see any changes in the score:

console.log("STROKES BEFORE RENDER", osmd.EngravingRules.TremoloStrokeScale)
console.log("SPACING BEFORE RENDER", osmd.EngravingRules.TremoloYSpacingScale)

osmd.EngravingRules.TremoloStrokeScale = 2.0;
osmd.EngravingRules.TremoloYSpacingScale = 2.0;

osmd.render();

console.log("STROKES AFTER RENDER", osmd.EngravingRules.TremoloStrokeScale)
console.log("SPACING AFTER RENDER", osmd.EngravingRules.TremoloYSpacingScale)

The results from console are as expected, ie 1 before the render and 2 after the render, but the tremolo strokes look the same... What am I missing?

Cheers, Nitzan

sschmidTU commented 4 years ago

Oh, I forgot to mention the Vexflow fix file I added. You'll have to copy src/VexFlowPatch/src/tremolo.js (and the other files in that folder if you wish) to node_modules/vexflow/src/. edit: prebuild script is now done and integrated on develop.

nitzanrh commented 4 years ago

Nope, still can't get it to work.

Just to make sure, here is what I did: I downloaded the osmd src files as mentioned here: https://github.com/opensheetmusicdisplay/opensheetmusicdisplay/wiki/Build-Instructions I replaced the tremolo.js file with the one you provided: https://github.com/opensheetmusicdisplay/opensheetmusicdisplay/blob/develop/src/VexFlowPatch/src/tremolo.js Then ran "npm run build"

Cheers, Nitzan

sschmidTU commented 4 years ago

Hmm, that is strange. I added the prebuild script to develop yesterday that does the Vexflow patch for you. Can you pull the latest develop branch again, and run npm install? (you'll need the ncp package now) And make sure this line runs without errors: ncp src/VexFlowPatch/src/ node_modules/vexflow/src/

npm run build will be done automatically by npm install.

You can also try this in our official demo, which i updated as well: image https://opensheetmusicdisplay.github.io/demo/

nitzanrh commented 3 years ago

Hi @sschmidTU ,

Thanks for your detailed post and apologies for my late reply.

  1. Regarding tremolos: I tried it out on the demo and the YSpacing works well, however I think the StrokesScale doesn't work as I expected it to; for example if you use 0.4 the tremolo line doesn't 'go through' the beam, it barely touches it. I would expect the line to still be centred around the beam (ie the beam should pass through the middle of the tremolo line). Also, I think the tremolo lines should be thicker (see my first post for a screenshot on a different platform, or even the Wikipedia entry for tremolo). Perhaps add another Engraving rule for line width (aka thickness)? IE you would have 3 paramters for the tremolo rules: Y-spacing, length (aka scale?) and width (aka thickness). I hope this makes sense :)

  2. Regarding ties: I managed to solve this by adding a slur instead of a tie, which I think also makes more sense from a duration point of view.

  3. Regrading parentheses: this is very important for my application, however I understand this might not be top priority for OSMD. I can come up with a 'hacky' way of drawing the parentheses myself, but I'm kinda stuck on how to recognise them via OSMD: do you have any suggestion as to how can I 'mark' them in XML via Musescore in a way that wouldn't affect their display is OSMD but will allow me to differentiate them from the other notes?

Cheers, Nitzan