sschmidTU on develop
sschmidTU on develop
fix(GroupBrackets): Don't draw … (compare)
``` let graphicalMeasure = this.osmd.graphic.getGraphicalMeasureFromSourceMeasureAndIndex(this.getCurrentCursorMeasure(), 1); var svgns = "http://www.w3.org/2000/svg"; var svg = document.getElementById('svg'); var shape = document.createElementNS(svgns, "rect"); shape.setAttributeNS(null, "x", graphicalMeasure.stave['x']); shape.setAttributeNS(null, "y", graphicalMeasure.stave['y']); shape.setAttributeNS(null, "width", graphicalMeasure.stave['width']); shape.setAttributeNS(null, "height", graphicalMeasure.stave['height']); shape.setAttributeNS(null, "fill", "blue"); svg.appendChild(shape); ```
@norppa have you seen our React example project?
also, OSMD can read mxl files (which is zipped musicxml) and unzip them, so you should be able to pass in the compressed file to osmd.load().
osmd.cursor.iterator.CurrentVoiceEntries.ParentSourceStaffEntry.parentStaff.idto judge the left and right hands, but it is not clear how to use it, because I am also new to osmd. I want to be able to use code to control the display of the left and right hands of the score, just like controlling the display of the scores of different instruments:
osmd.sheet.Instruments.Visible = false. My idea is to be able to display only the left hand or the right hand, or Some special treatments are performed on the right hand, such as setting transparency, etc. This way, you can practice the left and right hands separately. I don’t know if this will be difficult to achieve.
@rianlu regarding checking for rhythm, I just changed SourceMeasure.RhythmPrinted to be of type RhythmInstruction instead of boolean. So you'll be able to check sourceMeasure.RhythmPrinted.Rhythm.Nominator (3) and Denominator (4) for a 3/4 score. this is updated on the develop branch, will be in the next OSMD release.
if you need the information now, with a method that works in the current OSMD release, see MusicSystemBuilder.AddInstructionsAtMeasureBegin in the source code.
osmd.cursor.iterator.CurrentVoiceEntries.ParentSourceStaffEntry.parentStaff.idto 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?