Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 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)

  • Jun 14 19:46

    sschmidTU on get-nearest-staffentry-multirest

    try fixing getNearestStaffEntry… (compare)

Simon
@sschmidTU
@phamconganh the exports are now added in osmd 0.9.5, just released :)
phamconganh
@phamconganh
@sschmidTU I get all visiable piano voice entries in iterator.CurrentVoiceEntries by method CurrentVisibleVoiceEntries, but it return the first voice entry. So I rewrite to get all voice entries in instrument piano. But I can't get any properties to check left hand or right hand voice.
Simon
@sschmidTU
@phamconganh have you tried voiceEntry.ParentSourceStaffEntry.ParentStaff.Id?
phamconganh
@phamconganh
@sschmidTU you mean id 1 for the right hand and id 2 for the left hand?
Simon
@sschmidTU
for example
phamconganh
@phamconganh
image.png
in a staffEntry, I get this. The first id = 1, and the second id = 2
image.png
Hallvord R. M. Steen
@hallvors
Hi, I attempted to upgrade OSMD to 0.9.5 and I'm seeing some unexpected behaviour that I think is new (but I'm not 100% certain). I think I happened to be on 0.8.7 before.
I'm trying to render MXML data to SVG with OSMD, go through the DOM and add some data-* attributes to some of the SVG elements, and then immediately serialise with .outerHTML. The bug I'm struggling with is that sometimes the data-* attributes are present in the output - and sometimes they are NOT. There's some race condition involved, probably, but I can't tell what is causing it..
The render() call is entirely synchronous, right? It is not having side-effects that show up later? Because it seems a bit like OSMD somehow does another render() pass or something, and re-creates the SVG elements without my custom attributes. But how can it possibly do that when this is all one long sync thread? This problem is weird :/
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?