Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 13 08:30
    sschmidTU labeled #1210
  • Aug 13 08:30
    sschmidTU closed #1209
  • Aug 13 08:30
    sschmidTU commented #1209
  • Aug 13 08:30
    sschmidTU labeled #1209
  • Aug 13 08:30
    sschmidTU labeled #1209
  • Aug 13 08:30
    sschmidTU closed #1210
  • Aug 13 08:30
    sschmidTU commented #1210
  • Aug 13 08:30
    sschmidTU labeled #1210
  • Aug 13 08:11
    maaaaaaaartin opened #1210
  • Aug 13 08:10
    maaaaaaaartin opened #1209
  • Aug 11 18:57

    sschmidTU on tupletNumberLimitConsecutive

    (compare)

  • Aug 11 18:47
    sschmidTU closed #1207
  • Aug 11 18:47

    sschmidTU on develop

    feat(Tuplets): Add EngravingRul… (compare)

  • Aug 11 18:47
    sschmidTU closed #1208
  • Aug 11 18:46
    sschmidTU commented #1208
  • Aug 11 18:44
    sschmidTU commented #1208
  • Aug 11 18:42
    sschmidTU edited #1208
  • Aug 11 18:40
    sschmidTU edited #1207
  • Aug 11 18:39
    sschmidTU edited #1207
  • Aug 11 18:39
    sschmidTU edited #1208
Simon
@sschmidTU
@rvilarl not enough information, not sure what you're doing or trying to do.
the xml reading code for pedals should probably be in InstrumentReader, similar to octave-shift maybe.
Simon
@sschmidTU
or similar to expressions (forte etc), though the expressions code is a bit complex
phamconganh
@phamconganh
@sschmidTU can we check the left-hand note or right-hand note in a vertical staff entry in the piano score?
phamconganh
@phamconganh
image.png
@sschmidTU can you export some class like in line 2 and 3 in the next release for ts?
Simon
@sschmidTU
i'll add the MusicParts classes to the exports, next osmd release coming very soon anyways.
Regarding your first question, you can check (graphicalStaffEntry.)sourceStaffEntry.parentStaff.id or parentStaff.parentInstrument.nameLabel.text.
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.