Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jul 05 08:49
    zc52406 opened #1181
  • Jun 28 15:46
    sschmidTU commented #1180
  • Jun 28 15:45
    sschmidTU commented #1180
  • Jun 28 15:44
    sschmidTU commented #1180
  • Jun 26 01:57
    nicholasjconn commented #1180
  • Jun 25 00:45
    nicholasjconn edited #1180
  • Jun 24 23:25
    nicholasjconn opened #1180
  • Jun 24 19:00
    joshstovall commented #1178
  • Jun 20 12:17
    sschmidTU commented #1178
  • Jun 20 12:16
    sschmidTU commented #1178
  • Jun 18 20:59
    sschmidTU commented #1179
  • Jun 18 20:58
    sschmidTU closed #1179
  • Jun 18 20:54
    ComposingGloves commented #1179
  • Jun 18 20:48
    sschmidTU commented #1179
  • Jun 18 20:47
    sschmidTU labeled #1179
  • Jun 18 20:47
    sschmidTU commented #1179
  • Jun 18 20:47
    sschmidTU commented #1179
  • Jun 18 20:22
    ComposingGloves opened #1179
  • Jun 18 06:50
    joshstovall opened #1178
  • Jun 14 19:51

    sschmidTU on get-nearest-staffentry-multirest

    try fixing getNearestStaffEntry… (compare)

Simon
@sschmidTU
yeah there sometimes seem to be weird conditions where render seems to be called multiple times. are you using a similar index.js as in our demo? have you tried deactivating / not using autoResize?
and yes render is synchronous
not sure what the relevant changes from 0.8.7 onwards could be
Hallvord R. M. Steen
@hallvors
I re-tested with 0.8.7 and it happened there too, apparently I just haven't tested enough to see it before. The IDs of the vf-stavenote elements change, so it's definitely a re-render. I'll try turning autoResize off - thanks for that tip :)
Seems to work better without autoResize! Maybe JSDOM isn't as synchronous as it should be? :)
Thanks A LOT (again) for that tip. No idea how much time I would have spent debugging this otherwise..
phamconganh
@phamconganh
@sschmidTU in the sheet which has multiple instruments, can't we show one instrument system and hide other instruments? It would be great if we learn the single instrument and in the playback options we can turn on or turn off other instruments' sounds (as a member of the symphony).
Simon
@sschmidTU

hallvors, glad that seems to be the solution!

@phamconganh yes you can. osmd.sheet.Instruments[1].Visible = false before render.

Hallvord R. M. Steen
@hallvors
How is the better cursor implementation doing? I have been trying to implement one and it mostly works..mostly :)
Hallvord R. M. Steen
@hallvors

I sometimes see this:

TypeError: this.vfnote is undefined
    getSVGGElement opensheetmusicdisplay.min.js:1

when calling ... graphicalVoiceEntries[l].notes[m].getSVGGElement() - is this expected?

Hallvord R. M. Steen
@hallvors
This seems to happen on collapsed multi-measure pauses ^.
Simon
@sschmidTU
what do you mean, better cursor implementation? if you mean multiple cursors, that's still an open PR
hmm never seen that before
oh yeah
multi-measures don't have notes, so avoid checking cursor notes there
Hallvord R. M. Steen
@hallvors
I mean the "play through" mode that will move the cursor according to durations and repeats - I have an implementation, but yours will probably be better :)
(I generated SVGs with some meta data to help cursor movement on the server, but I'm most likely moving back to running OSMD on the client because my poor cheap Heroku server didn't have a truckload of memory and kept crashing.. I'm not going to debug memory leaks that could be somewhere in my code or OSMD or Vexflow or JSDOM..well, anywhere. :/ )
But I might end up with a hybrid solution that prefers SVG from server if it is available, otherwise loads MusicXML and OSMD. :)
Hallvord R. M. Steen
@hallvors
I didn't expect getSVGElement() to throw. Seems like a known condition you may want to handle by returning null or something? Don't know what the coding conventions around here are, but I'd expect exceptions only for stuff that's truly unexpected or wrong. If "no notes for a multi-measure rest" is a known thing, returning null and documenting this would make sense to me.
Simon
@sschmidTU
one tipp for memory usage: if you don't await osmd.load(), memory may not be freed up between renders. for some reason.
yeah, true that, we should return undefined for multi measure rests in getSVGElement().
Simon
@sschmidTU
the throwing is patched on develop now.
Hallvord R. M. Steen
@hallvors
Wow, that was fast :)
Hallvord R. M. Steen
@hallvors
I've been looking for a way to get the SVG path-element drawn for a multi-measure rest bar, but measure.multiRestElement has no references that I could find - and it seems VexFlow doesn't make this easy either, the element does not even have an ID..
phamconganh
@phamconganh
@sschmidTU can we have GetNearestVerticalContainerStaffEntry? the method GetNearestStaffEntry can't get exact vertical container staffentry.
Hallvord R. M. Steen
@hallvors
How is the collaboration between OSMD and Vexflow? :) I suppose what I'm trying to do now might get easier if I submitted a PR to Vexflow to give multi-measure rest indicators an ID (no idea how hard it would be to add thought..)
Simon
@sschmidTU
yeah sometimes we submit PRs to Vexflow, though recently we rather add things to our src/VexFlowPatch, because we're using an older version of vexflow anyways (1.2.93, because 3.x has huge formatting issues).
so, in your place i'd definitely rather make a VexFlowPatch addition.
phamconganh
@phamconganh
@sschmidTU can you change private in the OpenSheetMusicDisplay.ts to protected in the next release for classes which extend this can call the private?
Simon
@sschmidTU
which variables do you want to accesss? Usually what's private is not intended to be accessed by other objects.
phamconganh
@phamconganh

@sschmidTU for example some variables

  // protected zoomUpdated: boolean = false;
  // protected needBackendUpdate: boolean = false;
  // protected rules!: EngravingRules;
  // protected sheet?: MusicSheet;
  // protected graphic?: GraphicalMusicSheet;
  // protected drawer!: VexFlowMusicSheetDrawer;
  // protected drawingParameters!: DrawingParameters;

and the private function reset
I create a class which extends the OpenSheetMusicDisplay.ts and need override some function and needs call these variable. It's wonderful if the lib change the private to protected for extend

Simon
@sschmidTU
ok, this is added in the public osmd, will be in osmd-extended in the next merge.
for now at least for the variables you can use e.g. (sheet as any).member to access them.
Simon
@sschmidTU
@phamconganh this is now fixed, these variables and methods are protected now.
phamconganh
@phamconganh
@sschmidTU tks you. And I think can OSMD render Measure rows step by step instead of render all to optimise for render large musicxml? and emit event after draw a measure row for do something?
Simon
@sschmidTU
that's planned, it's not so easy, but it would be nice.
phamconganh
@phamconganh
@sschmidTU Great! And Can you change the private function to protected in OpenSheetMusicDisplay.ts for the same reason extends?
Simon
@sschmidTU
what do you mean? change which function to protected?
there is nothing private anymore in OpenSheetMusicDisplay.ts
phamconganh
@phamconganh
@sschmidTU oh sorry, a little mistake I haven't read all the commit, thank you so much for this enthusiastic support
Simon
@sschmidTU
you're welcome! by the way, it would be fantastic if you considered becoming our sponsor on github :)
https://github.com/sponsors/opensheetmusicdisplay
zhong yi
@zhong_yi_ta_gitlab
Is there any way to set the cursor to whole measure width? the default cursor is for single note only. Or is there any method can highlight a whole measure?
Hallvord R. M. Steen
@hallvors

I think I have seen a method with a promising name, but I ended up doing something like this:

    let graphicalMeasure = osmdInstance.graphic.getGraphicalMeasureFromSourceMeasureAndIndex(
      measure,
      0
    );
    let rect = document.createElementNS(SVGNS, 'rect');
    if (graphicalMeasure && graphicalMeasure.stave) {
      ['x', 'y', 'width', 'height'].forEach(prop => {
        rect.setAttribute(prop, graphicalMeasure.stave[prop]);
}
svg.appendChild(rect);

and styling the rect appropriately.

Simon
@sschmidTU
yeah, there is no method for this in OSMD, but i think others have implemented it.
Hallvord R. M. Steen
@hallvors
(I'm lucky enough to work with one voice at a time, you may need to adapt and call the getGraphicalMeasure... several times instead of just passing 0)
I'm sort of happy with the above solution, only complaint is that the lower border is below the bottom line of the system - sort of makes sense because you get the noteheads below the bottom line inside your frame, but it also looks a bit odd.
(This of course requires using the SVG backend too, I don't know how to do it if you use Canvas)
Hallvord R. M. Steen
@hallvors
By inserting an extra SVG rect inside the SVG itself one can use the coordinates of other SVG elements without any tricky calculation of the corresponding values in pixels for positioning things according to the page..
@sschmidTU I think I saw a "render until measure X" parameter mentioned somewhere. Would that be a step towards rendering parts at a time?
Hallvord R. M. Steen
@hallvors
Did anyone look into whether the main performance issue could be fixed by reading some value out of Vexflow instead of getting it from a canvas element or some such? And is that issue even an issue if you're using the SVG backend?
I mean #937 by the way