Browse Source

merge osmd-public (1.7.2): fix clef at end of measure positioning for Sibelius, build: fix umlauts in key identifiers

sschmidTU 2 years ago
parent
commit
2d92aa917d

+ 7 - 0
karma.conf.js

@@ -22,6 +22,13 @@ module.exports = function (config) {
                 pattern: 'test/**/*.ts',
                 included: true
             }, {
+                // exclude Sibelius files, Karma somehow fails to parse them (e.g. test_clef_measure_end_backup_nodes_Sibelius),
+                //   leading to test failure, no tests being executed
+                pattern: 'test/data/*Sibelius*',
+                included: false,
+                watched: false,
+                served: true
+            }, {
                 pattern: 'test/data/*.xml',
                 included: true
             }, {

+ 6 - 6
package.json

@@ -1,6 +1,6 @@
 {
   "name": "osmd-extended",
-  "version": "1.7.1",
+  "version": "1.7.2",
   "description": "Private / sponsor exclusive OSMD mirror/audio player.",
   "main": "build/opensheetmusicdisplay.min.js",
   "types": "build/dist/src/index.d.ts",
@@ -72,7 +72,7 @@
   "dependencies": {
     "@types/vexflow": "^1.2.38",
     "d-path-parser": "^1.0.0",
-    "jszip": "3.7.1",
+    "jszip": "3.10.1",
     "loglevel": "^1.8.0",
     "soundfont-player": "^0.12.0",
     "standardized-audio-context": "^25.1.5",
@@ -93,15 +93,15 @@
     "cross-env": "^7.0.3",
     "cz-conventional-changelog": "^3.3.0",
     "eslint": "^8.4.0",
-    "eslint-plugin-import": "^2.25.3",
+    "eslint-plugin-import": "^2.27.5",
     "eslint-plugin-jsdoc": "^37.1.0",
     "eslint-plugin-no-null": "^1.0.2",
     "eslint-plugin-node": "^11.1.0",
     "eslint-plugin-standard": "^4.1.0",
     "html-webpack-plugin": "^5.5.0",
     "jquery": "^3.6.0",
-    "jsdom": "^19.0.0",
-    "jspdf": "^2.4.0",
+    "jsdom": "^21.0.0",
+    "jspdf": "^2.5.1",
     "karma": "^6.3.9",
     "karma-base64-to-js-preprocessor": "^0.1.0",
     "karma-chai": "^0.1.0",
@@ -115,7 +115,7 @@
     "ncp": "^2.0.0",
     "npm-run-all": "^4.1.5",
     "pre-commit": "^1.2.2",
-    "svg2pdf.js": "^2.2.0",
+    "svg2pdf.js": "^2.2.1",
     "ts-loader": "^9.2.6",
     "typedoc": "^0.22.10",
     "typescript": "^4.5.2",

+ 9 - 2
src/MusicalScore/ScoreIO/InstrumentReader.ts

@@ -466,7 +466,7 @@ export class InstrumentReader {
             this.isAttributesNodeAtBeginOfMeasure(this.xmlMeasureList[this.currentXmlMeasureIndex], xmlNode)) {
             this.saveAbstractInstructionList(this.instrument.Staves.length, true);
           }
-          if (this.isAttributesNodeAtEndOfMeasure(this.xmlMeasureList[this.currentXmlMeasureIndex], xmlNode)) {
+          if (this.isAttributesNodeAtEndOfMeasure(this.xmlMeasureList[this.currentXmlMeasureIndex], xmlNode, currentFraction)) {
             this.saveClefInstructionAtEndOfMeasure();
           }
           const staffDetailsNodes: IXmlElement[] = xmlNode.elements("staff-details"); // there can be multiple, even if redundant. see #1041
@@ -795,7 +795,14 @@ export class InstrumentReader {
    * @param attributesNode
    * @returns {boolean}
    */
-  private isAttributesNodeAtEndOfMeasure(parentNode: IXmlElement, attributesNode: IXmlElement): boolean {
+  private isAttributesNodeAtEndOfMeasure(parentNode: IXmlElement, attributesNode: IXmlElement, currentFraction: Fraction): boolean {
+    if (currentFraction.Equals(this.ActiveRhythm?.Rhythm)) {
+      return true;
+      // when the MusicXML uses a lot of <backup> nodes (e.g. Sibelius), we sometimes only detect measure end like this, not like below.
+      //   because below code assumes the attributes node is the last one in the measure, just by order in the XML,
+      //   (at least that there are no note nodes after the attributes node)
+      //   but with backup nodes, there can be note nodes after it that are at an earlier timestamp.
+    }
     const childs: IXmlElement[] = parentNode.elements().slice(); // slice=arrayCopy
     let attributesNodeIndex: number = 0;
     for (let i: number = 0; i < childs.length; i++) {

+ 2 - 2
src/MusicalScore/SubInstrument.ts

@@ -19,7 +19,7 @@ export class SubInstrument {
         "bariton": MidiInstrument.Synth_Voice,
         "baritone": MidiInstrument.Synth_Voice,
         "bass": MidiInstrument.Synth_Voice,
-        "blockflöte": MidiInstrument.Recorder,
+        "blockfloete": MidiInstrument.Recorder,
         "brass": MidiInstrument.Trombone,
         "bratsche": MidiInstrument.Viola,
         "cello": MidiInstrument.Cello,
@@ -27,7 +27,7 @@ export class SubInstrument {
         "contrabass": MidiInstrument.Contrabass,
         "drums": MidiInstrument.Percussion,
         "flute": MidiInstrument.Flute,
-        "flöte": MidiInstrument.Flute,
+        "floete": MidiInstrument.Flute,
         "frenchhorn": MidiInstrument.French_Horn,
         "gitarre": MidiInstrument.Acoustic_Guitar_nylon,
         "guitar": MidiInstrument.Acoustic_Guitar_nylon,

+ 2 - 2
src/MusicalScore/VoiceData/Expressions/InstantaneousTempoExpression.ts

@@ -26,10 +26,10 @@ export class InstantaneousTempoExpression extends AbstractTempoExpression {
     private static listInstantaneousTempoAndanteModerato: string[] = ["Andante moderato"]; //  }), TempoEnum.andanteModerato);
     private static listInstantaneousTempoAndante: string[] = ["Andante", "Gehend", "Schreitend", "at a walking pace"]; //  }), TempoEnum.andante);
     private static listInstantaneousTempoAndantino: string[] = ["Andantino"]; //  }), TempoEnum.andantino);
-    private static listInstantaneousTempoModerato: string[] = ["Moderato", "Mäßig", "Mod�r�", "moderately"]; //  }), TempoEnum.moderato);
+    private static listInstantaneousTempoModerato: string[] = ["Moderato", "Mäßig", "Modéré", "moderately"]; //  }), TempoEnum.moderato);
     private static listInstantaneousTempoAllegretto: string[] = ["Allegretto", "fast"]; //  }), TempoEnum.allegretto);
     private static listInstantaneousTempoAllegroModerato: string[] = ["Allegro moderato"]; //  }), TempoEnum.allegroModerato);
-    private static listInstantaneousTempoAllegro: string[] = ["Allegro", "Rapide", "Vite", "Rasch", "Schnell", "Frhlich"]; //  }), TempoEnum.allegro);
+    private static listInstantaneousTempoAllegro: string[] = ["Allegro", "Rapide", "Vite", "Rasch", "Schnell", "Fröhlich"]; //  }), TempoEnum.allegro);
     private static listInstantaneousTempoVivace: string[] = ["Vivace", "Lebhaft", "Lebendig", "lively and fast"]; //  }), TempoEnum.vivace);
     private static listInstantaneousTempoVivacissimo: string[] = ["Vivacissimo", "Sehr lebhaft", "Sehr lebendig"]; //  }), TempoEnum.vivacissimo);
     private static listInstantaneousTempoAllegrissimo: string[] = ["Allegrissimo", "very fast"]; //  }), TempoEnum.allegrissimo);

+ 1 - 1
src/OpenSheetMusicDisplay/OpenSheetMusicDisplay.ts

@@ -35,7 +35,7 @@ import { DynamicsCalculator } from "../MusicalScore/ScoreIO/MusicSymbolModules/D
  * After the constructor, use load() and render() to load and render a MusicXML file.
  */
 export class OpenSheetMusicDisplay {
-    private version: string = "1.7.1-audio-extended"; // getter: this.Version
+    private version: string = "1.7.2-audio-extended"; // getter: this.Version
     // at release, bump version and change to -release, afterwards to -dev again
 
     /**

BIN
test/data/test_clef_measure_end_backup_nodes_Sibelius.musicxml


+ 1 - 1
webpack.common.js

@@ -72,7 +72,7 @@ module.exports = {
             path.join(__dirname, 'build'),
             path.join(__dirname, 'demo')
         ],
-        port: 8000,
+        port: 8001,
         compress: false
     }
 }