Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 08 09:21
    showtan001 closed #1213
  • Dec 08 07:36
    joshstovall commented #857
  • Dec 07 17:53
    ErdoesiT opened #1284
  • Dec 07 10:22
    showtan001 opened #1283
  • Dec 01 02:33
    sschmidTU commented #1281
  • Dec 01 01:29
    sschmidTU commented #1281
  • Dec 01 01:28

    sschmidTU on octaveshift-startx-greater-stopx

    (compare)

  • Dec 01 01:28
    sschmidTU closed #1281
  • Dec 01 01:28

    sschmidTU on develop

    fix(OctaveShift): Fix rare erro… (compare)

  • Dec 01 01:28
    sschmidTU closed #1282
  • Dec 01 01:27
    sschmidTU edited #1282
  • Dec 01 01:27
    sschmidTU edited #1282
  • Dec 01 01:27
    sschmidTU opened #1282
  • Dec 01 01:27

    sschmidTU on octaveshift-startx-greater-stopx

    comment (compare)

  • Dec 01 01:24

    sschmidTU on octaveshift-startx-greater-stopx

    fix octaveshift error when star… (compare)

  • Nov 30 04:26
    showtan001 opened #1281
  • Nov 29 09:11
    GimmeSomeJazz commented #1280
  • Nov 29 07:04
    joshstovall commented #1280
  • Nov 28 11:19
    GimmeSomeJazz commented #1280
  • Nov 28 11:03
    sschmidTU labeled #1280
Simon
@sschmidTU
@phamconganh what do you mean? what should the module convert to? if you just want osmd's data model, you can just load the sheet without rendering, then explore osmd.sheet
phamconganh
@phamconganh
@sschmidTU because the lib vexflow-musicxml is out of date. And I want use musicxml standard to render music score. So I want use the XML reader of OSMD without "solid bounding box and collision detection system" and vexflow to improve the performance render and full controller the layout and cursor.
Simon
@sschmidTU
@phamconganh ok, as i said, just use osmd.load() without osmd.render(), then the interpreted xml model is in osmd.sheet.
vexflow-musicxml is severely outdated, and the maker joined the OSMD team (and actually worked on the collision detection system in OSMD). So, there will be many challenges for you if you want to use MusicXML without OSMD's vexflow rendering settings and adjustments, unless your scores are very simple, then something like vexflow-musicxml could have have been enough.
rvilarl
@rvilarl
The discussion in:
0xfe/vexflow#829 looks promising to use Vexflow 3.0.9
Simon
@sschmidTU
@rvilarl yes, i saw that, but some of the commenters there haven't commented in a few weeks, and there are still some open issues. hopefully this gets improved.
Preetham Vishwanatha
@preetham-kena
Hi all, This might be asked before. Is there a way to move OSMD cursor to a user selection?
Simon
@sschmidTU
@preetham-kena just do osmd.cursor.next() until you arrive where you want to. check osmd.cursor.iterator.currentMeasure.MeasureNumber etc.
Preetham Vishwanatha
@preetham-kena
@sschmidTU Thank you for the response. There is no way to obtain the measure-info or anything remotely close to what the voices or notes maintain by querying the SVG <g> elements in javascript. We would like to capture a user selection based on click/touch events and move the cursor to that position. am I missing something?
Simon
@sschmidTU
@preetham-kena you don't have access to osmd? are you using only the SVG, not osmd directly?
i just wrote above how to get the measure info
Preetham Vishwanatha
@preetham-kena
@sschmidTU i do have access to osmd. When you render sheet music in javascript, osmd draws it on a canvas using SVG. When a user now selects a position on the canvas rendered by osmd, the touch event is generated on the SVG which does not have any positions info related to osmd iterator or cursor. So i am not sure how to move the cursor to the selection whithout being able to relate the svg position with the probable measure number.
Hallvord R. M. Steen
@hallvors
I wonder if osmd.graphic.getClickedObject() might help with this problem? If you calculate mouse coordinates relative to the SVG and pass an object with x and y to getClickedObject() you might get something to iterate to.. But I still don't know OSMD well enough, so maybe I'm barking up the wrong tree..
1 reply
Simon
@sschmidTU
@hallvors i'm working on click events right now which are almost finished. But it's good that you mentioned this method because i overlooked it. I'll have to check if it still works or if it would also need a similar overhaul to what i've done so far, but it could be very useful.
2 replies
Hallvord R. M. Steen
@hallvors
:up:
Two small layout-related questions: the script for creating SVG accepts width and height arguments, but I'd like to only constrain the width and let the height be unlimited. Is there a pageFormat argument that allows this?
I'd like to be able to style the output with CSS, but the generated SVG elements tend to have fill and stroke set directly. Is it possible to make Vexflow omit those?
Hallvord R. M. Steen
@hallvors
If I have a MusicXML-file OSMD won't render but MuseScore will, do you want a bug report? Quite likely I have made a mistake somewhere in the file, I have done some editing by hand..
(Also, feel free to ignore the stroke and fill question - I'll use CSS filters for my styling needs :) )
Simon
@sschmidTU
I'll see if we can restrict width only but not height in the script.
sure, you can send a bug report, though it's easy to make some mistakes in the XML that MuseScore will tolerate but we won't.
phamconganh
@phamconganh
image.png
@sschmidTU can I hide the note word?
phamconganh
@phamconganh
@sschmidTU one more thing! Can I create a custom cursor and add some cursor?
Hallvord R. M. Steen
@hallvors
I added !pageWidth>0 to the if before setting pageWidth to 1440, it worked but I don't know if it's the best way to fix it: if (endlessPage && !pageWidth > 0) {
Simon
@sschmidTU
@hallvors yes, i believe that should do it.
Simon
@sschmidTU
@phamconganh you mean the letters? i don't know where those come from, maybe they are ChordSymbols. have you tried osmd.rules.RenderChordSymbols = false?
otherwise please share a MusicXML sample.
@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.