Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 08:40
    rvilarl commented #1105
  • 06:52
    rvilarl synchronize #1094
  • 06:46
    rvilarl synchronize #1094
  • 06:12
    rvilarl synchronize #1105
  • Dec 03 23:20
    sschmidTU commented #1105
  • Dec 03 22:45
    rvilarl commented #1105
  • Dec 03 22:37
    rvilarl synchronize #1105
  • Dec 02 17:50

    sschmidTU on develop

    comment (compare)

  • Dec 02 17:08

    sschmidTU on develop

    fix(GroupBrackets): Don't draw … (compare)

  • Dec 02 13:32
    kenboy2304 commented #1106
  • Dec 02 12:46
    sschmidTU commented #1106
  • Dec 02 12:45
    sschmidTU closed #1106
  • Dec 02 12:45
    sschmidTU commented #1106
  • Dec 02 12:44

    sschmidTU on develop

    feat(ChordSymbols): add Engravi… (compare)

  • Dec 02 12:28
    sschmidTU commented #1062
  • Dec 02 12:13
    sschmidTU commented #1062
  • Dec 02 12:06

    sschmidTU on develop

    fix(Positioning): Fix ghost not… (compare)

  • Dec 02 12:03
    sschmidTU closed #1022
  • Dec 02 12:03
    sschmidTU commented #1022
  • Dec 01 16:47
    kenboy2304 commented #1106
Simon
@sschmidTU
yeah, that's not so easy. maybe you should copy a quarter note SVG from somewhere before you start the play method, and insert it at the cursor location. The distance between a line (let's say E and G in the treble staff) is 1 unit in OSMD, or 10 pixels at 100% zoom.
phamconganh
@phamconganh
@sschmidTU can i render a music system step by step? and get event when a music system is rendered
Simon
@sschmidTU
@phamconganh no, not yet. but you can give an option to draw measures x to y if you want.
Paul
@paulmattu
Hey Guys, a function to switch between clefs would be verry useful. But I have not find any trace of such a possibility yet. Is there something in the making?
Simon
@sschmidTU
@paulmattu yes, you can simply replace the KeyInstruction object in the measure. e.g.
osmd.sheet.sourceMeasures[0].firstInstructionsStaffEntries[0].instructions[0] = new KeyInstruction(...)
(check that instructions[0] actually is a KeyInstruction, otherwise scan through the instructions array)
or maybe also via osmd.sheet.sourceMeasures[0].getKeyInstruction()
In the worst case, you could change it in the XML via setting osmd.OnXMLRead().
Hallvord R. M. Steen
@hallvors
I'm still stuck trying to figure out how to introduce osmd-extended in my project :( The issue is the site gets built on Heroku using Docker, and Heroku does not seem to support configuring any secrets for the Docker build. As I'm not able to pass in a Github Personal Access Token or SSH key or some such, I seem limited to using dependencies that are fully public on either Github or NPM. I'm a bit surprised to hit this apparent shortcoming in Heroku, but the actual reason may be that the secrets are likely to end up recorded in some layer of the Docker image and thus in reality be public and not secrets anymore.
Well well. Can't have it all, I suppose. I guess I need to go back to hacking some features on top of the public OSMD..
Simon
@sschmidTU
That seems like a bummer. Though i still don't quite understand why your Heroku server has to be public, can't you make a private one? But yeah, this is just inherently a very difficult problem, trying to integrate a closed source library in an open source project.
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