Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 03:28
    sschmidTU commented #1297
  • 03:24
    pokemon963 commented #1297
  • 03:17
    sschmidTU commented #1297
  • 02:44
    pokemon963 reopened #1297
  • 02:44
    pokemon963 commented #1297
  • 02:11
    pokemon963 closed #1297
  • 02:11
    pokemon963 commented #1297
  • 02:04
    pokemon963 commented #1297
  • 02:03
    pokemon963 commented #1297
  • 02:01
    pokemon963 reopened #1297
  • Jan 28 22:43
    michaelcchu opened #1317
  • Jan 28 21:25
    rvilarl commented #1315
  • Jan 28 20:54
    michaelcchu opened #1316
  • Jan 28 20:09
    michaelcchu opened #1315
  • Jan 28 17:00
    CorentinTh edited #1314
  • Jan 28 16:59
    CorentinTh opened #1314
  • Jan 28 05:03
    sschmidTU assigned #1313
  • Jan 28 05:03
    sschmidTU closed #1313
  • Jan 28 04:24
    marsung commented #1313
  • Jan 28 03:55
    sschmidTU commented #1313
Michael P Hartman
@hartman42

I have a question about the "To Coda" designation...

If the measure contains the "To Coda" designation, is that measure to be played first and you then go to the coda or do you skip the measure and go right to the Coda?

Michael P Hartman
@hartman42
When I put the To Coda designation in MuseScore, osmd aligns it to the right implying that perhaps the measure should be played first and then you go to the Coda.
I searched the w3c/musicxml for "To Coda" and it doesn't seem to address it.
Simon
@sschmidTU
I'm pretty sure you're always supposed to play the measure first, then the "To Coda", hence the placement at the end of the measure. That's from my experience as a musician. It makes sense to let the musician know at the end of a measure when they need to do a measure skip after the measure.
Hallvord R. M. Steen
@hallvors
Why are there both capitalised and non-capitalised properties in so many places? I checked the source and for example cursor.Iterator is just a getter alias for iterator..?
Hallvord R. M. Steen
@hallvors
My more important question is why osmd.sheet.repetitions is an empty array and whether the cursor would start obeying repeats if it wasn't :)
nguyenphuonglinh2k
@nguyenphuonglinh2k
image.png
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?