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
Simon
@sschmidTU
so, we'd like to implement this feature, but it would take some time.
禄碌无为
@rianlu
@sschmidTU Thank you for your answer! I'm going to try next!
禄碌无为
@rianlu
image.png
I got it!
Simon
@sschmidTU
nice! the other method i mentioned will probably be easier once the next osmd version is released, but if you already got it working, no reason to worry about it i guess ;)
禄碌无为
@rianlu
I used osmd.cursor.iterator.CurrentVoiceEntries[0].ParentSourceStaffEntry.parentStaff.id to distinguish the left and right hands, and I have got all the notes for the left and right hands. Is there a way to make the cursor jump to the specified position? In other words, the cursor can only be moved based on the left-hand score or the right-hand score?
For example only based on the left hand
image.png
禄碌无为
@rianlu

I also tried osmd.cursor.iterator.currentVoiceEntries[0].notes[0].printObject = false to hide note,
then use

osmd.cursor.iterator.moveToNextVisibleVoiceEntry()
osmd.cursor.update()

to control and update the cursor, but still the same as before

禄碌无为
@rianlu
I found a solution, take out all the notes, and save the corresponding id (used to distinguish between left and right hands) in the note, and then judge the id when moving the cursor. For example, if I am following the left-handed score, when I move the cursor at a fixed speed, the id will be judged. If it is left-handed, there will be a duration, and then move the cursor; if it is right-handed, move the cursor directly until the next left hand
Hallvord R. M. Steen
@hallvors
@sschmidTU is this the right place to discuss the osmd-extended project and ask questions?
Simon
@sschmidTU
@hallvors better would be on our Discord server: osmd.org/discord
i'll give you the sponsor role so you'll see the sponsor exclusive channels.
or of course in the osmd-extended Issues section on github
Tom Pe
@taat
image.png
Hi guys! How can I change the head color of one specific note under the cursor, without re-rendering the whole sheet? (I need it to be lightning fast). Is there a way to access the actual head element in the SVG?
Simon
@sschmidTU
@taat yes.
osmd.rules.GNote(osmd.cursor.NotesUnderCursor()[0]).getSVGGElement()
it will have one or more subelements vf-notehead whose color you can change.
Tom Pe
@taat
@sschmidTU Than you Simon, that was really helpful.
@sschmidTU Next question: How can I add/remove a note head without re-rendering at the current cursor position? (I want to show currently pressed keyboard note).
Simon
@sschmidTU
@taat for removing, you can remove the svg element of the notehead. adding is not possible out of the box, but you can try copying a notehead element and placing it somewhere else.
Tom Pe
@taat
@sschmidTU That's exactly what I did, thanks. How can I overload the Cursor class and use my CursorExtended class instead? I'm using OSMD with TypeScript/Angular.
Simon
@sschmidTU
just extend the cursor class
then set osmd.cursors = [myCursor] (needs to be an array)
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