Parcourir la source

Linting new files

Andrea Condoluci il y a 9 ans
Parent
commit
7ac8411d0a
24 fichiers modifiés avec 672 ajouts et 474 suppressions
  1. 1 1
      package.json
  2. 2 1
      src/MusicalScore/Graphical/EngravingRules.ts
  3. 10 11
      src/MusicalScore/Graphical/GraphicalMusicSheet.ts
  4. 2 2
      src/MusicalScore/Graphical/GraphicalNote.ts
  5. 2 1
      src/MusicalScore/Graphical/GraphicalStaffEntryLink.ts
  6. 341 156
      src/MusicalScore/Graphical/MusicSheetCalculator.ts
  7. 2 2
      src/MusicalScore/Graphical/MusicSystemBuilder.ts
  8. 4 3
      src/MusicalScore/Graphical/StaffLineActivitySymbol.ts
  9. 12 9
      src/MusicalScore/Graphical/VexFlow/VexFlowGraphicalSymbolFactory.ts
  10. 6 6
      src/MusicalScore/Graphical/VexFlow/VexFlowMeasure.ts
  11. 51 27
      src/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetCalculator.ts
  12. 5 5
      src/MusicalScore/Graphical/VexFlow/VexFlowMusicSystem.ts
  13. 2 1
      src/MusicalScore/Graphical/VexFlow/VexFlowStaffEntry.ts
  14. 2 1
      src/MusicalScore/Graphical/VexFlow/VexFlowStaffLine.ts
  15. 2 1
      src/MusicalScore/Interfaces/ITextMeasurer.ts
  16. 2 1
      src/MusicalScore/Interfaces/ITransposeCalculator.ts
  17. 108 177
      src/MusicalScore/VoiceData/ChordSymbolContainer.ts
  18. 6 6
      src/MusicalScore/VoiceData/Expressions/instantaniousDynamicExpression.ts
  19. 1 1
      src/MusicalScore/VoiceData/Expressions/instantaniousTempoExpression.ts
  20. 2 2
      src/MusicalScore/VoiceData/Expressions/multiTempoExpression.ts
  21. 2 2
      src/MusicalScore/VoiceData/Note.ts
  22. 89 40
      src/MusicalScore/VoiceData/SourceMeasure.ts
  23. 4 4
      src/MusicalScore/VoiceData/SourceStaffEntry.ts
  24. 14 14
      src/MusicalScore/VoiceData/VoiceEntry.ts

+ 1 - 1
package.json

@@ -27,7 +27,7 @@
     "jszip": "",
     "vexflow": "",
     "es6-promise": "",
-	"typescript-collections": "",
+    "typescript-collections": "",
     "chai": "^3.4.1",
     "mocha": "^2.3.4",
     "tsify": "",

+ 2 - 1
src/MusicalScore/Graphical/EngravingRules.ts

@@ -1,6 +1,7 @@
 import {PagePlacementEnum} from "./GraphicalMusicPage";
-import {MusicSymbol} from "./MusicSymbol";
+//import {MusicSymbol} from "./MusicSymbol";
 import {Logging} from "../../Common/logging";
+
 export class EngravingRules {
     private static rules: EngravingRules;
     private static unit: number = 1.0;

+ 10 - 11
src/MusicalScore/Graphical/GraphicalMusicSheet.ts

@@ -30,7 +30,7 @@ export class GraphicalMusicSheet {
         this.calculator.initialize(this);
     }
 
-    private sourceToGraphicalMeasureLinks: { [sourceMeasureIndex: number]: StaffMeasure[]; };
+    private sourceToGraphicalMeasureLinks: Dictionary<SourceMeasure, StaffMeasure[]> = new Dictionary<SourceMeasure, StaffMeasure>();
 
     private musicSheet: MusicSheet;
     //private fontInfo: FontInfo = FontInfo.Info;
@@ -44,7 +44,7 @@ export class GraphicalMusicSheet {
     private lyricist: GraphicalLabel;
     private scoreFollowingLines: GraphicalLine[] = [];
     private maxAllowedSystemWidth: number;
-    //private systemImages: Dictionary<MusicSystem, SystemImageProperties> = new Dictionary<MusicSystem, SystemImageProperties>();
+    private systemImages: Dictionary<MusicSystem, SystemImageProperties> = new Dictionary<MusicSystem, SystemImageProperties>();
     private numberOfStaves: number;
     private leadSheet: boolean = false;
 
@@ -128,9 +128,9 @@ export class GraphicalMusicSheet {
         this.maxAllowedSystemWidth = value;
     }
 
-    //public get SystemImages(): Dictionary<MusicSystem, SystemImageProperties> {
-    //    return this.systemImages;
-    //}
+    public get SystemImages(): Dictionary<MusicSystem, SystemImageProperties> {
+        return this.systemImages;
+    }
 
     public get NumberOfStaves(): number {
         return this.numberOfStaves;
@@ -281,14 +281,16 @@ export class GraphicalMusicSheet {
 
     public getOrCreateVerticalContainer(timestamp: Fraction): VerticalGraphicalStaffEntryContainer {
         if (this.verticalGraphicalStaffEntryContainers.length === 0 || timestamp > this.verticalGraphicalStaffEntryContainers.Last().AbsoluteTimestamp) {
-            let verticalGraphicalStaffEntryContainer: VerticalGraphicalStaffEntryContainer = new VerticalGraphicalStaffEntryContainer(this.numberOfStaves, timestamp);
+            let verticalGraphicalStaffEntryContainer: VerticalGraphicalStaffEntryContainer =
+                new VerticalGraphicalStaffEntryContainer(this.numberOfStaves, timestamp);
             this.verticalGraphicalStaffEntryContainers.push(verticalGraphicalStaffEntryContainer);
             return verticalGraphicalStaffEntryContainer;
         }
         let i: number;
         for (; i >= 0; i--) {
             if (this.verticalGraphicalStaffEntryContainers[i].AbsoluteTimestamp < timestamp) {
-                let verticalGraphicalStaffEntryContainer: VerticalGraphicalStaffEntryContainer = new VerticalGraphicalStaffEntryContainer(this.numberOfStaves, timestamp);
+                let verticalGraphicalStaffEntryContainer: VerticalGraphicalStaffEntryContainer =
+                    new VerticalGraphicalStaffEntryContainer(this.numberOfStaves, timestamp);
                 this.verticalGraphicalStaffEntryContainers.splice(i + 1, 0, verticalGraphicalStaffEntryContainer);
                 return verticalGraphicalStaffEntryContainer;
             }
@@ -765,10 +767,7 @@ export class GraphicalMusicSheet {
     }
 
     public GetGraphicalFromSourceMeasure(sourceMeasure: SourceMeasure): StaffMeasure[] {
-        // Andrea: FIXME This code should remove the necessity for a dictionary in this.sourceToGraphicalMeasureLinks
-        // But I should check better!
-        let index: number = this.musicSheet.SourceMeasures.indexOf(sourceMeasure);
-        return this.sourceToGraphicalMeasureLinks[index];
+        return this.sourceToGraphicalMeasureLinks.Get(sourceMeasure);
     }
 
     public GetGraphicalFromSourceStaffEntry(sourceStaffEntry: SourceStaffEntry): GraphicalStaffEntry {

+ 2 - 2
src/MusicalScore/Graphical/GraphicalNote.ts

@@ -30,8 +30,8 @@ export class GraphicalNote extends GraphicalObject {
 
     public Transpose(keyInstruction: KeyInstruction, activeClef: ClefInstruction, halfTones: number, octaveEnum: OctaveEnum): Pitch {
         let transposedPitch: Pitch = this.sourceNote.Pitch;
-        if (MusicSheetCalculator.TransposeCalculator !== undefined) {
-            transposedPitch = MusicSheetCalculator.TransposeCalculator.transposePitch(this.sourceNote.Pitch, keyInstruction, halfTones);
+        if (MusicSheetCalculator.transposeCalculator !== undefined) {
+            transposedPitch = MusicSheetCalculator.transposeCalculator.transposePitch(this.sourceNote.Pitch, keyInstruction, halfTones);
         }
         return transposedPitch;
     }

+ 2 - 1
src/MusicalScore/Graphical/GraphicalStaffEntryLink.ts

@@ -20,8 +20,9 @@ export class GraphicalStaffEntryLink {
     }
     public isFilled(): boolean {
         for (let i: number = 0; i < this.graphicalLinkedStaffEntries.length; i++) {
-            if (this.graphicalLinkedStaffEntries[i] === undefined)
+            if (this.graphicalLinkedStaffEntries[i] === undefined) {
                 return false;
+            }
         }
         return true;
     }

Fichier diff supprimé car celui-ci est trop grand
+ 341 - 156
src/MusicalScore/Graphical/MusicSheetCalculator.ts


+ 2 - 2
src/MusicalScore/Graphical/MusicSystemBuilder.ts

@@ -320,9 +320,9 @@ export class MusicSystemBuilder {
     private transposeKeyInstruction(keyInstruction: KeyInstruction, graphicalMeasure: StaffMeasure): KeyInstruction {
         if (this.graphicalMusicSheet.ParentMusicSheet.Transpose !== 0
             && graphicalMeasure.ParentStaff.ParentInstrument.MidiInstrumentId !== MidiInstrument.Percussion
-            && MusicSheetCalculator.TransposeCalculator !== undefined
+            && MusicSheetCalculator.transposeCalculator !== undefined
         ) {
-            MusicSheetCalculator.TransposeCalculator.transposeKey(
+            MusicSheetCalculator.transposeCalculator.transposeKey(
                 keyInstruction,
                 this.graphicalMusicSheet.ParentMusicSheet.Transpose
             );

+ 4 - 3
src/MusicalScore/Graphical/StaffLineActivitySymbol.ts

@@ -1,15 +1,16 @@
 import {GraphicalObject} from "./GraphicalObject";
 import {StaffLine} from "./StaffLine";
 import {BoundingBox} from "./BoundingBox";
+
 export class StaffLineActivitySymbol extends GraphicalObject {
     constructor(staffLine: StaffLine) {
-        this.ParentStaffLine = staffLine;
-        var staffLinePsi: BoundingBox = staffLine.PositionAndShape;
+        this.parentStaffLine = staffLine;
+        let staffLinePsi: BoundingBox = staffLine.PositionAndShape;
         this.boundingBox = new BoundingBox(staffLinePsi, this);
         this.boundingBox.BorderRight = 6;
         this.boundingBox.BorderBottom = 4.5;
         this.boundingBox.BorderLeft = -1.5;
         this.boundingBox.BorderTop = -1.5;
     }
-    public ParentStaffLine: StaffLine;
+    public parentStaffLine: StaffLine;
 }

+ 12 - 9
src/MusicalScore/Graphical/VexFlow/VexFlowGraphicalSymbolFactory.ts

@@ -17,6 +17,7 @@ import {OctaveEnum} from "../../VoiceData/Expressions/ContinuousExpressions/octa
 import {GraphicalNote} from "../GraphicalNote";
 import {Pitch} from "../../../Common/DataObjects/pitch";
 import {TechnicalInstruction} from "../../VoiceData/Instructions/TechnicalInstruction";
+
 export class VexFlowGraphicalSymbolFactory implements IGraphicalSymbolFactory {
     /**
      * Create a new music system for the given page.
@@ -46,7 +47,7 @@ export class VexFlowGraphicalSymbolFactory implements IGraphicalSymbolFactory {
      * @returns {VexFlowMeasure}
      */
     public createStaffMeasure(sourceMeasure: SourceMeasure, staff: Staff): StaffMeasure {
-        let measure: VexFlowMeasure = new VexFlowMeasure(staff, null, sourceMeasure);
+        let measure: VexFlowMeasure = new VexFlowMeasure(staff, undefined, sourceMeasure);
         return measure;
     }
 
@@ -91,7 +92,8 @@ export class VexFlowGraphicalSymbolFactory implements IGraphicalSymbolFactory {
      * @param octaveShift   The currently active octave transposition enum, needed for positioning the note vertically
      * @returns {GraphicalNote}
      */
-    public createNote(note: Note, numberOfDots: number, graphicalStaffEntry: GraphicalStaffEntry, activeClef: ClefInstruction, octaveShift: OctaveEnum = OctaveEnum.NONE): GraphicalNote {
+    public createNote(note: Note, numberOfDots: number, graphicalStaffEntry: GraphicalStaffEntry,
+                      activeClef: ClefInstruction, octaveShift: OctaveEnum = OctaveEnum.NONE): GraphicalNote {
         let gn: GraphicalNote = new GraphicalNote(note, graphicalStaffEntry);
         return gn;
     }
@@ -105,7 +107,8 @@ export class VexFlowGraphicalSymbolFactory implements IGraphicalSymbolFactory {
      * @param octaveShift
      * @returns {GraphicalNote}
      */
-    public createGraceNote(note: Note, numberOfDots: number, graphicalStaffEntry: GraphicalStaffEntry, activeClef: ClefInstruction, octaveShift: OctaveEnum = OctaveEnum.NONE): GraphicalNote {
+    public createGraceNote(note: Note, numberOfDots: number, graphicalStaffEntry: GraphicalStaffEntry,
+                           activeClef: ClefInstruction, octaveShift: OctaveEnum = OctaveEnum.NONE): GraphicalNote {
         let gn: GraphicalNote = new GraphicalNote(note, graphicalStaffEntry);
         return gn;
     }
@@ -118,7 +121,7 @@ export class VexFlowGraphicalSymbolFactory implements IGraphicalSymbolFactory {
      * @param graceScalingFactor
      */
     public addGraphicalAccidental(graphicalNote: GraphicalNote, pitch: Pitch, grace: boolean, graceScalingFactor: number): void {
-
+        return;
     }
 
     /**
@@ -129,7 +132,7 @@ export class VexFlowGraphicalSymbolFactory implements IGraphicalSymbolFactory {
      * @param graphicalStaffEntry
      */
     public addFermataAtTiedEndNote(tiedNote: Note, graphicalStaffEntry: GraphicalStaffEntry): void {
-
+        return;
     }
 
     /**
@@ -138,7 +141,7 @@ export class VexFlowGraphicalSymbolFactory implements IGraphicalSymbolFactory {
      * @param graphicalStaffEntry
      */
     public createGraphicalTechnicalInstruction(technicalInstruction: TechnicalInstruction, graphicalStaffEntry: GraphicalStaffEntry): void {
-
+        return;
     }
 
     /**
@@ -147,7 +150,7 @@ export class VexFlowGraphicalSymbolFactory implements IGraphicalSymbolFactory {
      * @param clefInstruction
      */
     public createInStaffClef(graphicalStaffEntry: GraphicalStaffEntry, clefInstruction: ClefInstruction): void {
-
+        return;
     }
 
     /**
@@ -157,6 +160,6 @@ export class VexFlowGraphicalSymbolFactory implements IGraphicalSymbolFactory {
      * @param transposeHalftones
      */
     public createChordSymbol(sourceStaffEntry: SourceStaffEntry, graphicalStaffEntry: GraphicalStaffEntry, transposeHalftones: number): void {
-
+        return;
     }
-}
+}

+ 6 - 6
src/MusicalScore/Graphical/VexFlow/VexFlowMeasure.ts

@@ -49,7 +49,7 @@ export class VexFlowMeasure extends StaffMeasure {
      * @param currentClef the valid clef. Needed to put the accidentals on the right y-positions.
      */
     public addKeyAtBegin(currentKey: KeyInstruction, previousKey: KeyInstruction, currentClef: ClefInstruction): void {
-
+        return;
     }
 
     /**
@@ -58,7 +58,7 @@ export class VexFlowMeasure extends StaffMeasure {
      * @param rhythm
      */
     public addRhythmAtBegin(rhythm: RhythmInstruction): void {
-
+        return;
     }
 
     /**
@@ -67,7 +67,7 @@ export class VexFlowMeasure extends StaffMeasure {
      * @param clef
      */
     public addClefAtEnd(clef: ClefInstruction): void {
-
+        return;
     }
 
     /**
@@ -75,7 +75,7 @@ export class VexFlowMeasure extends StaffMeasure {
      * @param xPos
      */
     public setPositionInStaffline(xPos: number): void {
-
+        return;
     }
 
     /**
@@ -83,7 +83,7 @@ export class VexFlowMeasure extends StaffMeasure {
      * @param width
      */
     public setWidth(width: number): void {
-
+        return;
     }
 
     /**
@@ -92,6 +92,6 @@ export class VexFlowMeasure extends StaffMeasure {
      * (multiply the minimal positions with the scaling factor, considering the BeginInstructionsWidth)
      */
     public layoutSymbols(): void {
-
+        return;
     }
 }

+ 51 - 27
src/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetCalculator.ts

@@ -23,7 +23,8 @@ import {LyricWord} from "../../VoiceData/Lyrics/LyricsWord";
 import {OrnamentContainer} from "../../VoiceData/OrnamentContainer";
 import {ArticulationEnum} from "../../VoiceData/VoiceEntry";
 import {Tuplet} from "../../VoiceData/Tuplet";
-import {VexFlowMeasure} from "./VexFlowMeasure";
+//import {VexFlowMeasure} from "./VexFlowMeasure";
+
 export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
     constructor() {
         super(new VexFlowGraphicalSymbolFactory());
@@ -54,37 +55,48 @@ export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
     protected calculateMeasureXLayout(measures: StaffMeasure[]): number {
         // set measure length and Borders
         for (let idx: number = 0, len: number = measures.length; idx < len; ++idx) {
-            let measure: VexFlowMeasure  = <VexFlowMeasure>measures[idx];
+            //let measure: VexFlowMeasure  = <VexFlowMeasure>measures[idx];
             // set Measure StaffEntriesLength (needed later to calculate the whole Measure Width)
             //measure.MinimumStaffEntriesWidth = measureLength;
 
 
         }
+        return 0;
     }
 
     /**
      * Creates the music systems and calculates their layout.
      */
     protected calculateMusicSystems(): void {
-        let measureList: StaffMeasure[][] = this.graphicalMusicSheet.MeasureList.Select(ml => ml.Where(m => m.isVisible()).ToList()).ToList();
+        let measureList: StaffMeasure[][] = [];
+        for (let mlist of this.graphicalMusicSheet.MeasureList) {
+            let list: StaffMeasure[] = [];
+            for (let m of mlist) {
+                if (m.isVisible()) {
+                    list.push(m);
+                }
+            }
+            measureList.push(list);
+        }
         let numberOfStaffLines: number = 0;
         for (let idx: number = 0, len: number = measureList.length; idx < len; ++idx) {
             let gmlist: StaffMeasure[] = measureList[idx];
             numberOfStaffLines = Math.max(gmlist.length, numberOfStaffLines);
             break;
         }
-        if (numberOfStaffLines === 0)
-            return;
+        if (numberOfStaffLines === 0) { return; }
         let musicSystemBuilder: MusicSystemBuilder = new MusicSystemBuilder();
         musicSystemBuilder.initialize(this.graphicalMusicSheet, measureList, numberOfStaffLines, this.symbolFactory);
         musicSystemBuilder.buildMusicSystems();
         this.checkMeasuresForWholeRestNotes();
     }
-    protected updateStaffLineBorders(staffLine: StaffLine): void {
 
+    protected updateStaffLineBorders(staffLine: StaffLine): void {
+        return;
     }
-    protected calculateMeasureNumberPlacement(musicSystem: MusicSystem): void {
 
+    protected calculateMeasureNumberPlacement(musicSystem: MusicSystem): void {
+        return;
     }
 
     /**
@@ -97,8 +109,9 @@ export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
      * @param hasPitchedNote
      * @param isGraceStaffEntry
      */
-    protected layoutVoiceEntry(voiceEntry: VoiceEntry, graphicalNotes: GraphicalNote[], graphicalStaffEntry: GraphicalStaffEntry, hasPitchedNote: boolean, isGraceStaffEntry: boolean): void {
-
+    protected layoutVoiceEntry(voiceEntry: VoiceEntry, graphicalNotes: GraphicalNote[], graphicalStaffEntry: GraphicalStaffEntry,
+                               hasPitchedNote: boolean, isGraceStaffEntry: boolean): void {
+        return;
     }
 
     /**
@@ -107,7 +120,7 @@ export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
      * @param graphicalStaffEntry
      */
     protected layoutStaffEntry(graphicalStaffEntry: GraphicalStaffEntry): void {
-
+        return;
     }
 
     /**
@@ -119,7 +132,7 @@ export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
             let graphicalMusicPage: GraphicalMusicPage = this.graphicalMusicSheet.MusicPages[idx];
             if (!this.leadSheet) {
                 for (let idx2: number = 0, len2: number = graphicalMusicPage.MusicSystems.length; idx2 < len2; ++idx2) {
-                    let musicSystem: MusicSystem = graphicalMusicPage.MusicSystems[idx2];
+                    //let musicSystem: MusicSystem = graphicalMusicPage.MusicSystems[idx2];
                     // calculate y positions of stafflines within system
                     // ...
                 }
@@ -133,30 +146,37 @@ export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
      * Is called at the begin of the method for creating the vertically aligned staff measures belonging to one source measure.
      */
     protected initStaffMeasuresCreation(): void {
-
+        return;
     }
-    protected handleTie(tie: Tie, startGraphicalStaffEntry: GraphicalStaffEntry, staffIndex: number, measureIndex: number): void {
 
+    protected handleTie(tie: Tie, startGraphicalStaffEntry: GraphicalStaffEntry, staffIndex: number, measureIndex: number): void {
+        return;
     }
-    protected layoutGraphicalTie(tie: GraphicalTie, tieIsAtSystemBreak: boolean): void {
 
+    protected layoutGraphicalTie(tie: GraphicalTie, tieIsAtSystemBreak: boolean): void {
+        return;
     }
-    protected calculateSingleStaffLineLyricsPosition(staffLine: StaffLine, lyricVersesNumber: number[]): void {
 
+    protected calculateSingleStaffLineLyricsPosition(staffLine: StaffLine, lyricVersesNumber: number[]): void {
+        return;
     }
-    protected calculateSingleOctaveShift(sourceMeasure: SourceMeasure, multiExpression: MultiExpression, measureIndex: number, staffIndex: number): void {
 
+    protected calculateSingleOctaveShift(sourceMeasure: SourceMeasure, multiExpression: MultiExpression, measureIndex: number, staffIndex: number): void {
+        return;
     }
-    protected calculateWordRepetitionInstruction(repetitionInstruction: RepetitionInstruction, measureIndex: number): void {
 
+    protected calculateWordRepetitionInstruction(repetitionInstruction: RepetitionInstruction, measureIndex: number): void {
+        return;
     }
-    protected calculateMoodAndUnknownExpression(multiExpression: MultiExpression, measureIndex: number, staffIndex: number): void {
 
+    protected calculateMoodAndUnknownExpression(multiExpression: MultiExpression, measureIndex: number, staffIndex: number): void {
+        return;
     }
-    protected createGraphicalTieNote(beams: Beam[], activeClef: ClefInstruction,
-        octaveShiftValue: OctaveEnum, graphicalStaffEntry: GraphicalStaffEntry, duration: Fraction, numberOfDots: number,
-        openTie: Tie, isLastTieNote: boolean): void {
 
+    protected createGraphicalTieNote(beams: Beam[], activeClef: ClefInstruction,
+                                     octaveShiftValue: OctaveEnum, graphicalStaffEntry: GraphicalStaffEntry, duration: Fraction, numberOfDots: number,
+                                     openTie: Tie, isLastTieNote: boolean): void {
+        return;
     }
 
     /**
@@ -166,16 +186,20 @@ export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
      * @param openBeams a list of all currently open beams
      */
     protected handleBeam(graphicalNote: GraphicalNote, beam: Beam, openBeams: Beam[]): void {
-
+        return;
     }
-    protected handleVoiceEntryLyrics(lyricsEntries: { [_: number]: LyricsEntry; }, voiceEntry: VoiceEntry, graphicalStaffEntry: GraphicalStaffEntry, openLyricWords: LyricWord[]): void {
 
+    protected handleVoiceEntryLyrics(lyricsEntries: { [_: number]: LyricsEntry; }, voiceEntry: VoiceEntry,
+                                     graphicalStaffEntry: GraphicalStaffEntry, openLyricWords: LyricWord[]): void {
+        return;
     }
-    protected handleVoiceEntryOrnaments(ornamentContainer: OrnamentContainer, voiceEntry: VoiceEntry, graphicalStaffEntry: GraphicalStaffEntry): void {
 
+    protected handleVoiceEntryOrnaments(ornamentContainer: OrnamentContainer, voiceEntry: VoiceEntry, graphicalStaffEntry: GraphicalStaffEntry): void {
+        return;
     }
-    protected handleVoiceEntryArticulations(articulations: ArticulationEnum[], voiceEntry: VoiceEntry, graphicalStaffEntry: GraphicalStaffEntry): void {
 
+    protected handleVoiceEntryArticulations(articulations: ArticulationEnum[], voiceEntry: VoiceEntry, graphicalStaffEntry: GraphicalStaffEntry): void {
+        return;
     }
 
     /**
@@ -185,6 +209,6 @@ export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
      * @param openTuplets a list of all currently open tuplets
      */
     protected handleTuplet(graphicalNote: GraphicalNote, tuplet: Tuplet, openTuplets: Tuplet[]): void {
-
+        return;
     }
-}
+}

+ 5 - 5
src/MusicalScore/Graphical/VexFlow/VexFlowMusicSystem.ts

@@ -15,7 +15,7 @@ export class VexFlowMusicSystem extends MusicSystem {
      * @param systemLabelsRightMargin
      */
     public createSystemLeftVerticalLineObject(lineWidth: number, systemLabelsRightMargin: number): void {
-
+        return;
     }
 
     /**
@@ -26,7 +26,7 @@ export class VexFlowMusicSystem extends MusicSystem {
      * @param index
      */
     public createVerticalLineForMeasure(position: number, lineType: SystemLinesEnum, lineWidth: number, index: number): void {
-
+        return;
     }
 
     /**
@@ -34,7 +34,7 @@ export class VexFlowMusicSystem extends MusicSystem {
      * @param rules
      */
     public setYPositionsToVerticalLineObjectsAndCreateLines(rules: EngravingRules): void {
-
+        return;
     }
 
     /**
@@ -52,7 +52,7 @@ export class VexFlowMusicSystem extends MusicSystem {
      * @param rightLower the lower right corner point of the bracket to create
      */
     protected createInstrumentBracket(rightUpper: PointF2D, rightLower: PointF2D): void {
-
+        return;
     }
 
     /**
@@ -65,6 +65,6 @@ export class VexFlowMusicSystem extends MusicSystem {
      * @param recursionDepth
      */
     protected createGroupBracket(rightUpper: PointF2D, rightLower: PointF2D, staffHeight: number, recursionDepth: number): void {
-
+        return;
     }
 }

+ 2 - 1
src/MusicalScore/Graphical/VexFlow/VexFlowStaffEntry.ts

@@ -1,9 +1,10 @@
 import {GraphicalStaffEntry} from "../GraphicalStaffEntry";
 import {VexFlowMeasure} from "./VexFlowMeasure";
 import {SourceStaffEntry} from "../../VoiceData/SourceStaffEntry";
+
 export class VexFlowStaffEntry extends GraphicalStaffEntry {
     constructor(measure: VexFlowMeasure, sourceStaffEntry: SourceStaffEntry, staffEntryParent: VexFlowStaffEntry) {
         super(measure, sourceStaffEntry, staffEntryParent);
 
     }
-}
+}

+ 2 - 1
src/MusicalScore/Graphical/VexFlow/VexFlowStaffLine.ts

@@ -1,9 +1,10 @@
 import {StaffLine} from "../StaffLine";
 import {MusicSystem} from "../MusicSystem";
 import {Staff} from "../../VoiceData/Staff";
+
 export class VexFlowStaffLine extends StaffLine {
     constructor(parentSystem: MusicSystem, parentStaff: Staff) {
         super(parentSystem, parentStaff);
 
     }
-}
+}

+ 2 - 1
src/MusicalScore/Interfaces/ITextMeasurer.ts

@@ -1,5 +1,6 @@
 import {Fonts} from "../../Common/Enums/Fonts";
 import {FontStyles} from "../../Common/Enums/FontStyles";
+
 export interface ITextMeasurer {
     computeTextWidthToHeightRatio(text: string, font: Fonts, style: FontStyles): number;
-}
+}

+ 2 - 1
src/MusicalScore/Interfaces/ITransposeCalculator.ts

@@ -1,7 +1,8 @@
 import {Pitch} from "../../Common/DataObjects/pitch";
 import {KeyInstruction} from "../VoiceData/Instructions/KeyInstruction";
+
 export interface ITransposeCalculator {
     transposePitch(pitch: Pitch, currentKeyInstruction: KeyInstruction, halftones: number): Pitch;
     transposeKey(keyInstruction: KeyInstruction, transpose: number): void;
     getTransposedKeyString(keyInstruction: KeyInstruction, halftone: number): string;
-}
+}

+ 108 - 177
src/MusicalScore/VoiceData/ChordSymbolContainer.ts

@@ -8,6 +8,7 @@ export class ChordSymbolContainer {
     private bassPitch: Pitch;
     private degree: Degree;
     private keyInstruction: KeyInstruction;
+
     constructor(rootPitch: Pitch, chordKind: ChordSymbolEnum, bassPitch: Pitch, chordDegree: Degree, keyInstruction: KeyInstruction) {
         this.rootPitch = rootPitch;
         this.chordKind = chordKind;
@@ -15,211 +16,169 @@ export class ChordSymbolContainer {
         this.bassPitch = bassPitch;
         this.degree = chordDegree;
     }
+
     public get RootPitch(): Pitch {
         return this.rootPitch;
     }
+
     public get ChordKind(): ChordSymbolEnum {
         return this.chordKind;
     }
+
     public get BassPitch(): Pitch {
         return this.bassPitch;
     }
+
     public get ChordDegree(): Degree {
         return this.degree;
     }
+
     public get KeyInstruction(): KeyInstruction {
         return this.keyInstruction;
     }
+
     public static calculateChordText(chordSymbol: ChordSymbolContainer, transposeHalftones: number): string {
-        var transposedRootPitch: Pitch = chordSymbol.RootPitch;
-        if (MusicSheetCalculator.TransposeCalculator != null)
-            transposedRootPitch = MusicSheetCalculator.TransposeCalculator.TransposePitch(chordSymbol.RootPitch,
+        let transposedRootPitch: Pitch = chordSymbol.RootPitch;
+        if (MusicSheetCalculator.transposeCalculator !== undefined) {
+            transposedRootPitch = MusicSheetCalculator.transposeCalculator.TransposePitch(
+                chordSymbol.RootPitch,
                 chordSymbol.KeyInstruction,
-                transposeHalftones);
-        var text: string = transposedRootPitch.FundamentalNote.ToString();
-        if (transposedRootPitch.Accidental != AccidentalEnum.NONE)
+                transposeHalftones
+            );
+        }
+        let text: string = transposedRootPitch.FundamentalNote.ToString();
+        if (transposedRootPitch.Accidental !== AccidentalEnum.NONE) {
             text += this.getTextForAccidental(transposedRootPitch.Accidental);
+        }
         text += ChordSymbolContainer.getTextFromChordKindEnum(chordSymbol.ChordKind);
-        if (chordSymbol.BassPitch != null) {
-            var transposedBassPitch: Pitch = chordSymbol.BassPitch;
-            if (MusicSheetCalculator.TransposeCalculator != null)
-                transposedBassPitch = MusicSheetCalculator.TransposeCalculator.TransposePitch(chordSymbol.BassPitch,
+        if (chordSymbol.BassPitch !== undefined) {
+            let transposedBassPitch: Pitch = chordSymbol.BassPitch;
+            if (MusicSheetCalculator.transposeCalculator !== undefined) {
+                transposedBassPitch = MusicSheetCalculator.transposeCalculator.TransposePitch(
+                    chordSymbol.BassPitch,
                     chordSymbol.KeyInstruction,
-                    transposeHalftones);
+                    transposeHalftones
+                );
+            }
             text += "/";
             text += transposedBassPitch.FundamentalNote.ToString();
             text += this.getTextForAccidental(transposedBassPitch.Accidental);
         }
-        if (chordSymbol.ChordDegree != null) {
-            switch (chordSymbol.ChordDegree.Text) {
+        if (chordSymbol.ChordDegree !== undefined) {
+            switch (chordSymbol.ChordDegree.text) {
                 case ChordDegreeText.add:
-                    {
-                        text += "add";
-                        break;
-                    }
+                    text += "add";
+                    break;
                 case ChordDegreeText.alter:
-                    {
-                        text += "alt";
-                        break;
-                    }
+                    text += "alt";
+                    break;
                 case ChordDegreeText.subtract:
-                    {
-                        text += "sub";
-                        break;
-                    }
+                    text += "sub";
+                    break;
+                default:
+            }
+            text += chordSymbol.ChordDegree.value;
+            if (chordSymbol.ChordDegree.alteration !== AccidentalEnum.NONE) {
+                text += ChordSymbolContainer.getTextForAccidental(chordSymbol.ChordDegree.alteration);
             }
-            text += chordSymbol.ChordDegree.Value;
-            if (chordSymbol.ChordDegree.Alteration != AccidentalEnum.NONE)
-                text += ChordSymbolContainer.getTextForAccidental(chordSymbol.ChordDegree.Alteration);
         }
         return text;
     }
+
     private static getTextForAccidental(alteration: AccidentalEnum): string {
-        var text: string = "";
+        let text: string = "";
         switch (alteration) {
             case AccidentalEnum.DOUBLEFLAT:
-                {
-                    text += "bb";
-                    break;
-                }
+                text += "bb";
+                break;
             case AccidentalEnum.FLAT:
-                {
-                    text += "b";
-                    break;
-                }
+                text += "b";
+                break;
             case AccidentalEnum.SHARP:
-                {
-                    text += "#";
-                    break;
-                }
+                text += "#";
+                break;
             case AccidentalEnum.DOUBLESHARP:
-                {
-                    text += "x";
-                    break;
-                }
+                text += "x";
+                break;
+            default:
         }
         return text;
     }
+
     private static getTextFromChordKindEnum(kind: ChordSymbolEnum): string {
-        var text: string = "";
+        let text: string = "";
         switch (kind) {
             case ChordSymbolEnum.major:
                 break;
             case ChordSymbolEnum.minor:
-                {
-                    text += "m";
-                    break;
-                }
+                text += "m";
+                break;
             case ChordSymbolEnum.augmented:
-                {
-                    text += "aug";
-                    break;
-                }
+                text += "aug";
+                break;
             case ChordSymbolEnum.diminished:
-                {
-                    text += "dim";
-                    break;
-                }
+                text += "dim";
+                break;
             case ChordSymbolEnum.dominant:
-                {
-                    text += "7";
-                    break;
-                }
+                text += "7";
+                break;
             case ChordSymbolEnum.majorseventh:
-                {
-                    text += "maj7";
-                    break;
-                }
+                text += "maj7";
+                break;
             case ChordSymbolEnum.minorseventh:
-                {
-                    text += "m7";
-                    break;
-                }
+                text += "m7";
+                break;
             case ChordSymbolEnum.diminishedseventh:
-                {
-                    text += "dim7";
-                    break;
-                }
+                text += "dim7";
+                break;
             case ChordSymbolEnum.augmentedseventh:
-                {
-                    text += "aug7";
-                    break;
-                }
+                text += "aug7";
+                break;
             case ChordSymbolEnum.halfdiminished:
-                {
-                    text += "m7b5";
-                    break;
-                }
+                text += "m7b5";
+                break;
             case ChordSymbolEnum.majorminor:
-                {
-                    text += "";
-                    break;
-                }
+                text += "";
+                break;
             case ChordSymbolEnum.majorsixth:
-                {
-                    text += "maj6";
-                    break;
-                }
+                text += "maj6";
+                break;
             case ChordSymbolEnum.minorsixth:
-                {
-                    text += "m6";
-                    break;
-                }
+                text += "m6";
+                break;
             case ChordSymbolEnum.dominantninth:
-                {
-                    text += "9";
-                    break;
-                }
+                text += "9";
+                break;
             case ChordSymbolEnum.majorninth:
-                {
-                    text += "maj9";
-                    break;
-                }
+                text += "maj9";
+                break;
             case ChordSymbolEnum.minorninth:
-                {
-                    text += "m9";
-                    break;
-                }
+                text += "m9";
+                break;
             case ChordSymbolEnum.dominant11th:
-                {
-                    text += "11";
-                    break;
-                }
+                text += "11";
+                break;
             case ChordSymbolEnum.major11th:
-                {
-                    text += "maj11";
-                    break;
-                }
+                text += "maj11";
+                break;
             case ChordSymbolEnum.minor11th:
-                {
-                    text += "m11";
-                    break;
-                }
+                text += "m11";
+                break;
             case ChordSymbolEnum.dominant13th:
-                {
-                    text += "13";
-                    break;
-                }
+                text += "13";
+                break;
             case ChordSymbolEnum.major13th:
-                {
-                    text += "maj13";
-                    break;
-                }
+                text += "maj13";
+                break;
             case ChordSymbolEnum.minor13th:
-                {
-                    text += "m13";
-                    break;
-                }
+                text += "m13";
+                break;
             case ChordSymbolEnum.suspendedsecond:
-                {
-                    text += "sus2";
-                    break;
-                }
+                text += "sus2";
+                break;
             case ChordSymbolEnum.suspendedfourth:
-                {
-                    text += "sus4";
-                    break;
-                }
+                text += "sus4";
+                break;
             case ChordSymbolEnum.Neapolitan:
             case ChordSymbolEnum.Italian:
             case ChordSymbolEnum.French:
@@ -228,87 +187,59 @@ export class ChordSymbolContainer {
             case ChordSymbolEnum.power:
             case ChordSymbolEnum.Tristan:
                 break;
+            default
         }
         return text;
     }
 }
 export class Degree {
     constructor(value: number, alteration: AccidentalEnum, text: ChordDegreeText) {
-        this.Value = value;
-        this.Alteration = alteration;
-        this.Text = text;
+        this.value = value;
+        this.alteration = alteration;
+        this.text = text;
     }
-    public Value: number;
-    public Alteration: AccidentalEnum;
-    public Text: ChordDegreeText;
+
+    public value: number;
+    public alteration: AccidentalEnum;
+    public text: ChordDegreeText;
 }
+
 export enum ChordDegreeText {
     add,
-
     alter,
-
     subtract
 }
+
 export enum ChordSymbolEnum {
     major,
-
     minor,
-
     augmented,
-
     diminished,
-
     dominant,
-
     majorseventh,
-
     minorseventh,
-
     diminishedseventh,
-
     augmentedseventh,
-
     halfdiminished,
-
     majorminor,
-
     majorsixth,
-
     minorsixth,
-
     dominantninth,
-
     majorninth,
-
     minorninth,
-
     dominant11th,
-
     major11th,
-
     minor11th,
-
     dominant13th,
-
     major13th,
-
     minor13th,
-
     suspendedsecond,
-
     suspendedfourth,
-
     Neapolitan,
-
     Italian,
-
     French,
-
     German,
-
     pedal,
-
     power,
-
     Tristan
-}
+}

+ 6 - 6
src/MusicalScore/VoiceData/Expressions/instantaniousDynamicExpression.ts

@@ -134,12 +134,12 @@ export class InstantaniousDynamicExpression extends AbstractExpression {
         }
     }
     private calculateLength(): number {
-        //var length: number = 0.0;
-        //var dynamic: string = DynamicEnum[this.dynamicEnum];
-        //for (var idx: number = 0, len = dynamic.length; idx < len; ++idx) {
-        //    var c: string = dynamic[idx];
-        //    var dynamicExpressionSymbol: DynamicExpressionSymbolEnum = this.getDynamicExpressionSymbol(c);
-        //    var symbol: FontInfo.MusicFontSymbol = this.getInstantaniousDynamicSymbol(dynamicExpressionSymbol);
+        //let length: number = 0.0;
+        //let dynamic: string = DynamicEnum[this.dynamicEnum];
+        //for (let idx: number = 0, len: number = dynamic.length; idx < len; ++idx) {
+        //    let c: string = dynamic[idx];
+        //    let dynamicExpressionSymbol: DynamicExpressionSymbolEnum = this.getDynamicExpressionSymbol(c);
+        //    let symbol: FontInfo.MusicFontSymbol = this.getInstantaniousDynamicSymbol(dynamicExpressionSymbol);
         //    length += FontInfo.Info.getBoundingBox(symbol).Width;
         //}
         //return length;

+ 1 - 1
src/MusicalScore/VoiceData/Expressions/instantaniousTempoExpression.ts

@@ -139,7 +139,7 @@ export class InstantaniousTempoExpression extends AbstractTempoExpression {
     //private splitStringAfterInstructionWord(inputString: string, instruction: string[], value: TempoEnum, pre: string, post: string): TempoEnum {
     //    pre = undefined;
     //    post = undefined;
-    //    for (let idx: number = 0, len = instruction.length; idx < len; ++idx) {
+    //    for (let idx: number = 0, len: number = instruction.length; idx < len; ++idx) {
     //        let instructionWord: string = instruction[idx];
     //        let separators: string[] = [" " + instructionWord, instructionWord + " ", "," + instructionWord, instructionWord + ","];
     //        for (let j: number = 0; j < 4; j++) {

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

@@ -75,9 +75,9 @@ export class MultiTempoExpression /*implements IComparable<MultiTempoExpression>
     //        else if (this.expressions[indexOfFirstNotInstDynExpr].expression instanceof ContinuousTempoExpression)
     //            return new GraphicalContinuousTempoExpression(
     // <ContinuousTempoExpression>(this.expressions[indexOfFirstNotInstDynExpr].expression), graphicalLabel);
-    //        else return null;
+    //        else return undefined;
     //    }
-    //    return null;
+    //    return undefined;
     //}
     public addExpression(abstractTempoExpression: AbstractTempoExpression, prefix: string): void {
         if (abstractTempoExpression instanceof InstantaniousTempoExpression) {

+ 2 - 2
src/MusicalScore/VoiceData/Note.ts

@@ -135,9 +135,9 @@ export class Note {
     }
     public ToString(): string {
         if (this.pitch !== undefined) {
-            return this.Pitch.ToString() + ", length: " + this.Length.toString();
+            return this.Pitch.ToString() + ", length: " + this.length.toString();
         } else {
-          return "rest note, length: " + this.Length.toString();
+          return "rest note, length: " + this.length.toString();
         }
     }
     public getAbsoluteTimestamp(): Fraction {

+ 89 - 40
src/MusicalScore/VoiceData/SourceMeasure.ts

@@ -11,6 +11,7 @@ import {MultiTempoExpression} from "./Expressions/multiTempoExpression";
 import {KeyInstruction} from "./Instructions/KeyInstruction";
 import {AbstractNotationInstruction} from "./Instructions/AbstractNotationInstruction";
 import {Repetition} from "../MusicSource/Repetition";
+
 export class SourceMeasure {
     constructor(completeNumberOfStaves: number) {
         this.completeNumberOfStaves = completeNumberOfStaves;
@@ -47,75 +48,96 @@ export class SourceMeasure {
     public get MeasureNumber(): number {
         return this.measureNumber;
     }
+
     public set MeasureNumber(value: number) {
         this.measureNumber = value;
     }
+
     public get AbsoluteTimestamp(): Fraction {
         return this.absoluteTimestamp;
     }
+
     public set AbsoluteTimestamp(value: Fraction) {
         this.absoluteTimestamp = value;
     }
+
     public get CompleteNumberOfStaves(): number {
         return this.completeNumberOfStaves;
     }
+
     public get Duration(): Fraction {
         return this.duration;
     }
+
     public set Duration(value: Fraction) {
         this.duration = value;
     }
+
     public get ImplicitMeasure(): boolean {
         return this.implicitMeasure;
     }
+
     public set ImplicitMeasure(value: boolean) {
         this.implicitMeasure = value;
     }
+
     public get BreakSystemAfter(): boolean {
         return this.breakSystemAfter;
     }
+
     public set BreakSystemAfter(value: boolean) {
         this.breakSystemAfter = value;
     }
+
     public get StaffLinkedExpressions(): MultiExpression[][] {
         return this.staffLinkedExpressions;
     }
+
     public get TempoExpressions(): MultiTempoExpression[] {
         return this.tempoExpressions;
     }
+
     public get VerticalSourceStaffEntryContainers(): VerticalSourceStaffEntryContainer[] {
         return this.verticalSourceStaffEntryContainers;
     }
+
     public get FirstInstructionsStaffEntries(): SourceStaffEntry[] {
         return this.firstInstructionsStaffEntries;
     }
+
     public get LastInstructionsStaffEntries(): SourceStaffEntry[] {
         return this.lastInstructionsStaffEntries;
     }
+
     public get FirstRepetitionInstructions(): RepetitionInstruction[] {
         return this.firstRepetitionInstructions;
     }
+
     public get LastRepetitionInstructions(): RepetitionInstruction[] {
         return this.lastRepetitionInstructions;
     }
+
     public getErrorInMeasure(staffIndex: number): boolean {
         return this.staffMeasureErrors[staffIndex];
     }
+
     public setErrorInStaffMeasure(staffIndex: number, hasError: boolean): void {
         this.staffMeasureErrors[staffIndex] = hasError;
     }
+
     public getNextMeasure(measures: SourceMeasure[]): SourceMeasure {
         return measures[this.measureListIndex + 1];
     }
+
     public getPreviousMeasure(measures: SourceMeasure[]): SourceMeasure {
         if (this.measureListIndex > 1) {
             return measures[this.measureListIndex - 1];
         }
         return undefined;
     }
-    public findOrCreateStaffEntry(
-        inMeasureTimestamp: Fraction, inSourceMeasureStaffIndex: number, staff: Staff
-    ): {createdNewContainer: boolean, staffEntry: SourceStaffEntry} {
+
+    public findOrCreateStaffEntry(inMeasureTimestamp: Fraction, inSourceMeasureStaffIndex: number,
+                                  staff: Staff): {createdNewContainer: boolean, staffEntry: SourceStaffEntry} {
         // FIXME Andrea: debug & Test
         let staffEntry: SourceStaffEntry = undefined;
         // Find:
@@ -171,6 +193,7 @@ export class SourceMeasure {
         //Logging.debug("created new container: ", staffEntry, this.verticalSourceStaffEntryContainers);
         return {createdNewContainer: true, staffEntry: staffEntry};
     }
+
     public findOrCreateVoiceEntry(sse: SourceStaffEntry, voice: Voice): { createdVoiceEntry: boolean, voiceEntry: VoiceEntry } {
         let ve: VoiceEntry = undefined;
         let createdNewVoiceEntry: boolean = false;
@@ -185,11 +208,10 @@ export class SourceMeasure {
             sse.VoiceEntries.push(ve);
             createdNewVoiceEntry = true;
         }
-        return { createdVoiceEntry: createdNewVoiceEntry, voiceEntry: ve };
+        return {createdVoiceEntry: createdNewVoiceEntry, voiceEntry: ve};
     }
-    public getPreviousSourceStaffEntryFromIndex(
-        verticalIndex: number, horizontalIndex: number
-    ): SourceStaffEntry {
+
+    public getPreviousSourceStaffEntryFromIndex(verticalIndex: number, horizontalIndex: number): SourceStaffEntry {
         for (let i: number = horizontalIndex - 1; i >= 0; i--) {
             if (this.verticalSourceStaffEntryContainers[i][verticalIndex] !== undefined) {
                 return this.verticalSourceStaffEntryContainers[i][verticalIndex];
@@ -197,6 +219,7 @@ export class SourceMeasure {
         }
         return undefined;
     }
+
     public getVerticalContainerIndexByTimestamp(musicTimestamp: Fraction): number {
         for (let idx: number = 0, len: number = this.VerticalSourceStaffEntryContainers.length; idx < len; ++idx) {
             if (this.VerticalSourceStaffEntryContainers[idx].Timestamp.Equals(musicTimestamp)) {
@@ -205,6 +228,7 @@ export class SourceMeasure {
         }
         return -1;
     }
+
     public getVerticalContainerByTimestamp(musicTimestamp: Fraction): VerticalSourceStaffEntryContainer {
         for (let idx: number = 0, len: number = this.VerticalSourceStaffEntryContainers.length; idx < len; ++idx) {
             let verticalSourceStaffEntryContainer: VerticalSourceStaffEntryContainer = this.VerticalSourceStaffEntryContainers[idx];
@@ -214,6 +238,7 @@ export class SourceMeasure {
         }
         return undefined;
     }
+
     public checkForEmptyVerticalContainer(index: number): void {
         let undefinedCounter: number = 0;
         for (let i: number = 0; i < this.completeNumberOfStaves; i++) {
@@ -225,6 +250,7 @@ export class SourceMeasure {
             this.verticalSourceStaffEntryContainers.splice(index, 1);
         }
     }
+
     public reverseCheck(musicSheet: MusicSheet, maxInstDuration: Fraction): Fraction {
         let maxDuration: Fraction = new Fraction(0, 1);
         let instrumentsDurations: Fraction[] = [];
@@ -256,6 +282,7 @@ export class SourceMeasure {
         }
         return Fraction.max(maxDuration, maxInstDuration);
     }
+
     public calculateInstrumentsDuration(musicSheet: MusicSheet, instrumentMaxTieNoteFractions: Fraction[]): Fraction[] {
         let instrumentsDurations: Fraction[] = [];
         for (let i: number = 0; i < musicSheet.Instruments.length; i++) {
@@ -276,83 +303,105 @@ export class SourceMeasure {
         }
         return instrumentsDurations;
     }
+
     public getEntriesPerStaff(staffIndex: number): SourceStaffEntry[] {
         let sourceStaffEntries: SourceStaffEntry[] = [];
         for (let container of this.VerticalSourceStaffEntryContainers) {
             let sse: SourceStaffEntry = container.StaffEntries[staffIndex];
-            if (sse !== undefined) { sourceStaffEntries.push(sse); }
+            if (sse !== undefined) {
+                sourceStaffEntries.push(sse);
+            }
         }
         return sourceStaffEntries;
     }
+
     public hasBeginInstructions(): boolean {
-        for (var staffIndex: number = 0, len = this.FirstInstructionsStaffEntries.length; staffIndex < len; staffIndex++) {
-            var beginInstructionsStaffEntry: SourceStaffEntry = this.FirstInstructionsStaffEntries[staffIndex];
-            if (beginInstructionsStaffEntry != null && beginInstructionsStaffEntry.Instructions.length > 0)
+        for (let staffIndex: number = 0, len: number = this.FirstInstructionsStaffEntries.length; staffIndex < len; staffIndex++) {
+            let beginInstructionsStaffEntry: SourceStaffEntry = this.FirstInstructionsStaffEntries[staffIndex];
+            if (beginInstructionsStaffEntry !== undefined && beginInstructionsStaffEntry.Instructions.length > 0) {
                 return true;
+            }
         }
         return false;
     }
+
     public beginsWithLineRepetition(): boolean {
-        for (var idx: number = 0, len = this.FirstRepetitionInstructions.length; idx < len; ++idx) {
-            var instr: RepetitionInstruction = this.FirstRepetitionInstructions[idx];
-            if (instr.parentRepetition != null && instr == instr.parentRepetition.startMarker && !instr.parentRepetition.FromWords)
+        for (let idx: number = 0, len: number = this.FirstRepetitionInstructions.length; idx < len; ++idx) {
+            let instr: RepetitionInstruction = this.FirstRepetitionInstructions[idx];
+            if (instr.parentRepetition !== undefined && instr === instr.parentRepetition.startMarker && !instr.parentRepetition.FromWords) {
                 return true;
+            }
         }
         return false;
     }
+
     public endsWithLineRepetition(): boolean {
-        for (var idx: number = 0, len = this.LastRepetitionInstructions.length; idx < len; ++idx) {
-            var instruction: RepetitionInstruction = this.LastRepetitionInstructions[idx];
-            var rep: Repetition = instruction.parentRepetition;
-            if (rep == null)
+        for (let idx: number = 0, len: number = this.LastRepetitionInstructions.length; idx < len; ++idx) {
+            let instruction: RepetitionInstruction = this.LastRepetitionInstructions[idx];
+            let rep: Repetition = instruction.parentRepetition;
+            if (rep === undefined) {
                 continue;
-            if (rep.FromWords)
+            }
+            if (rep.FromWords) {
                 continue;
-            for (var idx2: number = 0, len2 = rep.BackwardJumpInstructions.length; idx2 < len2; ++idx2) {
-                var backJumpInstruction: RepetitionInstruction = rep.BackwardJumpInstructions[idx2];
-                if (instruction == backJumpInstruction)
+            }
+            for (let idx2: number = 0, len2: number = rep.BackwardJumpInstructions.length; idx2 < len2; ++idx2) {
+                let backJumpInstruction: RepetitionInstruction = rep.BackwardJumpInstructions[idx2];
+                if (instruction === backJumpInstruction) {
                     return true;
+                }
             }
         }
         return false;
     }
+
     public beginsWithWordRepetition(): boolean {
-        for (var idx: number = 0, len = this.FirstRepetitionInstructions.length; idx < len; ++idx) {
-            var instruction: RepetitionInstruction = this.FirstRepetitionInstructions[idx];
-            if (instruction.parentRepetition != null && instruction == instruction.parentRepetition.startMarker && instruction.parentRepetition.FromWords)
+        for (let idx: number = 0, len: number = this.FirstRepetitionInstructions.length; idx < len; ++idx) {
+            let instruction: RepetitionInstruction = this.FirstRepetitionInstructions[idx];
+            if (instruction.parentRepetition !== undefined &&
+                instruction === instruction.parentRepetition.startMarker && instruction.parentRepetition.FromWords) {
                 return true;
+            }
         }
         return false;
     }
+
     public endsWithWordRepetition(): boolean {
-        for (var idx: number = 0, len = this.LastRepetitionInstructions.length; idx < len; ++idx) {
-            var instruction: RepetitionInstruction = this.LastRepetitionInstructions[idx];
-            var rep: Repetition = instruction.parentRepetition;
-            if (rep == null)
+        for (let idx: number = 0, len: number = this.LastRepetitionInstructions.length; idx < len; ++idx) {
+            let instruction: RepetitionInstruction = this.LastRepetitionInstructions[idx];
+            let rep: Repetition = instruction.parentRepetition;
+            if (rep === undefined) {
                 continue;
-            if (!rep.FromWords)
+            }
+            if (!rep.FromWords) {
                 continue;
-            for (var idx2: number = 0, len2 = rep.BackwardJumpInstructions.length; idx2 < len2; ++idx2) {
-                var backJumpInstruction: RepetitionInstruction = rep.BackwardJumpInstructions[idx2];
-                if (instruction == backJumpInstruction)
+            }
+            for (let idx2: number = 0, len2: number = rep.BackwardJumpInstructions.length; idx2 < len2; ++idx2) {
+                let backJumpInstruction: RepetitionInstruction = rep.BackwardJumpInstructions[idx2];
+                if (instruction === backJumpInstruction) {
                     return true;
+                }
             }
-            if (instruction == rep.forwardJumpInstruction)
+            if (instruction === rep.forwardJumpInstruction) {
                 return true;
+            }
         }
         return false;
     }
+
     public getKeyInstruction(staffIndex: number): KeyInstruction {
-        if (this.FirstInstructionsStaffEntries[staffIndex] != null) {
-            var sourceStaffEntry: SourceStaffEntry = this.FirstInstructionsStaffEntries[staffIndex];
-            for (var idx: number = 0, len = sourceStaffEntry.Instructions.length; idx < len; ++idx) {
-                var abstractNotationInstruction: AbstractNotationInstruction = sourceStaffEntry.Instructions[idx];
-                if (abstractNotationInstruction instanceof KeyInstruction)
+        if (this.FirstInstructionsStaffEntries[staffIndex] !== undefined) {
+            let sourceStaffEntry: SourceStaffEntry = this.FirstInstructionsStaffEntries[staffIndex];
+            for (let idx: number = 0, len: number = sourceStaffEntry.Instructions.length; idx < len; ++idx) {
+                let abstractNotationInstruction: AbstractNotationInstruction = sourceStaffEntry.Instructions[idx];
+                if (abstractNotationInstruction instanceof KeyInstruction) {
                     return <KeyInstruction>abstractNotationInstruction;
+                }
             }
         }
-        return null;
+        return undefined;
     }
+
     private getLastSourceStaffEntryForInstrument(instrumentIndex: number): SourceStaffEntry {
         for (let i: number = this.verticalSourceStaffEntryContainers.length - 1; i >= 0; i--) {
             if (this.verticalSourceStaffEntryContainers[i][instrumentIndex] !== undefined) {

+ 4 - 4
src/MusicalScore/VoiceData/SourceStaffEntry.ts

@@ -147,8 +147,8 @@ export class SourceStaffEntry {
           if (duration > note.calculateNoteLengthWithoutTie()) {
             duration = note.calculateNoteLengthWithoutTie();
           }
-        } else if (duration > note.Length) {
-            duration = note.Length;
+        } else if (duration > note.length) {
+            duration = note.length;
         }
       }
     }
@@ -165,10 +165,10 @@ export class SourceStaffEntry {
             duration = note.calculateNoteLengthWithoutTie();
             for (let idx3: number = 0, len3: number = note.NoteTie.Fractions.length; idx3 < len3; ++idx3) {
               let fraction: Fraction = note.NoteTie.Fractions[idx3];
-              duration.Add(fraction);
+              duration.push(fraction);
             }
           }
-        } else if (duration < note.Length) { duration = note.Length; }
+        } else if (duration < note.length) { duration = note.length; }
       }
     }
     return duration;

+ 14 - 14
src/MusicalScore/VoiceData/VoiceEntry.ts

@@ -176,13 +176,13 @@ export class VoiceEntry {
                 this.createAlteratedVoiceEntry(
                     currentTimestamp, length, baseVoice, higherPitch, higherAlteration, voiceEntries
                 );
-                currentTimestamp.Add(length);
+                currentTimestamp.push(length);
                 this.createBaseVoiceEntry(currentTimestamp, length, baseVoice, baseNote, voiceEntries);
-                currentTimestamp.Add(length);
+                currentTimestamp.push(length);
                 this.createAlteratedVoiceEntry(
                     currentTimestamp, length, baseVoice, lowerPitch, lowerAlteration, voiceEntries
                 );
-                currentTimestamp.Add(length);
+                currentTimestamp.push(length);
                 this.createBaseVoiceEntry(currentTimestamp, length, baseVoice, baseNote, voiceEntries);
             }
                 break;
@@ -195,13 +195,13 @@ export class VoiceEntry {
                 this.createAlteratedVoiceEntry(
                     currentTimestamp, length, baseVoice, lowerPitch, lowerAlteration, voiceEntries
                 );
-                currentTimestamp.Add(length);
+                currentTimestamp.push(length);
                 this.createBaseVoiceEntry(currentTimestamp, length, baseVoice, baseNote, voiceEntries);
-                currentTimestamp.Add(length);
+                currentTimestamp.push(length);
                 this.createAlteratedVoiceEntry(
                     currentTimestamp, length, baseVoice, higherPitch, higherAlteration, voiceEntries
                 );
-                currentTimestamp.Add(length);
+                currentTimestamp.push(length);
                 this.createBaseVoiceEntry(currentTimestamp, length, baseVoice, baseNote, voiceEntries);
             }
                 break;
@@ -215,11 +215,11 @@ export class VoiceEntry {
                 currentTimestamp = Fraction.plus(baseTimestamp, length);
                 length.Denominator = baselength.Denominator * 8;
                 this.createAlteratedVoiceEntry(currentTimestamp, length, baseVoice, higherPitch, higherAlteration, voiceEntries);
-                currentTimestamp.Add(length);
+                currentTimestamp.push(length);
                 this.createBaseVoiceEntry(currentTimestamp, length, baseVoice, baseNote, voiceEntries);
-                currentTimestamp.Add(length);
+                currentTimestamp.push(length);
                 this.createAlteratedVoiceEntry(currentTimestamp, length, baseVoice, lowerPitch, lowerAlteration, voiceEntries);
-                currentTimestamp.Add(length);
+                currentTimestamp.push(length);
                 this.createBaseVoiceEntry(currentTimestamp, length, baseVoice, baseNote, voiceEntries);
             }
                 break;
@@ -233,11 +233,11 @@ export class VoiceEntry {
                 currentTimestamp = Fraction.plus(baseTimestamp, length);
                 length.Denominator = baselength.Denominator * 8;
                 this.createAlteratedVoiceEntry(currentTimestamp, length, baseVoice, lowerPitch, lowerAlteration, voiceEntries);
-                currentTimestamp.Add(length);
+                currentTimestamp.push(length);
                 this.createBaseVoiceEntry(currentTimestamp, length, baseVoice, baseNote, voiceEntries);
-                currentTimestamp.Add(length);
+                currentTimestamp.push(length);
                 this.createAlteratedVoiceEntry(currentTimestamp, length, baseVoice, higherPitch, higherAlteration, voiceEntries);
-                currentTimestamp.Add(length);
+                currentTimestamp.push(length);
                 this.createBaseVoiceEntry(currentTimestamp, length, baseVoice, baseNote, voiceEntries);
             }
                 break;
@@ -246,7 +246,7 @@ export class VoiceEntry {
                 let higherPitch: Pitch = baseNote.Pitch.getTransposedPitch(1);
                 let alteration: AccidentalEnum = activeKey.getAlterationForPitch(higherPitch);
                 this.createBaseVoiceEntry(currentTimestamp, length, baseVoice, baseNote, voiceEntries);
-                currentTimestamp.Add(length);
+                currentTimestamp.push(length);
                 this.createAlteratedVoiceEntry(currentTimestamp, length, baseVoice, higherPitch, alteration, voiceEntries);
                 length.Denominator = baselength.Denominator * 2;
                 currentTimestamp = Fraction.plus(baseTimestamp, length);
@@ -258,7 +258,7 @@ export class VoiceEntry {
                 let lowerPitch: Pitch = baseNote.Pitch.getTransposedPitch(-1);
                 let alteration: AccidentalEnum = activeKey.getAlterationForPitch(lowerPitch);
                 this.createBaseVoiceEntry(currentTimestamp, length, baseVoice, baseNote, voiceEntries);
-                currentTimestamp.Add(length);
+                currentTimestamp.push(length);
                 this.createAlteratedVoiceEntry(currentTimestamp, length, baseVoice, lowerPitch, alteration, voiceEntries);
                 length.Denominator = baselength.Denominator * 2;
                 currentTimestamp = Fraction.plus(baseTimestamp, length);

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff