Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 15:55

    sschmidTU on restYCollisions

    quarter rests: slightly increas… (compare)

  • 15:48

    sschmidTU on restYCollisions

    fix highest instead of lowest n… (compare)

  • 15:44

    sschmidTU on restYCollisions

    rest positioning: fix wrong not… (compare)

  • 15:39

    sschmidTU on restYCollisions

    fix pitch undefined error (rest… (compare)

  • 14:50

    sschmidTU on restYCollisions

    fix render errors introduced in… (compare)

  • 14:32

    sschmidTU on restYCollisions

    fix(Rests): Fix Y collisions (W… rest y positions: add some test… (compare)

  • 14:27

    sschmidTU on develop

    refactor: remove if with identi… (compare)

  • Oct 21 17:13
    infojunkie commented #1075
  • Oct 21 17:13
    infojunkie commented #1075
  • Oct 21 17:09
    infojunkie opened #1075
  • Oct 21 16:46
    infojunkie commented #1074
  • Oct 21 16:33
    sschmidTU commented #1074
  • Oct 21 16:33
    sschmidTU commented #1074
  • Oct 21 16:33
    sschmidTU commented #1074
  • Oct 21 16:25
    infojunkie commented #1074
  • Oct 21 16:24
    infojunkie commented #1074
  • Oct 21 15:21
    sschmidTU labeled #1073
  • Oct 21 15:21
    sschmidTU assigned #1073
  • Oct 21 15:21
    sschmidTU commented #1074
  • Oct 21 15:20
    sschmidTU assigned #1074
Tom Pe
@taat
@sschmidTU Hmm. That did not work. I tried:
image.png
Simon
@sschmidTU
oh, you need to implement the hide() method in your Cursor class, apparently. It's strange because that should be taken from the OSMD cursor via extends, it's a public method there.
Simon
@sschmidTU
maybe you can do it like this:
public hide() {
  base.hide();
}
Tom Pe
@taat
@sschmidTU This didn't work either. It's not inheriting the methods at all. (I'm using this npm package with latest Angular). I get the following error:
image.png
Tom Pe
@taat
How does OSMD draw the notes? How can I draw a C# whole note (halftone 49) at the current cursor location? (assumming we're dealing with piano sheet)
Simon
@sschmidTU
That's strange. The Cursor class is exported in OSMD. May be an error with how webpack builds the module.
You can't just draw a note somewhere. OSMD is using Vexflow for rendering, which doesn't allow you to just add notes somewhere after the measure has been constructed and rendered. We could add a feature to do this and work around it in Vexflow, but it's not going to be easy to implement. You could try copying the SVGElement for a note and inserting it at a new position.
but that's why we say OSMD is a MusicXML renderer, not a sheet music editor.
Tom Pe
@taat
@sschmidTU I suppose this inheriting issues is related to the npm module itself not to the library. As for drawing - now I'm copying the note heads and moving them around (to show if the correct/wrong key is pressed), but this is not perfect. Some measures don't have note heads at all. I'm aiming at drawing notes also between the beats, when the midi key is pressed, similar to this:
image.png
@praisethemoon Did you have similar problem in Moon Piano? How did you solve highlighting the missed notes?
Simon
@sschmidTU
you could just display all notes and color the ones that were missed. you can get the note's svg element and set the color instantly via svg. also to transparent if you want to hide some temporarily.
Tom Pe
@taat
Yes, that's easy to indicate the correct ones (green on the screenshot), but not that trivial with the missed and off-beat notes (drawn in random places, when the cursor is moving and the user presses random keys). My approach now would be to create a cursor with all possible notes (or just one), invisible, move it along the timestamp and leave a copy of the note at current timestamp. But for now I don't know how to draw all the notes at the correct location on the staff (line or space). BTW, I really appreciate your responses, thank you.
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