@hallvors it's mainly historical, early on most properties were lowercase and private, and only some that should be public had getters and/or setters. But having getters and setters for everything in Typescript creates piles of boiler plate code, so we just made the properties public, and kept the lowercase in some cases for backwards compatibility.
cursor repetition support is already working in the audio player, will be integrated into osmd soon, see #379 (which you commented on), and #864
osmd.load()
without osmd.render()
, then the interpreted xml model is in osmd.sheet
.osmd.graphic.getClickedObject()
might help with this problem? If you calculate mouse coordinates relative to the SVG and pass an object with x and y to getClickedObject() you might get something to iterate to.. But I still don't know OSMD well enough, so maybe I'm barking up the wrong tree..
osmd.rules.DefaultColorCursor
in osmd 0.9.3
@phamconganh that is a weird MusicXML sample.
you can't easily remove these "words" expressions yet,
we can create an EngravingRule for that soon,
but you can try something like this after osmd.load()
:
removeUnknownExpressions() {
for (let i: number = 0; i < osmd.graphic.ParentMusicSheet.SourceMeasures.length; i++) {
const sourceMeasure: SourceMeasure = osmd.graphic.ParentMusicSheet.SourceMeasures[i];
for (let j: number = 0; j < sourceMeasure.StaffLinkedExpressions.length; j++) {
if (!this.graphicalMusicSheet.MeasureList[i] || !this.graphicalMusicSheet.MeasureList[i][j]) {
continue;
}
for (let k: number = 0; k < sourceMeasure.StaffLinkedExpressions[j].length; k++) {
sourceMeasure.StaffLinkedExpressions[j][k].unknownList = [];
}
}
}
}
but i haven't tested this. this is modified from MusicSheetCalculator.calculateMoodAndUnknownExpressions()
.