Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Feb 02 19:50

    sschmidTU on develop

    chore: update changelog for 1.7… (compare)

  • Feb 02 19:47

    sschmidTU on develop

    chore: fix changelog formatting… (compare)

  • Feb 02 18:49

    sschmidTU on develop

    cursor: add null check (sync wi… (compare)

  • Feb 02 18:43

    sschmidTU on develop

    chore: set osmd.Version to 1.7.… (compare)

  • Feb 02 18:03
    sschmidTU closed #344
  • Feb 02 18:03
    sschmidTU commented #344
  • Feb 02 17:36

    sschmidTU on master

    chore: update osmd.Version to 1… comment (what pedal EndNote mea… comment: Pedal.EndsStave, Begin… and 23 more (compare)

  • Feb 02 17:36

    sschmidTU on develop

    chore: bump version to 1.7.4-re… chore: update changelog for 1.7… Merge branch 'release/1.7.4' and 1 more (compare)

  • Feb 02 17:36

    sschmidTU on 1.7.4

    (compare)

  • Feb 02 17:22

    sschmidTU on develop

    fix(Tremolo): Offset tremolo st… (compare)

  • Feb 02 17:08

    sschmidTU on develop

    fix(Articulation): support "har… (compare)

  • Feb 02 16:43
    sschmidTU commented #1318
  • Feb 02 16:42

    sschmidTU on glissando-and-slide

    feat(Glissando): Add EngravingR… fix glissando error when start … (compare)

  • Feb 02 16:41

    sschmidTU on develop

    feat(Glissando): Add EngravingR… fix glissando error when start … (compare)

  • Feb 02 15:59
    sschmidTU closed #1318
  • Feb 02 15:59
    sschmidTU commented #1318
  • Feb 02 15:57
    sschmidTU commented #1318
  • Feb 02 15:56

    sschmidTU on develop

    feat(Glissando): Implement glis… (compare)

  • Feb 02 15:56
    sschmidTU closed #1319
  • Feb 02 15:28
    sschmidTU commented #1319
nguyenphuonglinh2k
@nguyenphuonglinh2k
how can I change cursor element into a image element like this
phamconganh
@phamconganh
Does opensheetmusicdisplay draw slower than vexflow? I Render the same music xml, opensheetmusicdisplay: 2560ms and vexflow (with vexflow-musicxml) :600ms!
Simon
@sschmidTU

@hallvors it's mainly historical, early on most properties were lowercase and private, and only some that should be public had getters and/or setters. But having getters and setters for everything in Typescript creates piles of boiler plate code, so we just made the properties public, and kept the lowercase in some cases for backwards compatibility.

cursor repetition support is already working in the audio player, will be integrated into osmd soon, see #379 (which you commented on), and #864

@nguyenphuonglinh2k that is unfortunately not possible right now, you would have to create your own cursor class and add that cursor to OSMD.
@phamconganh yes, osmd is probably currently slower than vexflow-musicxml, because vexflow doesn't have a solid bounding box and collision detection system for many elements, so we have to check where vexflow draws, which costs a lot of performance. We are currently checking if we can optimize that performance in #937.
also, i'm not sure how accurate vexflow-musicxml is compared to OSMD, we should check that out in more detail to have a reference.
Hallvord R. M. Steen
@hallvors
Thanks for explaining Simon. Legacy tends to make architecture messy :)
Also terrific to hear that cursor repetition support is not far away. I was wondering if I could hack my own but didn't see methods for making the cursor jump to a specific measure..so it seemed complicated. Plus there are too many ways to annotate repetitions and since I'm not a musician my note comprehension is amateur-level :)
rvilarl
@rvilarl
@nguyenphuonglinh2k I made some changes to get several cursors at the same time. I use one now for the tempo, small grey, and a green one similar to the one in your question placed before the next notes to play. Have a look at https://michaelecke.com/pianoplay/. If you have interest I can send you the modified files to have a look.
nguyenphuonglinh2k
@nguyenphuonglinh2k
@rvilarl yes, send it for me, please! thanks!
nguyenphuonglinh2k
@nguyenphuonglinh2k
when I update my code in editor, music XML is re-rendered, but into 2 music XML files instead of 1 as before. How can I fix this problem?
Simon
@sschmidTU
@nguyenphuonglinh2k I don't understand. You mean 2 pages? have you been setting the PageFormat settings somewhere? You must have manipulated some OSMD setting somewhere.
It's impossible for one OSMD instance to render 2 MusicXML files at the same time.
phamconganh
@phamconganh
@sschmidTU Does the OSMD have a module for XML conversion? I want to retain Vexflow's quick rendering with musicxml type, but vexflow-musicxml is build fail from 3 years ago
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.