Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 10:42
    JanVeb commented #1239
  • 10:41
    JanVeb commented #1239
  • Oct 01 12:45
    sschmidTU commented #1239
  • Oct 01 12:45
    sschmidTU commented #1239
  • Oct 01 12:44
    sschmidTU commented #1239
  • Oct 01 12:43
    sschmidTU commented #1239
  • Oct 01 12:43
    sschmidTU commented #1239
  • Oct 01 12:40
    JanVeb commented #1239
  • Oct 01 12:39
    JanVeb commented #1239
  • Oct 01 09:53
    sschmidTU commented #1246
  • Oct 01 09:53
    sschmidTU commented #1246
  • Oct 01 09:51
    sschmidTU edited #1246
  • Oct 01 09:43
    rvilarl closed #1246
  • Oct 01 09:43
    rvilarl commented #1246
  • Oct 01 09:30
    sschmidTU commented #1246
  • Oct 01 09:27
    rvilarl commented #1246
  • Oct 01 08:59
    sschmidTU commented #1246
  • Oct 01 08:59
    sschmidTU commented #1246
  • Oct 01 08:48
    rvilarl commented #1246
  • Oct 01 06:58
    rvilarl opened #1246
Simon
@sschmidTU
@phamconganh you can try creating a new cursor yourself. there will also be osmd.rules.DefaultColorCursor in osmd 0.9.3
phamconganh
@phamconganh
@sschmidTU
<direction placement="above">
<direction-type>
<words>G</words>
</direction-type>
<staff>1</staff>
</direction>
this is a sample. In your demo, it is "CharlesGounod_Meditation.xml" file
phamconganh
@phamconganh
image.png
@sschmidTU i try "osmd.rules.RenderChordSymbols = false" and it does not change.
Simon
@sschmidTU

@phamconganh that is a weird MusicXML sample.
you can't easily remove these "words" expressions yet,
we can create an EngravingRule for that soon,
but you can try something like this after osmd.load():

removeUnknownExpressions() {
    for (let i: number = 0; i < osmd.graphic.ParentMusicSheet.SourceMeasures.length; i++) {
        const sourceMeasure: SourceMeasure = osmd.graphic.ParentMusicSheet.SourceMeasures[i];
        for (let j: number = 0; j < sourceMeasure.StaffLinkedExpressions.length; j++) {
            if (!this.graphicalMusicSheet.MeasureList[i] || !this.graphicalMusicSheet.MeasureList[i][j]) {
                continue;
            }
            for (let k: number = 0; k < sourceMeasure.StaffLinkedExpressions[j].length; k++) {
                sourceMeasure.StaffLinkedExpressions[j][k].unknownList = [];
            }
        }
    }
}

but i haven't tested this. this is modified from MusicSheetCalculator.calculateMoodAndUnknownExpressions().

rvilarl
@rvilarl
In the sources there are some changes apply to vexflow (vexflowpatch). Would it make sense to include the sources of vexflow into osmd rather than vexflowpatch and decide what to update from vexflow or what to patch?
rvilarl
@rvilarl
In the sources there is only one reference to process.env: "public drawableBoundingBoxElement: string = process.env.DRAW_BOUNDING_BOX_ELEMENT;" would it make sense to replace that by an option in IOSMDOptions?
rvilarl
@rvilarl
I made a prototype to support several cursors simustaneously with different colors and types. How would you suggest to approach the implementation of their configuration as additional parameters in the constructor of OpenSheetMusicDisplay(I did it this way): "constructor(container: string | HTMLElement, cursorColors: string[], cursorTypes: number[], options: IOSMDOptions = OSMDOptions.OSMDOptionsStandard())" or with additional IOSMDOptions?
Simon
@sschmidTU

@rvilarl

In the sources there are some changes apply to vexflow (vexflowpatch). Would it make sense to include the sources of vexflow into osmd rather than vexflowpatch and decide what to update from vexflow or what to patch?

No, or I don't understand. Adding all vexflow classes that we don't patch is unnecessary, and would make it hard to see what we patched in vexflow.

In the sources there is only one reference to process.env: "public drawableBoundingBoxElement: string = process.env.DRAW_BOUNDING_BOX_ELEMENT;" would it make sense to replace that by an option in IOSMDOptions?

No, that is only used for continuous integration testing anyways, and i think it's currently mostly unused.

I made a prototype to support several cursors simustaneously with different colors and types. How would you suggest to approach the implementation of their configuration as additional parameters in the constructor of OpenSheetMusicDisplay(I did it this way): "constructor(container: string | HTMLElement, cursorColors: string[], cursorTypes: number[], options: IOSMDOptions = OSMDOptions.OSMDOptionsStandard())" or with additional IOSMDOptions?

It's great you made a prototype able to show multiple cursors!
However, i would avoid bloating the constructor, and i would simply add methods to add cursors. Maybe even locate these methods in the cursor class instead of OpenSheetMusicDisplay. Alternatively, cursorColors and cursorTypes could easily be integrated into IOSMDOptions.

it may make sense to remove the process.env usage, but since it isn't used for anything right now, it seems unimportant.
actually, our demo/index.js uses process.env.STATIC_FILES_SUBFOLDER as well.
Simon
@sschmidTU
karma.conf.js uses it as well (testing, npm test)
rvilarl
@rvilarl
Sorry I did only look into the src directory which is the one that I integrated in my app.
Simon
@sschmidTU
@rvilarl when you feel the code is clean enough for a first look, feel free to submit a pull request, and we can review the code together and try to get it into OSMD.
no problem!
rvilarl
@rvilarl
Simon you probably already realised that I am making trials with vexflow 3.0.9. I am surprised that in combination with osmd the alignment of the voices containing rests is not working properly. I have made a simple try using native vexflow and I do get them aligned. Could you provide a hint?
I will make a pull request with the cursors topic. :)
Simon
@sschmidTU
the formatter in vexflow 3.0.9 seems to be erratic, that's why we haven't switched yet, see #915.
there were a few discussions on vexflow recently and some pull requests merged to fix some formatting issues a few days ago, but i would guess that it isn't quite there yet.
rvilarl
@rvilarl
I know, but I do get the first compass of "Prelude_and_Fugue_in_Cmajor-_J._S._Bach.mxl" from Musescore with native vexflow and this is not the case with osmd. I use formatter.format rather than formatter.formatToStave as osmd does.
rvilarl
@rvilarl
Please ignore the last comment I was using 1.2.93 with native vexflow. I will post this issue in vexflow.
By the way the fix #971 makes the Prelude in E Minor from Chopin look much better, thank you!
Simon
@sschmidTU
yes, that was bugging me as well, glad to hear, my pleasure :)
rvilarl
@rvilarl
Hi Simon, I have made a pull request with the multiple cursors. First time I do that with Github, hopefully fine. If you like the proposal I will look into fixing the testing.
rvilarl
@rvilarl
I have fixed the testing and eslint issues :)
Simon
@sschmidTU
nice! will take a look at it asap.
rvilarl
@rvilarl
Hi, is the lack of pedal marks a matter of priority or a matter of complexity
Simon
@sschmidTU
it's probably rather priority. I just saw that Vexflow does support pedal marks, even in 1.2.93, for some reason i wasn't sure about that.
But yes, pedal marks would be great to implement, and probably not too difficult.
The only big problem might be avoiding collisions with other elements, since it crowds the score even more. So we might need to improve our positioning / collision detection system to avoid those.
rvilarl
@rvilarl
Where should I find the pedals within OpenSheetMusicDisplay class?
Simon
@sschmidTU
there are no pedals / pedal marks in OSMD yet
rvilarl
@rvilarl
So they are not even read from MusicXML files? It is not only a problem of rendering, right?
Simon
@sschmidTU
yes, we don't need to read them if we don't render them. but reading them would be very easy.
rvilarl
@rvilarl
Hi Simon, I am sure that it is easy, but a hint on a similar change would help me. I had been debuging MusicSheetReader and I got to the specific direction "pedal" but I do not have a clue where to place the information within OpenSheetMusicDisplay, and this is just reading.
phamconganh
@phamconganh
@sschmidTU how to getNoteHeadBeginX and getNoteHeadEndX and getBoundingBox or other position properties
as in vexflow, we can get all of them inside note, but osmd can't get them
phamconganh
@phamconganh
image.png
@sschmidTU can i get Size and Position of VerticalGraphicStaffEntryContainer and each of its childrent
Simon
@sschmidTU
@phamconganh you can get graphicalnote.PositionAndShape.AbsolutePosition.x and PositionAndShape.Size.
@rvilarl not enough information, not sure what you're doing or trying to do.
Simon
@sschmidTU
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?