Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 04:00
    rvilarl commented #1171
  • 03:50
    rvilarl opened #1171
  • 03:20
    rvilarl commented #1170
  • May 16 22:43
    sschmidTU commented #1170
  • May 16 22:42
    sschmidTU commented #1170
  • May 16 21:17
    rvilarl opened #1170
  • May 16 19:45
    sschmidTU commented #1169
  • May 16 19:45
    sschmidTU commented #1169
  • May 16 19:44
    sschmidTU commented #1169
  • May 16 19:44
    sschmidTU closed #1169
  • May 16 19:44
    sschmidTU commented #1169
  • May 16 19:25
    rvilarl opened #1169
  • May 13 10:37
    geniot commented #670
  • May 13 10:36
    geniot commented #670
  • May 13 09:45
    sschmidTU commented #670
  • May 13 09:41
    sschmidTU commented #670
  • May 13 09:39
    sschmidTU commented #670
  • May 13 09:38
    sschmidTU commented #670
  • May 13 09:18
    geniot commented #670
  • May 13 09:05
    geniot commented #670
Simon
@sschmidTU
@anseldu_gitlab because the cursor relies on a transparent backgroundcolor. It's a limitation of how the cursor works in HTML. Feel free to try to improve the cursor display, it's pretty simple code.
Ansel Du
@anseldu_gitlab
@sschmidTU thx! another question , how can I get the VoiceId from a note object?
Simon
@sschmidTU
@anseldu_gitlab note.ParentVoiceEntry.ParentVoice.VoiceId
Simon
@sschmidTU
@vivachenx no. it's not supported by MusicXML either. opensheetmusicdisplay/opensheetmusicdisplay#698
Simon
@sschmidTU
@vivachenx yes. see the OSMD Function Test - Tablature in the demo.
Gregg Larson
@momolarson
@vivachenx - you can see example here: https://player.guitartabcreator.com/86491
Simon
@sschmidTU
@vivachenx no, only chord symbols/text
image.png
@vivachenx ^
Hallvord R. M. Steen
@hallvors
Hi again :) I would like to experiment with the extended version again - although I have written quite some code for cursor movement and such I know that my code could be a lot simpler and cleaner if I left that stuff to OSMD-extended :) So I'd like to ask if I could check in a built and compressed/obfuscated OSMD-extended file into my own repo? If I run the tools to obfuscate it locally and just check in the results somewhere I can figure out how to get it into the regular build process running on a server I suppose..
I don't think this in practise would be much different from what you suggested (building with Webpack or similar locally so the OSMD lib becomes a part of the site's own bundles of code). If I did that it could still be extracted in a sort of obfuscated built version.
(There will be some maintenance work if the library depends on files - perhaps web worker .js files or sound fonts or something? - that I would also have to track and check in to my repo. But if this approach sounds like something you would allow, I will do some experiments in this direction)
Hallvord R. M. Steen
@hallvors
Also, can I listen to a touch/click event and easily tell what measure a touch/click hit? As in "User touched measure 5!" or something?
Simon
@sschmidTU
@hallvors yes, if the build is compressed/obfuscated, you can check it in, but please keep it low profile, as in, not advertising "hey look this is an exclusive osmd build!" or something ;)
yes, there are click events in osmd-extended, just look at how setting the cursor start position works. you can get the measure from the position. (e.g. from the notes under the cursor)
Hallvord R. M. Steen
@hallvors
Thank you @sschmidTU , I will keep it all undercover :D. A quick code sample for getting to the measure would be v appreciated - I suppose it's not quite as simple as event.targetNote.parentMeasure .. :)
(but if you are busy I'll experiment tomorrow ;) )
Other random question: how small screens do you reckon it is convenient to render notes on? Any good tricks or demos for making a usable OSMD-based UI on a phone? :)
Simon
@sschmidTU
@hallvors osmd.renderingManager.addListener(myListener)
look at renderingManager.handleUserDisplayInteraction() for inspiration. you can get the nearest voice entry clicked, which will lead to the parent measure.
phones are very tricky for displaying sheet music, on the low end of screen space. probably you need to use landscape mode. try our app PracticeBird for inspiration ;)
Simon
@sschmidTU
@vivachenx It's not a focus of OSMD currently. You are free to implement it.
Simon
@sschmidTU
i don't know what you mean
Simon
@sschmidTU
what is a track note?
you can set note.PrintObject = false and call render() again
Simon
@sschmidTU
With the current version on develop you can also get a note's SVG node, and its stem SVG node, and delete it. will be in OSMD 1.4 soon
Simon
@sschmidTU
That's not possible.
Simon
@sschmidTU
No, there is no SVG getter for a whole staffline.
Jon Lee
@jdlee022
Hi @sschmidTU, I just signed up as an OSMD sponsor. The github README said to tell you my discord username - HonorableJudge
Simon
@sschmidTU
@jdlee022 thank you! i'll give you the sponsor roles in Discord so that you can see the sponsor channels.
Paul
@paulmattu
Hi guys i‘m curious if i‘m doing something wrong with that transpose function. But the Stems dont change their direction (up/down) by passing the middle line (3. line) or?
Simon
@sschmidTU
transposing doesn't change stem directions, which are given in XML.
Andrew
@Andrew13648
Can anyone tell me if there is an easy way to get a bounding box around a notehead? I found I can do osmd.cursor.GNotesUnderCursor()[0].getSVGGElement().getBBox() to get a bbox around the full note (including stems), but I only want the notehead. I found there is a notehead().boundingBox but looks like it is null. For context, I'm trying to dynamically draw a line through a notehead using Drawer.DrawOverlayLine just in case there is a easier way to achieve this.
Simon
@sschmidTU
@Andrew13648 you should be able to use osmd.cursor.GNotesUnderCursor()[0].PositionAndShape.AbsolutePosition. Multiply x and y by 10, as svg/vexflow coordinates are osmd coordinates * 10.
Andrew
@Andrew13648
@sschmidTU Great, it worked perfectly; thanks!
tangtao007
@tangtao007
image.png
hello,how can i get the sf tag? thanks
Simon
@sschmidTU
@tangtao007 for example like this: osmd.Sheet.SourceMeasures[0].StaffLinkedExpressions[0][0].InstantaneousDynamic
Alex Sherwin
@alex-sherwin

@sschmidTU I'm rendering a MusicXML in a single-line only (I collaborated with you on GH to remove the SVG max width limitation) ..

I've been searching through the docs and past issues, but I can't find a way to set a minimum measure width anywhere.. is that possible? For example when a measure has a single rest or whole note, I'd like to set some fixed minimum width so it's not rendered so small

Alex Sherwin
@alex-sherwin
I was able to find a super, super hacky way to do this by monkey patching the GraphicalMeasure.setWidth (prototype fn) and MusicSheetCalculator.setMeasuresMinStaffEntriesWidth (static fn) to set the values to Max([existing value], MIN_WIDTH):
const hackOSMDMinWidth = () => {

  const MIN_MEASURE_WIDTH = 20;

  GraphicalMeasure.prototype.setWidth = function (w: number) {
    this.PositionAndShape.BorderRight = Math.max(w, MIN_MEASURE_WIDTH);
  };

  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  (MusicSheetCalculator as any).setMeasuresMinStaffEntriesWidth = function (measures: GraphicalMeasure[], minimumStaffEntriesWidth: number): void {
    for (let idx = 0, len = measures.length; idx < len; ++idx) {
      const measure: GraphicalMeasure = measures[idx];
      if (measure) {
        // measure.minimumStaffEntriesWidth = minimumStaffEntriesWidth;
        measure.minimumStaffEntriesWidth = Math.max(minimumStaffEntriesWidth, MIN_MEASURE_WIDTH);
      }
    }
  };

};
tangtao007
@tangtao007
image.png
@sschmidTU Thank you, but I didn't find what I was looking for
image.png
  for(let i = 0; i < 38; i++){
    if(this.osmd.Sheet.SourceMeasures[i].StaffLinkedExpressions[0][0] && this.osmd.Sheet.SourceMeasures[i].StaffLinkedExpressions[0][0].InstantaneousDynamic){
      console.log("DynEnum",this.osmd.Sheet.SourceMeasures[i].StaffLinkedExpressions[0][0].InstantaneousDynamic.DynEnum);
      console.log("i:" + i);
    }
  }
image.png
tangtao007
@tangtao007

image.png

it should be able to get type 14,but not find

this.osmd.Sheet.SourceMeasures[7].StaffLinkedExpressions[0][0].InstantaneousDynamic.DynEnum

tangtao007
@tangtao007
thanks I got it...
Simon
@sschmidTU
@alex-sherwin yes, there's no in-built option for that currently, because it would look bad for a lot of measures / sheets.
glad you could find a workaround
tangtao007
@tangtao007
image.png
image.png
Please tell me why the exception is showing,I use sibelius to musicxml thanks.
Simon
@sschmidTU
not sure what you mean, but if you mean the direction of the slur, you can change that in the musicxml.