Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 09:20
    sschmidTU commented #1094
  • 09:20
    sschmidTU commented #1094
  • 03:58
    rvilarl commented #1094
  • 03:56
    rvilarl synchronize #1094
  • Nov 28 17:18
    infojunkie commented #1084
  • Nov 28 12:48
    sschmidTU commented #1084
  • Nov 28 12:48
    sschmidTU commented #1084
  • Nov 28 00:43
    infojunkie commented #1084
  • Nov 28 00:42
    infojunkie commented #1084
  • Nov 27 22:52
    rvilarl commented #1094
  • Nov 27 22:51
    rvilarl commented #1094
  • Nov 27 22:42
    infojunkie edited #1084
  • Nov 27 22:41
    infojunkie commented #1084
  • Nov 27 22:41
    infojunkie commented #1084
  • Nov 27 22:40
    infojunkie commented #1084
  • Nov 27 22:40
    infojunkie commented #1084
  • Nov 27 20:47
    infojunkie commented #1084
  • Nov 27 20:46
    infojunkie commented #1084
  • Nov 27 18:39
    rvilarl commented #1094
  • Nov 27 17:59
    sschmidTU commented #1094
Hallvord R. M. Steen
@hallvors

Indeed. It's complicated. I suppose it is possible if I run Docker build things locally and just deploy built images, but that means loosing out on the sweet automated deploys and making it harder to collaborate with others who have been involved and might do more on this project.

Also, I've been too busy to push the project forward as much as I hoped. It might bloom into a service that might find a market, and if it does I will certainly keep supporting OSMD with some cash whether or not I actually use osmd-extended :).

Simon
@sschmidTU
that's great to hear! good luck with your projects!
伊布雷多姆
@ifredom
@rianlu How do you add IDS? Do you process XML in advance? I'm also making a judgment now
禄碌无为
@rianlu
@ifredom Do you mean to distinguish between left and right hands?
osmd.cursor.iterator.currentVoiceEntries[i].ParentSourceStaffEntry.parentStaff.id
伊布雷多姆
@ifredom
@rianlu no I want to change the color of the specified note, but the note ID is random. I don't know how you fix the ID
禄碌无为
@rianlu

@ifredom You can modify the color of the note by the current cursor position

let note = osmd.cursor.iterator.currentVoiceEntries[0].notes[0]
let gNote = opensheetmusicdisplay.GraphicalNote.FromNote(note, osmd.rules)
let el = gNote.getSVGGElement()
el.querySelectorAll('path').forEach(item => {
    item.setAttribute('fill','#FF00FF');
})

If you want to modify the color of the cursor at any position, my approach is: first traverse all the notes through the cursor, and then save all the voiceEntries, so that you can use voiceEntries to modify the color of the notes at any position.
I'm not sure if there is another better way.

Simon
@sschmidTU
@ifredom check note.getSVGId() and note.getSVGGElement(). (note has to be a GraphicalNote/VexFlowGraphicalNote). also check osmd.rules.GNote(note) to get a GraphicalNote from a Note.
伊布雷多姆
@ifredom
@rianlu @sschmidTU tks.I'll try😊
Preetham Vishwanatha
@preetham-kena
Is there a way to render the OSMD on a webworker thread (Service Worker)? I am noticing that opening and rendering a long piece of sheet music (on a new Tab) holds the UI threads and even when the tab is closed on foreground goes back to the parent page, the UI threads are held processing the rendering of sheet music and freeze the Parent page indefinitely!. Is there a workaround for this?
Preetham Vishwanatha
@preetham-kena
Second question: Is there a way to stop/kill a large OSMD render? I am currently rendering a sheetmusic on a new tab. When the tab is closed, the UI thread is still held by the osmd.render() processing and the parent page suffers.
Simon
@sschmidTU
first question: no, because Vexflow doesn't support it yet. there's some discussion about it on Vexflow.
1 reply
second: not sure, would be a general javascript thing.
you must be loading extremely large scores, it should generally not take more than a few seconds.
2 replies
for very large scores, you could split them into multiple pages on multiple OSMD instances using the draw* options. would require a bit of setup though.
3 replies
processing time is 90% Vexflow, so there isn't much we can do except rendering less.
there is a performance optimization mode in the early access (sponsor) version, which is currently being tested, and especially effective for large scores.
Simon
@sschmidTU
A good practice is greying out the UI (or something similar) while the UI thread is busy, so that the user knows the UI is unresponsive.
5 replies
anseldu
@anseldu
How can I get the notes playing under the current cursor?
Simon
@sschmidTU
@anseldu osmd.cursor.NotesUnderCursor()
禄碌无为
@rianlu
I have a question, does anyone know how to deal with it?
The treble clef is displayed at the beginning of the score, and then there is a treble clef at the end of the 8th bar. Normally, the 9th bar should be the treble clef, but when I cut from the 9th bar, he The treble and bass clef is still displayed.
image.png
image.png
Simon
@sschmidTU
@rianlu can you share a sample?
禄碌无为
@rianlu
@sschmidTU
Simon
@sschmidTU
I took a look at it, but it's not easy to solve, it results from the way key instructions are saved and looked up when you select which measures to draw (start drawing from measure 9). it's better to submit an issue on github for complex problems like this. and please add the sample.
禄碌无为
@rianlu
Ok, thanks!
vivachenx
@vivachenx

I have a question, does anyone know how to deal with it?

AudioPlayer function is not available on the mobile (iOS Android), no sound

@sschmidTU Can you give me permission for the sponsor exclusive channels ?
Simon
@sschmidTU
@vivachenx see DM. About the audio player function, it should work on Android, I tested it. In which browser doesn't it work?
On iOS, unfortunately there are currently issues with audio playback in the browser. The audio library we use has problems with iOS playback as well. At the moment, it doesn't look like there is a simple fix, unfortunately. Maybe we have to wait for a iOS/Safari update, because on a Macbook, it also doesn't work in Safari, but it works in Firefox and Chrome.
I opened an issue for it here:
opensheetmusicdisplay/osmd-extended#38
Luc Bonnin
@lucbonnin
Hi everyone.
I'm new to OSDM but I've 2 (I guess) easy question :
1- is there a way to draw vexFlow canvas on a single infinite line ?
2- is there a way to catch a js event when each note are drawn ? (so that we can add stuff on the DOM on our own code, out of the canvas and music score such as note name A4/La)
禄碌无为
@rianlu
@lucbonnin Add this to setOptions: renderSingleHorizontalStaffline: true
Luc Bonnin
@lucbonnin
Thanks. For the 2nd question do you have any clue?
Simon
@sschmidTU
@lucbonnin Hi! There is no event for note drawing, but you can still manipulate the DOM and add things when using SVG. Simply get a (vexflow)graphicalnote.getSVGGElement() and you can manipulate it. That's what others do, like for changing the color of notes without re-rendering, and noone has seemed to need events for that so far.
Luc Bonnin
@lucbonnin
@sschmidTU cool. If I can navigate through the dom, extract each "SVGElement" data (such as pitch detail, like "A4#", I will be able to do my stuff)
I'll give it a try as I was not using OSDM until I realize drawing music score from an XML file and keeping all these drawings and details that a musician need to play, is not easy at all and very time consuming, so better give it a gtry to OSDM that should work like a charm
Simon
@sschmidTU
@lucbonnin one more tip, for extracting musical data, i would use OSMD's data model, not the SVG. I don't think the SVG can tell you the pitch ("A4#"). Instead, try something like osmd.graphic.measureList[0][0].staffEntries[1].graphicalVoiceEntries[0].notes[0].vfnote or graphicalnote.sourceNote.Pitch.getHalfTone()
vivachenx
@vivachenx
image.png
I want to display the music score on my phone, but it is too crowded, and each line can only display very little content, I want to know what API can adjust these
禄碌无为
@rianlu
set osmd.zoom and osmd.render()?
vivachenx
@vivachenx
Actually I don’t want the zoom effect, I want to increase the width of a bar a bit
But I don’t know which API can adjust this
Simon
@sschmidTU
@vivachenx Decreasing the zoom (e.g. osmd.zoom = 0.5) is a decent way of getting more sheet music on the screen.
I'm confused about you wanting "to increase the width of a bar a bit", that seems contrary to your goal of getting more sheet music on the screen.
Unfortunately it's not easy to increase the width of a specific measure, maybe we could add an option for that. What does the measure look like? In EngravingRules, there are some options to add more padding/spacing for specific elements in a measure or certain measures like PickupMeasureWidthMultiplier.
vivachenx
@vivachenx
@sschmidTU Hello Simon, Thank you for your answer.
In fact, I need both of these functions. I want to increase the spacing between notes or the width of bars, because in some cases, the notes are too crowded, and there may be overlaps.
image.png
like this
Simon
@sschmidTU
that looks really weird, i'm not sure why the measures are that cramped. can you share the musicxml?
Simon
@sschmidTU
also, was that rendered on a phone?
vivachenx
@vivachenx