Pārlūkot izejas kodu

Added more files and corrected some errors.
Added VexFlow classes.

Matthias 9 gadi atpakaļ
vecāks
revīzija
4ed1eaac81
25 mainītis faili ar 523 papildinājumiem un 196 dzēšanām
  1. 1 1
      src/Common/DataObjects/fraction.ts
  2. 63 0
      src/MusicalScore/Graphical/AccidentalCalculator.ts
  3. 1 1
      src/MusicalScore/Graphical/EngravingRules.ts
  4. 39 41
      src/MusicalScore/Graphical/FontInfo.ts
  5. 3 3
      src/MusicalScore/Graphical/GraphicalMusicPage.ts
  6. 3 3
      src/MusicalScore/Graphical/GraphicalMusicSheet.ts
  7. 1 1
      src/MusicalScore/Graphical/GraphicalStaffEntry.ts
  8. 150 126
      src/MusicalScore/Graphical/MusicSheetCalculator.ts
  9. 12 1
      src/MusicalScore/Graphical/OctaveShiftParams.ts
  10. 2 2
      src/MusicalScore/Graphical/StaffLine.ts
  11. 6 5
      src/MusicalScore/Graphical/StaffMeasure.ts
  12. 43 0
      src/MusicalScore/Graphical/VexFlow/VexFlowGraphicalSymbolFactory.ts
  13. 46 0
      src/MusicalScore/Graphical/VexFlow/VexFlowMeasure.ts
  14. 96 0
      src/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetCalculator.ts
  15. 24 0
      src/MusicalScore/Graphical/VexFlow/VexFlowMusicSystem.ts
  16. 6 0
      src/MusicalScore/Graphical/VexFlow/VexFlowStaffEntry.ts
  17. 6 0
      src/MusicalScore/Graphical/VexFlow/VexFlowStaffLine.ts
  18. 5 0
      src/MusicalScore/Interfaces/ITextMeasurer.ts
  19. 7 0
      src/MusicalScore/Interfaces/ITransposeCalculator.ts
  20. 1 1
      src/MusicalScore/MusicSheet.ts
  21. 1 1
      src/MusicalScore/MusicSource/Repetition.ts
  22. 1 1
      src/MusicalScore/MusicSource/SourceMusicPart.ts
  23. 1 1
      src/MusicalScore/VoiceData/ChordSymbolContainer.ts
  24. 4 7
      src/MusicalScore/VoiceData/SourceMeasure.ts
  25. 1 1
      src/MusicalScore/VoiceData/VoiceEntry.ts

+ 1 - 1
src/Common/DataObjects/fraction.ts

@@ -20,7 +20,7 @@ export class Fraction {
         return f1.Denominator === f2.Denominator && f1.Numerator === f2.Numerator;
     }
 
-    public static CreateFractionFromFraction(fraction: Fraction): Fraction {
+    public static createFromFraction(fraction: Fraction): Fraction {
         return new Fraction(fraction.numerator, fraction.denominator);
     }
 

+ 63 - 0
src/MusicalScore/Graphical/AccidentalCalculator.ts

@@ -0,0 +1,63 @@
+import {IGraphicalSymbolFactory} from "../Interfaces/IGraphicalSymbolFactory";
+import {AccidentalEnum} from "../../Common/DataObjects/pitch";
+import {KeyInstruction} from "../VoiceData/Instructions/KeyInstruction";
+import {GraphicalNote} from "./GraphicalNote";
+import {Pitch} from "../../Common/DataObjects/pitch";
+import {NoteEnum} from "../../Common/DataObjects/pitch";
+export class AccidentalCalculator {
+    private symbolFactory: IGraphicalSymbolFactory;
+    private keySignatureNoteAlterationsDict: Dictionary<number, AccidentalEnum> = new Dictionary<number, AccidentalEnum>();
+    private currentAlterationsComparedToKeyInstructionDict: List<number> = new List<number>();
+    private currentInMeasureNoteAlterationsDict: Dictionary<number, AccidentalEnum> = new Dictionary<number, AccidentalEnum>();
+    private activeKeyInstruction: KeyInstruction;
+    constructor(symbolFactory: IGraphicalSymbolFactory) {
+        this.symbolFactory = symbolFactory;
+    }
+    public get ActiveKeyInstruction(): KeyInstruction {
+        return this.activeKeyInstruction;
+    }
+    public set ActiveKeyInstruction(value: KeyInstruction) {
+        this.activeKeyInstruction = value;
+        this.reactOnKeyInstructionChange();
+    }
+    public doCalculationsAtEndOfMeasure(): void {
+        this.currentInMeasureNoteAlterationsDict.Clear();
+        var keySignatureNoteAlterationsDictArr: KeyValuePair<number, AccidentalEnum>[] = this.keySignatureNoteAlterationsDict.ToArray();
+        for (var idx: number = 0, len = keySignatureNoteAlterationsDictArr.length; idx < len; ++idx) {
+            var pair: KeyValuePair<number, AccidentalEnum> = keySignatureNoteAlterationsDictArr[idx];
+            this.currentInMeasureNoteAlterationsDict[pair.Key] = pair.Value;
+        }
+    }
+    public checkAccidental(graphicalNote: GraphicalNote, pitch: Pitch, grace: boolean, graceScalingFactor: number): void {
+        if (pitch == null)
+            return
+        var pitchKey: number = <number>pitch.FundamentalNote + pitch.Octave * 12;
+        var pitchKeyGivenInMeasureDict: boolean = this.currentInMeasureNoteAlterationsDict.ContainsKey(pitchKey);
+        if ((pitchKeyGivenInMeasureDict && this.currentInMeasureNoteAlterationsDict[pitchKey] != pitch.Accidental) || (!pitchKeyGivenInMeasureDict && pitch.Accidental != AccidentalEnum.NONE)) {
+            if (!this.currentAlterationsComparedToKeyInstructionDict.Contains(pitchKey))
+                this.currentAlterationsComparedToKeyInstructionDict.Add(pitchKey);
+            this.currentInMeasureNoteAlterationsDict[pitchKey] = pitch.Accidental;
+            this.symbolFactory.addGraphicalAccidental(graphicalNote, pitch, grace, graceScalingFactor);
+        }
+        else if (this.currentAlterationsComparedToKeyInstructionDict.Contains(pitchKey) && ((pitchKeyGivenInMeasureDict && this.currentInMeasureNoteAlterationsDict[pitchKey] != pitch.Accidental) || (!pitchKeyGivenInMeasureDict && pitch.Accidental == AccidentalEnum.NONE))) {
+            this.currentAlterationsComparedToKeyInstructionDict.Remove(pitchKey);
+            this.currentInMeasureNoteAlterationsDict[pitchKey] = pitch.Accidental;
+            this.symbolFactory.addGraphicalAccidental(graphicalNote, pitch, grace, graceScalingFactor);
+        }
+    }
+    private reactOnKeyInstructionChange(): void {
+        var noteEnums: List<NoteEnum> = KeyInstruction.getNoteEnumList(this.activeKeyInstruction);
+        var keyAccidentalType: AccidentalEnum;
+        if (this.activeKeyInstruction.Key > 0)
+            keyAccidentalType = AccidentalEnum.SHARP;
+        else keyAccidentalType = AccidentalEnum.FLAT;
+        this.keySignatureNoteAlterationsDict.Clear();
+        this.currentAlterationsComparedToKeyInstructionDict.Clear();
+        for (var octave: number = -9; octave < 9; octave++) {
+            for (var i: number = 0; i < noteEnums.Count; i++) {
+                this.keySignatureNoteAlterationsDict.Add(<number>noteEnums[i] + octave * 12, keyAccidentalType);
+            }
+        }
+        this.doCalculationsAtEndOfMeasure();
+    }
+}

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

@@ -269,7 +269,7 @@ export class EngravingRules {
         try {
             this.maxInstructionsConstValue = this.ClefLeftMargin + this.ClefRightMargin + this.KeyRightMargin + this.RhythmRightMargin;
             if (FontInfo.Info !== undefined) {
-                this.maxInstructionsConstValue += FontInfo.Info.getBoundingBox(MusicSymbol.G_CLEF).width + FontInfo.Info.getBoundingBox(MusicSymbol.FOUR).Width + 7 * FontInfo.Info.getBoundingBox(MusicSymbol.SHARP).Width;
+                this.maxInstructionsConstValue += FontInfo.Info.getBoundingBox(MusicSymbol.G_CLEF).width + FontInfo.Info.getBoundingBox(MusicSymbol.FOUR).width + 7 * FontInfo.Info.getBoundingBox(MusicSymbol.SHARP).Width;
             }
         }
         catch (ex) {

+ 39 - 41
src/MusicalScore/Graphical/FontInfo.ts

@@ -2,6 +2,7 @@
 import {SizeF2D} from "../../Common/DataObjects/SizeF2D";
 import {PointF2D} from "../../Common/DataObjects/PointF2D";
 import {BoundingBox} from "./BoundingBox";
+import {Logging} from "../../Common/logging";
 export class FontInfo {
     protected static info: FontInfo = new FontInfo();
     protected symbolMapping: Dictionary<MusicSymbol, SymbolInfo> = new Dictionary<MusicSymbol, SymbolInfo>();
@@ -43,7 +44,7 @@ export class FontInfo {
     public getCenterDistance(symbol: SymbolInfo): SizeF2D {
         let symbolBox: SizeF2D = symbol.boundingBox;
         let symbolCenter: PointF2D = symbol.center;
-        let centerDistance: SizeF2D = new SizeF2D(symbolBox.Width * symbolCenter.X, symbolBox.Height * symbolCenter.Y);
+        let centerDistance: SizeF2D = new SizeF2D(symbolBox.width * symbolCenter.x, symbolBox.height * symbolCenter.y);
         return centerDistance;
     }
     public fillPSI(psi: BoundingBox, symbol: MusicSymbol): void {
@@ -53,16 +54,16 @@ export class FontInfo {
         let symbolInfo: SymbolInfo = this.symbolMapping[symbol];
         let symbolBox: SizeF2D = symbolInfo.boundingBox;
         let symbolCenter: PointF2D = symbolInfo.center;
-        let centerDistance: SizeF2D = new SizeF2D(symbolBox.Width * symbolCenter.X, symbolBox.Height * symbolCenter.Y);
+        let centerDistance: SizeF2D = new SizeF2D(symbolBox.width * symbolCenter.x, symbolBox.height * symbolCenter.y);
         let symbolMargins: SymbolMargins = symbolInfo.margins;
-        psi.BorderLeft = -centerDistance.Width * scaleFactor;
-        psi.BorderRight = (symbolBox.Width - centerDistance.Width) * scaleFactor;
-        psi.BorderTop = -centerDistance.Height * scaleFactor;
-        psi.BorderBottom = (symbolBox.Height - centerDistance.Height) * scaleFactor;
-        psi.BorderMarginLeft = (-centerDistance.Width - symbolBox.Width * symbolMargins.left) * scaleFactor;
-        psi.BorderMarginRight = (symbolBox.Width - centerDistance.Width + symbolBox.Width * symbolMargins.right) * scaleFactor;
-        psi.BorderMarginTop = (-centerDistance.Height - symbolBox.Height * symbolMargins.top) * scaleFactor;
-        psi.BorderMarginBottom = (symbolBox.Height - centerDistance.Height + symbolBox.Height * symbolMargins.bottom) * scaleFactor;
+        psi.BorderLeft = -centerDistance.width * scaleFactor;
+        psi.BorderRight = (symbolBox.width - centerDistance.width) * scaleFactor;
+        psi.BorderTop = -centerDistance.height * scaleFactor;
+        psi.BorderBottom = (symbolBox.height - centerDistance.height) * scaleFactor;
+        psi.BorderMarginLeft = (-centerDistance.width - symbolBox.width * symbolMargins.left) * scaleFactor;
+        psi.BorderMarginRight = (symbolBox.width - centerDistance.width + symbolBox.width * symbolMargins.right) * scaleFactor;
+        psi.BorderMarginTop = (-centerDistance.height - symbolBox.height * symbolMargins.top) * scaleFactor;
+        psi.BorderMarginBottom = (symbolBox.height - centerDistance.height + symbolBox.height * symbolMargins.bottom) * scaleFactor;
     }
     protected getString(symbol: MusicSymbol): string {
         try {
@@ -80,40 +81,38 @@ export class FontInfo {
         }
         catch (ex) {
             Logging.debug("FontInfo.getScaleFactor", ex);
-            return -1F;
+            return -1;
         }
 
     }
     private createSymbols(): void {
-        let scaleVector: number[] = 1,1, 3, 3, 3,
+        let scaleVector: number[] = [1,1, 3, 3, 3,
             3, 3, 3, 3,
             3, 1, 1, 7,
-                3.5, 4, 1, 1,
-                    2.0, 3.4,
-                        0.6, 0.6, 3, 2,
-                            3, 4, 5,
-                            2.2, 2.55, 2.5, 2.2, 1,
-                                2, 2, 2, 2,
-                                2, 2, 2, 2,
-                                2, 2, 0.4,
-                                    1, 1,
-                                    1, 0.2, 1, 1.5, 1.5,
-                                        0.75 * 2,
-                                            0.75 * 3,
-                                                0.75 * (1 + 1865.0 / 2680.0),
-        0.75 * (1 + 1865.0 / 2680.0),
-        0.75 * (1 + 1865.0 / 2680.0),
-        0.75 * (1 + 1865.0 / 2680.0),
-        2.7, 3.0,
+            3.5, 4, 1, 1,
+            2.0, 3.4,
+            0.6, 0.6, 3, 2,
+            3, 4, 5,
+            2.2, 2.55, 2.5, 2.2, 1,
+            2, 2, 2, 2,
+            2, 2, 2, 2,
+            2, 2, 0.4,
+            1, 1,
+            1, 0.2, 1, 1.5, 1.5,
+            0.75 * 2,
+            0.75 * 3,
+            0.75 * (1 + 1865.0 / 2680.0),
+            0.75 * (1 + 1865.0 / 2680.0),
+            0.75 * (1 + 1865.0 / 2680.0),
+            0.75 * (1 + 1865.0 / 2680.0),
+            2.7, 3.0,
             2, 7.987, 7.987, 7.987, 7.987,
-                4.228, 4.228, 4.228, 4.228,
-                    1.25, 0.75, 1.05, 0.85, 1.05,
-                        1.1, 2, 1.9,
-                            1.2, 1.2, 1.35, 1.2, 1.2,
-                                1, 1.7, 1.8,
-                                    1.09, 0.77,
-                                        3.0;
-        let centerVector: PointF2D[] = new PointF2D(0.5, 0.5),
+            4.228, 4.228, 4.228, 4.228,
+            1.25, 0.75, 1.05, 0.85, 1.05,
+            1.1, 2, 1.9,
+            1.2, 1.2, 1.35, 1.2, 1.2,
+            1, 1.7, 1.8, 1.09, 0.77, 3.0];
+        let centerVector: PointF2D[] = [new PointF2D(0.5, 0.5),
         new PointF2D(0.5, 0.5),
             new PointF2D(0.0, 1.0),
             new PointF2D(0.0, 0.0),
@@ -197,8 +196,8 @@ export class FontInfo {
             new PointF2D(0.5, 0.5),
             new PointF2D(0.5, 0.634),
             new PointF2D(0.5, 0.5),
-            new PointF2D(0.5, 0.5);
-        let marginVector: SymbolMargins[] = new SymbolMargins(0.1, 0.1, 0.1, 0.1),
+            new PointF2D(0.5, 0.5)];
+        let marginVector: SymbolMargins[] = [new SymbolMargins(0.1, 0.1, 0.1, 0.1),
         new SymbolMargins(0.1, 0.1),
             new SymbolMargins(0.1, 0.1),
             new SymbolMargins(0.1, 0.1),
@@ -282,7 +281,7 @@ export class FontInfo {
             new SymbolMargins(0.1, 0.1, 0.1, 0.1),
             new SymbolMargins(0.1, 0.1, 0.1, 0.1),
             new SymbolMargins(0.1, 0.1, 0.1, 0.1),
-            new SymbolMargins(0.1, 0.1, 0.1, 0.1);
+            new SymbolMargins(0.1, 0.1, 0.1, 0.1)];
         let values: Array = Enum.GetValues(/*typeof*/MusicSymbol);
         let i: number = 0;
         for (let c: string = <string>0x21; c <<string>0x21 + values.Length; c++) {
@@ -300,7 +299,6 @@ export class SymbolInfo {
     public center: PointF2D;
     public margins: SymbolMargins;
     constructor(symbol: string, id: number, scaleFactor: number, center: PointF2D, margins: SymbolMargins) {
-        this();
         this.symbol = symbol;
         this.id = id;
         this.scaleFactor = scaleFactor;

+ 3 - 3
src/MusicalScore/Graphical/GraphicalMusicPage.ts

@@ -35,7 +35,7 @@ export class GraphicalMusicPage extends GraphicalObject {
         if (rules.PagePlacement === PagePlacementEnum.Down)
             return new PointF2D(0.0, pageIndex * rules.PageHeight);
         else if (rules.PagePlacement === PagePlacementEnum.Right)
-            return new PointF2D(pageIndex * this.parent.ParentMusicSheet.PageWidth, 0.0);
+            return new PointF2D(pageIndex * this.parent.ParentMusicSheet.pageWidth, 0.0);
         else {
             if (pageIndex % 2 === 0) {
                 if (pageIndex === 0)
@@ -43,8 +43,8 @@ export class GraphicalMusicPage extends GraphicalObject {
                 else return new PointF2D(0.0, (pageIndex - 1) * rules.PageHeight);
             } else {
                 if (pageIndex === 1)
-                    return new PointF2D(this.parent.ParentMusicSheet.PageWidth, (pageIndex - 1) * rules.PageHeight);
-                else return new PointF2D(this.parent.ParentMusicSheet.PageWidth, (pageIndex - 2) * rules.PageHeight);
+                    return new PointF2D(this.parent.ParentMusicSheet.pageWidth, (pageIndex - 1) * rules.PageHeight);
+                else return new PointF2D(this.parent.ParentMusicSheet.pageWidth, (pageIndex - 2) * rules.PageHeight);
             }
         }
     }

+ 3 - 3
src/MusicalScore/Graphical/GraphicalMusicSheet.ts

@@ -393,7 +393,7 @@ export class GraphicalMusicSheet {
         }
         for (let idx: number = 0, len: number = visibleInstruments.length; idx < len; ++idx) {
             let instrument: Instrument = visibleInstruments[idx];
-            let index: number = this.musicSheet.GetGlobalStaffIndexOfFirstStaff(instrument);
+            let index: number = this.musicSheet.getGlobalStaffIndexOfFirstStaff(instrument);
             for (let j: number = 0; j < instrument.Staves.length; j++) {
                 visibleStavesIndeces.push(index + j);
             }
@@ -510,10 +510,10 @@ export class GraphicalMusicSheet {
         for (let idx: number = 0, len: number = this.MusicPages.length; idx < len; ++idx) {
             let graphicalMusicPage: GraphicalMusicPage = this.MusicPages[idx];
             let entries: GraphicalStaffEntry[] = graphicalMusicPage.PositionAndShape.getObjectsInRegion<GraphicalStaffEntry>(region, false);
-            if (entries === undefined || entries.length() === 0) {
+            if (entries === undefined || entries.length === 0) {
                 continue;
             } else {
-                for (let idx2: number = 0, len2: number = entries.length(); idx2 < len2; ++idx2) {
+                for (let idx2: number = 0, len2: number = entries.length; idx2 < len2; ++idx2) {
                     let gse: GraphicalStaffEntry = entries[idx2];
                     foundEntries.push(gse);
                 }

+ 1 - 1
src/MusicalScore/Graphical/GraphicalStaffEntry.ts

@@ -53,7 +53,7 @@ export class GraphicalStaffEntry extends GraphicalObject {
         return this.lyricsEntries;
     }
     public getAbsoluteTimestamp(): Fraction {
-        let result: Fraction = Fraction.CreateFractionFromFraction(this.ParentMeasure.ParentSourceMeasure.AbsoluteTimestamp);
+        let result: Fraction = Fraction.createFromFraction(this.ParentMeasure.ParentSourceMeasure.AbsoluteTimestamp);
         if (this.RelInMeasureTimestamp !== undefined)
             result += this.RelInMeasureTimestamp;
         return result;

+ 150 - 126
src/MusicalScore/Graphical/MusicSheetCalculator.ts

@@ -41,6 +41,14 @@ import {TechnicalInstruction} from "../VoiceData/Instructions/TechnicalInstructi
 import {Pitch} from "../../Common/DataObjects/pitch";
 import {LinkedVoice} from "../VoiceData/LinkedVoice";
 import {ColDirEnum} from "./BoundingBox";
+import {IGraphicalSymbolFactory} from "../Interfaces/IGraphicalSymbolFactory";
+import {ITextMeasurer} from "../Interfaces/ITextMeasurer";
+import {ITransposeCalculator} from "../Interfaces/ITransposeCalculator";
+import {OctaveShiftParams} from "./OctaveShiftParams";
+import {AccidentalCalculator} from "./AccidentalCalculator";
+import {MidiInstrument} from "../VoiceData/Instructions/ClefInstruction";
+import {Staff} from "../VoiceData/Staff";
+import {OctaveShift} from "../VoiceData/Expressions/ContinuousExpressions/octaveShift";
 export class MusicSheetCalculator {
     public static TransposeCalculator: ITransposeCalculator;
     protected static textMeasurer: ITextMeasurer;
@@ -78,12 +86,12 @@ export class MusicSheetCalculator {
     }
     public initialize(graphicalMusicSheet: GraphicalMusicSheet): void {
         this.graphicalMusicSheet = graphicalMusicSheet;
-        this.rules = graphicalMusicSheet.ParentMusicSheet.Rules;
+        this.rules = graphicalMusicSheet.ParentMusicSheet.rules;
         this.prepareGraphicalMusicSheet();
         this.calculate();
     }
     public prepareGraphicalMusicSheet(): void {
-        this.graphicalMusicSheet.SystemImages = [];
+        this.graphicalMusicSheet.SystemImages.length = 0;
         let musicSheet: MusicSheet = this.graphicalMusicSheet.ParentMusicSheet;
         this.staffEntriesWithGraphicalTies = [];
         this.staffEntriesWithOrnaments = [];
@@ -132,7 +140,7 @@ export class MusicSheetCalculator {
         let maxLength: number = 0;
         let maxInstructionsLength: number = this.rules.MaxInstructionsConstValue;
         if (this.graphicalMusicSheet.MeasureList.length > 0) {
-            maxLength = calculateMeasureXLayout(this.graphicalMusicSheet.MeasureList[0]) * 1.2 + maxInstrNameLabelLength + maxInstructionsLength;
+            maxLength = this.calculateMeasureXLayout(this.graphicalMusicSheet.MeasureList[0]) * 1.2 + maxInstrNameLabelLength + maxInstructionsLength;
             for (let i: number = 1; i < this.graphicalMusicSheet.MeasureList.length; i++) {
                 let measures: StaffMeasure[] = this.graphicalMusicSheet.MeasureList[i];
                 maxLength = Math.max(maxLength, this.calculateMeasureXLayout(measures) * 1.2 + maxInstructionsLength);
@@ -177,91 +185,105 @@ export class MusicSheetCalculator {
 
     }
     protected calculateMusicSystems(): void {
-        if (this.graphicalMusicSheet.MeasureList !== undefined) {
-            let measureList: StaffMeasure[][] = this.graphicalMusicSheet.MeasureList.Select(ml => ml.Where(m => m.isVisible()).ToList()).ToList();
-            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 (this.graphicalMusicSheet.MeasureList === undefined) return;
+        
+        let allMeasures: StaffMeasure[][] = this.graphicalMusicSheet.MeasureList;
+        if (allMeasures == null)
+            return;
+        let visibleMeasureList: StaffMeasure[][] = [];
+        for (var idx: number = 0, len = allMeasures.length; idx < len; ++idx) {
+            let staffMeasures: StaffMeasure[] = allMeasures[idx];
+            let visibleStaffMeasures: StaffMeasure[] = [];
+            for (var idx2: number = 0, len2 = staffMeasures.length; idx2 < len2; ++idx2) {
+                let staffMeasure: StaffMeasure = allMeasures[idx][idx2];
+                if (staffMeasure.isVisible())
+                    visibleStaffMeasures.push(staffMeasure);
             }
-            if (numberOfStaffLines === 0)
-                return;
-            let musicSystemBuilder: MusicSystemBuilder = new MusicSystemBuilder();
-            musicSystemBuilder.initialize(this.graphicalMusicSheet, measureList, numberOfStaffLines, this.symbolFactory);
-            musicSystemBuilder.buildMusicSystems();
-            this.checkMeasuresForWholeRestNotes();
-            if (!this.leadSheet) {
-                this.calculateBeams();
-                this.optimizeRestPlacement();
-                this.calculateStaffEntryArticulationMarks();
-                this.calculateTieCurves();
+            visibleMeasureList.push(visibleStaffMeasures);
+        }
+
+        let numberOfStaffLines: number = 0;
+        for (let idx: number = 0, len: number = visibleMeasureList.length; idx < len; ++idx) {
+            let gmlist: StaffMeasure[] = visibleMeasureList[idx];
+            numberOfStaffLines = Math.max(gmlist.length, numberOfStaffLines);
+            break;
+        }
+        if (numberOfStaffLines === 0)
+            return;
+        let musicSystemBuilder: MusicSystemBuilder = new MusicSystemBuilder();
+        musicSystemBuilder.initialize(this.graphicalMusicSheet, visibleMeasureList, numberOfStaffLines, this.symbolFactory);
+        musicSystemBuilder.buildMusicSystems();
+        this.checkMeasuresForWholeRestNotes();
+        if (!this.leadSheet) {
+            this.calculateBeams();
+            this.optimizeRestPlacement();
+            this.calculateStaffEntryArticulationMarks();
+            this.calculateTieCurves();
+        }
+        this.calculateSkyBottomLines();
+        this.calculateTupletNumbers();
+        for (let idx: number = 0, len: number = this.graphicalMusicSheet.MusicPages.length; idx < len; ++idx) {
+            let graphicalMusicPage: GraphicalMusicPage = this.graphicalMusicSheet.MusicPages[idx];
+            for (let idx2: number = 0, len2: number = graphicalMusicPage.MusicSystems.length; idx2 < len2; ++idx2) {
+                let musicSystem: MusicSystem = graphicalMusicPage.MusicSystems[idx2];
+                this.calculateMeasureNumberPlacement(musicSystem);
             }
-            this.calculateSkyBottomLines();
-            this.calculateTupletNumbers();
-            for (let idx: number = 0, len: number = this.graphicalMusicSheet.MusicPages.length; idx < len; ++idx) {
-                let graphicalMusicPage: GraphicalMusicPage = this.graphicalMusicSheet.MusicPages[idx];
-                for (let idx2: number = 0, len2: number = graphicalMusicPage.MusicSystems.length; idx2 < len2; ++idx2) {
-                    let musicSystem: MusicSystem = graphicalMusicPage.MusicSystems[idx2];
-                    this.calculateMeasureNumberPlacement(musicSystem);
+        }
+        if (!this.leadSheet)
+            this.calculateSlurs();
+        if (!this.leadSheet)
+            this.calculateOrnaments();
+        this.updateSkyBottomLines();
+        this.calculateChordSymbols();
+        if (!this.leadSheet) {
+            this.calculateDynamicExpressions();
+            this.optimizeStaffLineDynamicExpressionsPositions();
+            this.calculateMoodAndUnknownExpressions();
+            this.calculateOctaveShifts();
+            this.calculateWordRepetitionInstructions();
+        }
+        this.calculateRepetitionEndings();
+        if (!this.leadSheet)
+            this.calculateTempoExpressions();
+        this.calculateLyricsPosition();
+        for (let idx: number = 0, len: number = this.graphicalMusicSheet.MusicPages.length; idx < len; ++idx) {
+            let graphicalMusicPage: GraphicalMusicPage = this.graphicalMusicSheet.MusicPages[idx];
+            for (let idx2: number = 0, len2: number = graphicalMusicPage.MusicSystems.length; idx2 < len2; ++idx2) {
+                let musicSystem: MusicSystem = graphicalMusicPage.MusicSystems[idx2];
+                for (let idx3: number = 0, len3: number = musicSystem.StaffLines.length; idx3 < len3; ++idx3) {
+                    let staffLine: StaffLine = musicSystem.StaffLines[idx3];
+                    this.updateStaffLineBorders(staffLine);
                 }
             }
-            if (!this.leadSheet)
-                this.calculateSlurs();
-            if (!this.leadSheet)
-                this.calculateOrnaments();
-            this.updateSkyBottomLines();
-            this.calculateChordSymbols();
-            if (!this.leadSheet) {
-                this.calculateDynamicExpressions();
-                this.optimizeStaffLineDynamicExpressionsPositions();
-                this.calculateMoodAndUnknownExpressions();
-                this.calculateOctaveShifts();
-                this.calculateWordRepetitionInstructions();
-            }
-            this.calculateRepetitionEndings();
-            if (!this.leadSheet)
-                this.calculateTempoExpressions();
-            this.calculateLyricsPosition();
-            for (let idx: number = 0, len: number = this.graphicalMusicSheet.MusicPages.length; idx < len; ++idx) {
-                let graphicalMusicPage: GraphicalMusicPage = this.graphicalMusicSheet.MusicPages[idx];
-                for (let idx2: number = 0, len2: number = graphicalMusicPage.MusicSystems.length; idx2 < len2; ++idx2) {
-                    let musicSystem: MusicSystem = graphicalMusicPage.MusicSystems[idx2];
-                    for (let idx3: number = 0, len3: number = musicSystem.StaffLines.length; idx3 < len3; ++idx3) {
-                        let staffLine: StaffLine = musicSystem.StaffLines[idx3];
-                        this.updateStaffLineBorders(staffLine);
-                    }
+        }
+        this.calculateComments();
+        this.calculateSystemYLayout();
+        this.calculateMarkedAreas();
+        for (let idx: number = 0, len: number = this.graphicalMusicSheet.MusicPages.length; idx < len; ++idx) {
+            let graphicalMusicPage: GraphicalMusicPage = this.graphicalMusicSheet.MusicPages[idx];
+            for (let idx2: number = 0, len2: number = graphicalMusicPage.MusicSystems.length; idx2 < len2; ++idx2) {
+                let musicSystem: MusicSystem = graphicalMusicPage.MusicSystems[idx2];
+                musicSystem.setMusicSystemLabelsYPosition();
+                if (!this.leadSheet) {
+                    musicSystem.setYPositionsToVerticalLineObjectsAndCreateLines(this.rules);
+                    musicSystem.createSystemLeftVerticalLineObject(this.rules.SystemThinLineWidth, this.rules.SystemLabelsRightMargin);
+                    musicSystem.createInstrumentBrackets(this.graphicalMusicSheet.ParentMusicSheet.Instruments, this.rules.StaffHeight);
+                    musicSystem.createGroupBrackets(this.graphicalMusicSheet.ParentMusicSheet.InstrumentalGroups, this.rules.StaffHeight, 0);
+                    musicSystem.alignBeginInstructions();
+                } else if (musicSystem === musicSystem.Parent.MusicSystems[0]) {
+                    musicSystem.createSystemLeftVerticalLineObject(this.rules.SystemThinLineWidth, this.rules.SystemLabelsRightMargin);
                 }
+                musicSystem.calculateBorders(this.rules);
             }
-            this.calculateComments();
-            this.calculateSystemYLayout();
-            this.calculateMarkedAreas();
-            for (let idx: number = 0, len: number = this.graphicalMusicSheet.MusicPages.length; idx < len; ++idx) {
-                let graphicalMusicPage: GraphicalMusicPage = this.graphicalMusicSheet.MusicPages[idx];
-                for (let idx2: number = 0, len2: number = graphicalMusicPage.MusicSystems.length; idx2 < len2; ++idx2) {
-                    let musicSystem: MusicSystem = graphicalMusicPage.MusicSystems[idx2];
-                    musicSystem.setMusicSystemLabelsYPosition();
-                    if (!this.leadSheet) {
-                        musicSystem.setYPositionsToVerticalLineObjectsAndCreateLines(this.rules);
-                        musicSystem.createSystemLeftVerticalLineObject(this.rules.SystemThinLineWidth, this.rules.SystemLabelsRightMargin);
-                        musicSystem.createInstrumentBrackets(this.graphicalMusicSheet.ParentMusicSheet.Instruments, this.rules.StaffHeight);
-                        musicSystem.createGroupBrackets(this.graphicalMusicSheet.ParentMusicSheet.InstrumentalGroups, this.rules.StaffHeight, 0);
-                        musicSystem.alignBeginInstructions();
-                    } else if (musicSystem === musicSystem.Parent.MusicSystems[0]) {
-                        musicSystem.createSystemLeftVerticalLineObject(this.rules.SystemThinLineWidth, this.rules.SystemLabelsRightMargin);
-                    }
-                    musicSystem.calculateBorders(this.rules);
-                }
-                let distance: number = graphicalMusicPage.MusicSystems[0].PositionAndShape.BorderTop;
-                for (let idx2: number = 0, len2: number = graphicalMusicPage.MusicSystems.length; idx2 < len2; ++idx2) {
-                    let musicSystem: MusicSystem = graphicalMusicPage.MusicSystems[idx2];
-                    let newPosition: PointF2D = new PointF2D(musicSystem.PositionAndShape.RelativePosition.X, musicSystem.PositionAndShape.RelativePosition.Y - distance);
-                    musicSystem.PositionAndShape.RelativePosition = newPosition;
-                }
-                if (graphicalMusicPage === this.graphicalMusicSheet.MusicPages[0])
-                    this.calculatePageLabels(graphicalMusicPage);
-                graphicalMusicPage.PositionAndShape.calculateTopBottomBorders();
+            let distance: number = graphicalMusicPage.MusicSystems[0].PositionAndShape.BorderTop;
+            for (let idx2: number = 0, len2: number = graphicalMusicPage.MusicSystems.length; idx2 < len2; ++idx2) {
+                let musicSystem: MusicSystem = graphicalMusicPage.MusicSystems[idx2];
+                let newPosition: PointF2D = new PointF2D(musicSystem.PositionAndShape.RelativePosition.x, musicSystem.PositionAndShape.RelativePosition.y - distance);
+                musicSystem.PositionAndShape.RelativePosition = newPosition;
             }
+            if (graphicalMusicPage === this.graphicalMusicSheet.MusicPages[0])
+                this.calculatePageLabels(graphicalMusicPage);
+            graphicalMusicPage.PositionAndShape.calculateTopBottomBorders();
         }
     }
     protected updateSkyBottomLine(staffLine: StaffLine): void {
@@ -385,9 +407,9 @@ export class MusicSheetCalculator {
             graphicalNote.PositionAndShape.calculateBoundingBox();
             if (!this.leadSheet) {
                 if (note.NoteBeam !== undefined)
-                    handleBeam(graphicalNote, note.NoteBeam, openBeams);
+                    this.handleBeam(graphicalNote, note.NoteBeam, openBeams);
                 if (note.NoteTuplet !== undefined)
-                    handleTuplet(graphicalNote, note.NoteTuplet, openTuplets);
+                    this.handleTuplet(graphicalNote, note.NoteTuplet, openTuplets);
             }
         }
         if (voiceEntry.Articulations.length > 0)
@@ -469,16 +491,18 @@ export class MusicSheetCalculator {
     }
     protected resetYPositionForLeadSheet(psi: BoundingBox): void {
         if (this.leadSheet) {
-            psi.RelativePosition = new PointF2D(psi.RelativePosition.X, 0.0);
+            psi.RelativePosition = new PointF2D(psi.RelativePosition.x, 0.0);
         }
     }
     protected layoutVoiceEntries(graphicalStaffEntry: GraphicalStaffEntry): void {
         graphicalStaffEntry.PositionAndShape.RelativePosition = new PointF2D(0.0, 0.0);
         let isGraceStaffEntry: boolean = graphicalStaffEntry.StaffEntryParent !== undefined;
         if (!this.leadSheet) {
-            let graphicalStaffEntryNotes: GraphicalNote[][] = graphicalStaffEntry.Notes.Where(n => n.length > 0);
+            let graphicalStaffEntryNotes: GraphicalNote[][] = graphicalStaffEntry.Notes;
             for (let idx4: number = 0, len4: number = graphicalStaffEntryNotes.length; idx4 < len4; ++idx4) {
                 let graphicalNotes: GraphicalNote[] = graphicalStaffEntryNotes[idx4];
+                if (graphicalNotes.length === 0)
+                    continue;
                 let voiceEntry: VoiceEntry = graphicalNotes[0].SourceNote.ParentVoiceEntry;
                 let hasPitchedNote: boolean = graphicalNotes[0].SourceNote.Pitch !== undefined;
                 this.layoutVoiceEntry(voiceEntry, graphicalNotes, graphicalStaffEntry, hasPitchedNote, isGraceStaffEntry);
@@ -492,7 +516,7 @@ export class MusicSheetCalculator {
             let instrument: Instrument = instrumentsArr[idx];
             let graphicalLabel: GraphicalLabel = new GraphicalLabel(instrument.NameLabel, this.rules.InstrumentLabelTextHeight, TextAlignment.LeftCenter);
             graphicalLabel.setLabelPositionAndShapeBorders();
-            maxLabelLength = Math.max(maxLabelLength, graphicalLabel.PositionAndShape.MarginSize.Width);
+            maxLabelLength = Math.max(maxLabelLength, graphicalLabel.PositionAndShape.MarginSize.width);
         }
         return maxLabelLength;
     }
@@ -589,19 +613,19 @@ export class MusicSheetCalculator {
         let numEntries: number = this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length;
         let index: number = this.graphicalMusicSheet.GetInterpolatedIndexInVerticalContainers(timestamp);
         let leftIndex: number = <number>Math.min(Math.floor(index), numEntries - 1);
-        let rightIndex: number = <number>Math.min(Math.ceiling(index), numEntries - 1);
+        let rightIndex: number = <number>Math.min(Math.ceil(index), numEntries - 1);
         if (leftIndex < 0 || verticalIndex < 0)
             return relative;
         leftStaffEntry = this.getFirstLeftNotNullStaffEntryFromContainer(leftIndex, verticalIndex, multiStaffInstrument);
         rightStaffEntry = this.getFirstRightNotNullStaffEntryFromContainer(rightIndex, verticalIndex, multiStaffInstrument);
         if (leftStaffEntry !== undefined && rightStaffEntry !== undefined) {
-            let measureRelativeX: number = leftStaffEntry.ParentMeasure.PositionAndShape.RelativePosition.X;
+            let measureRelativeX: number = leftStaffEntry.ParentMeasure.PositionAndShape.RelativePosition.x;
             if (firstVisibleMeasureRelativeX > 0)
                 measureRelativeX = firstVisibleMeasureRelativeX;
-            let leftX: number = leftStaffEntry.PositionAndShape.RelativePosition.X + measureRelativeX;
-            let rightX: number = rightStaffEntry.PositionAndShape.RelativePosition.X + rightStaffEntry.ParentMeasure.PositionAndShape.RelativePosition.X;
+            let leftX: number = leftStaffEntry.PositionAndShape.RelativePosition.x + measureRelativeX;
+            let rightX: number = rightStaffEntry.PositionAndShape.RelativePosition.x + rightStaffEntry.ParentMeasure.PositionAndShape.RelativePosition.x;
             if (firstVisibleMeasureRelativeX > 0)
-                rightX = rightStaffEntry.PositionAndShape.RelativePosition.X + measureRelativeX;
+                rightX = rightStaffEntry.PositionAndShape.RelativePosition.x + measureRelativeX;
             let timestampQuotient: number = 0.0;
             if (leftStaffEntry !== rightStaffEntry) {
                 let leftTimestamp: Fraction = leftStaffEntry.getAbsoluteTimestamp();
@@ -611,8 +635,8 @@ export class MusicSheetCalculator {
             }
             if (leftStaffEntry.ParentMeasure.ParentStaffLine !== rightStaffEntry.ParentMeasure.ParentStaffLine) {
                 if (leftStaffEntry.ParentMeasure.ParentStaffLine === staffLine)
-                    rightX = staffLine.PositionAndShape.Size.Width;
-                else leftX = staffLine.PositionAndShape.RelativePosition.X;
+                    rightX = staffLine.PositionAndShape.Size.width;
+                else leftX = staffLine.PositionAndShape.RelativePosition.x;
             }
             relative = new PointF2D(leftX + (rightX - leftX) * timestampQuotient, 0.0);
         }
@@ -621,9 +645,9 @@ export class MusicSheetCalculator {
     protected getRelativeXPositionFromTimestamp(timestamp: Fraction): number {
         let numEntries: number = this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length;
         let index: number = this.graphicalMusicSheet.GetInterpolatedIndexInVerticalContainers(timestamp);
-        let discreteIndex: number = <number>Math.max(0, Math.min(Math.Round(index), numEntries - 1));
+        let discreteIndex: number = <number>Math.max(0, Math.min(Math.round(index), numEntries - 1));
         let gse: GraphicalStaffEntry = this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[discreteIndex].getFirstNonNullStaffEntry();
-        let posX: number = gse.PositionAndShape.RelativePosition.X + gse.ParentMeasure.PositionAndShape.RelativePosition.X;
+        let posX: number = gse.PositionAndShape.RelativePosition.x + gse.ParentMeasure.PositionAndShape.RelativePosition.x;
         return posX;
     }
     private createAccidentalCalculators(): AccidentalCalculator[] {
@@ -676,7 +700,7 @@ export class MusicSheetCalculator {
         let openTuplets: Tuplet[] = [];
         let staffEntryLinks: StaffEntryLink[] = [];
         for (let staffIndex: number = 0; staffIndex < sourceMeasure.CompleteNumberOfStaves; staffIndex++) {
-            let measure: StaffMeasure = createGraphicalMeasure(sourceMeasure, tieTimestampListDictList[staffIndex], openTuplets, openBeams, accidentalCalculators[staffIndex], activeClefs, openOctaveShifts, openLyricWords, staffIndex, staffEntryLinks);
+            let measure: StaffMeasure = this.createGraphicalMeasure(sourceMeasure, tieTimestampListDictList[staffIndex], openTuplets, openBeams, accidentalCalculators[staffIndex], activeClefs, openOctaveShifts, openLyricWords, staffIndex, staffEntryLinks);
             verticalMeasureList.push(measure);
         }
         this.graphicalMusicSheet.SourceToGraphicalMeasureLinks[sourceMeasure] = verticalMeasureList;
@@ -734,17 +758,17 @@ export class MusicSheetCalculator {
                 }
                 for (let idx: number = 0, len: number = sourceStaffEntry.VoiceEntries.length; idx < len; ++idx) {
                     let voiceEntry: VoiceEntry = sourceStaffEntry.VoiceEntries[idx];
-                    handleVoiceEntryGraceNotes(voiceEntry.GraceVoiceEntriesBefore, graphicalStaffEntry.GraceStaffEntriesBefore, graphicalStaffEntry, accidentalCalculator, activeClefs[staffIndex], octaveShiftValue, openLyricWords,
+                    this.handleVoiceEntryGraceNotes(voiceEntry.graceVoiceEntriesBefore, graphicalStaffEntry.GraceStaffEntriesBefore, graphicalStaffEntry, accidentalCalculator, activeClefs[staffIndex], octaveShiftValue, openLyricWords,
                         tieTimestampListDict,
                         openTuplets,
                         openBeams);
-                    octaveShiftValue = handleVoiceEntry(voiceEntry, graphicalStaffEntry,
+                    octaveShiftValue = this.handleVoiceEntry(voiceEntry, graphicalStaffEntry,
                         accidentalCalculator, openLyricWords,
                         tieTimestampListDict,
                         activeClefs[staffIndex], openTuplets,
                         openBeams, octaveShiftValue, false, linkedNotes,
                         sourceStaffEntry);
-                    handleVoiceEntryGraceNotes(voiceEntry.GraceVoiceEntriesAfter, graphicalStaffEntry.GraceStaffEntriesAfter, graphicalStaffEntry, accidentalCalculator, activeClefs[staffIndex], octaveShiftValue, openLyricWords,
+                    this.handleVoiceEntryGraceNotes(voiceEntry.graceVoiceEntriesAfter, graphicalStaffEntry.GraceStaffEntriesAfter, graphicalStaffEntry, accidentalCalculator, activeClefs[staffIndex], octaveShiftValue, openLyricWords,
                         tieTimestampListDict,
                         openTuplets,
                         openBeams);
@@ -760,10 +784,10 @@ export class MusicSheetCalculator {
             }
         }
         if (tieTimestampListDict.length > 0) {
-            handleOpenTies(measure, openBeams,
+            this.handleOpenTies(measure, openBeams,
                 tieTimestampListDict, activeClefs[staffIndex], openOctaveShifts[staffIndex]);
         }
-        accidentalCalculator.DoCalculationsAtEndOfMeasure();
+        accidentalCalculator.doCalculationsAtEndOfMeasure();
         if (sourceMeasure.LastInstructionsStaffEntries[staffIndex] !== undefined) {
             let lastStaffEntry: SourceStaffEntry = sourceMeasure.LastInstructionsStaffEntries[staffIndex];
             for (let idx: number = 0, len: number = lastStaffEntry.Instructions.length; idx < len; ++idx) {
@@ -780,7 +804,7 @@ export class MusicSheetCalculator {
         }
         if (measure.StaffEntries.length === 0) {
             let sourceStaffEntry: SourceStaffEntry = new SourceStaffEntry(undefined, staff);
-            let note: Note = new Note(undefined, sourceStaffEntry, new Fraction(sourceMeasure.Duration), undefined);
+            let note: Note = new Note(undefined, sourceStaffEntry, Fraction.createFromFraction(sourceMeasure.Duration), undefined);
             let graphicalStaffEntry: GraphicalStaffEntry = this.symbolFactory.createStaffEntry(sourceStaffEntry, measure);
             measure.addGraphicalStaffEntry(graphicalStaffEntry);
             graphicalStaffEntry.RelInMeasureTimestamp = new Fraction(0, 1);
@@ -798,14 +822,14 @@ export class MusicSheetCalculator {
         let firstSystemAbsoluteTopMargin: number = 10;
         if (page.MusicSystems.length > 0) {
             let firstMusicSystem: MusicSystem = page.MusicSystems[0];
-            firstSystemAbsoluteTopMargin = firstMusicSystem.PositionAndShape.RelativePosition.Y + firstMusicSystem.PositionAndShape.BorderTop;
+            firstSystemAbsoluteTopMargin = firstMusicSystem.PositionAndShape.RelativePosition.y + firstMusicSystem.PositionAndShape.BorderTop;
         }
         if (this.graphicalMusicSheet.Title !== undefined) {
             let title: GraphicalLabel = this.graphicalMusicSheet.Title;
             title.PositionAndShape.Parent = page.PositionAndShape;
             page.PositionAndShape.ChildElements.push(title.PositionAndShape);
-            relative.X = this.graphicalMusicSheet.ParentMusicSheet.PageWidth / 2;
-            relative.Y = this.rules.TitleTopDistance + this.rules.SheetTitleHeight;
+            relative.x = this.graphicalMusicSheet.ParentMusicSheet.pageWidth / 2;
+            relative.y = this.rules.TitleTopDistance + this.rules.SheetTitleHeight;
             title.PositionAndShape.RelativePosition = relative;
             page.Labels.push(title);
         }
@@ -813,8 +837,8 @@ export class MusicSheetCalculator {
             let subtitle: GraphicalLabel = this.graphicalMusicSheet.Subtitle;
             subtitle.PositionAndShape.Parent = page.PositionAndShape;
             page.PositionAndShape.ChildElements.push(subtitle.PositionAndShape);
-            relative.X = this.graphicalMusicSheet.ParentMusicSheet.PageWidth / 2;
-            relative.Y = this.rules.TitleTopDistance + this.rules.SheetTitleHeight + this.rules.SheetMinimumDistanceBetweenTitleAndSubtitle;
+            relative.x = this.graphicalMusicSheet.ParentMusicSheet.pageWidth / 2;
+            relative.y = this.rules.TitleTopDistance + this.rules.SheetTitleHeight + this.rules.SheetMinimumDistanceBetweenTitleAndSubtitle;
             subtitle.PositionAndShape.RelativePosition = relative;
             page.Labels.push(subtitle);
         }
@@ -823,8 +847,8 @@ export class MusicSheetCalculator {
             composer.PositionAndShape.Parent = page.PositionAndShape;
             page.PositionAndShape.ChildElements.push(composer.PositionAndShape);
             composer.setLabelPositionAndShapeBorders();
-            relative.X = this.graphicalMusicSheet.ParentMusicSheet.PageWidth - this.rules.PageRightMargin;
-            relative.Y = firstSystemAbsoluteTopMargin - this.rules.SystemComposerDistance;
+            relative.x = this.graphicalMusicSheet.ParentMusicSheet.pageWidth - this.rules.PageRightMargin;
+            relative.y = firstSystemAbsoluteTopMargin - this.rules.SystemComposerDistance;
             composer.PositionAndShape.RelativePosition = relative;
             page.Labels.push(composer);
         }
@@ -833,8 +857,8 @@ export class MusicSheetCalculator {
             lyricist.PositionAndShape.Parent = page.PositionAndShape;
             page.PositionAndShape.ChildElements.push(lyricist.PositionAndShape);
             lyricist.setLabelPositionAndShapeBorders();
-            relative.X = this.rules.PageLeftMargin;
-            relative.Y = firstSystemAbsoluteTopMargin - this.rules.SystemComposerDistance;
+            relative.x = this.rules.PageLeftMargin;
+            relative.y = firstSystemAbsoluteTopMargin - this.rules.SystemComposerDistance;
             lyricist.PositionAndShape.RelativePosition = relative;
             page.Labels.push(lyricist);
         }
@@ -849,23 +873,23 @@ export class MusicSheetCalculator {
         octaveEnum: OctaveEnum, grace: boolean = false): void {
         let pitch: Pitch = graphicalNote.SourceNote.Pitch;
         let transpose: number = this.graphicalMusicSheet.ParentMusicSheet.Transpose;
-        if (transpose !== 0 && graphicalNote.SourceNote.ParentStaffEntry.ParentStaff.ParentInstrument.MidiInstrumentId !== Common.Enums.MidiInstrument.Percussion) {
+        if (transpose !== 0 && graphicalNote.SourceNote.ParentStaffEntry.ParentStaff.ParentInstrument.MidiInstrumentId !== MidiInstrument.Percussion) {
             pitch = graphicalNote.Transpose(accidentalCalculator.ActiveKeyInstruction, activeClef,
                 transpose, octaveEnum);
             if (graphicalNote.SourceNote.NoteTie !== undefined)
-                graphicalNote.SourceNote.NoteTie.BaseNoteYPosition = graphicalNote.PositionAndShape.RelativePosition.Y;
+                graphicalNote.SourceNote.NoteTie.BaseNoteYPosition = graphicalNote.PositionAndShape.RelativePosition.y;
         }
-        graphicalNote.SourceNote.HalfTone = pitch.getHalfTone();
+        graphicalNote.SourceNote.halfTone = pitch.getHalfTone();
         let scalingFactor: number = 1.0;
         if (grace)
             scalingFactor = this.rules.GraceNoteScalingFactor;
-        accidentalCalculator.CheckAccidental(graphicalNote, pitch, grace, scalingFactor);
+        accidentalCalculator.checkAccidental(graphicalNote, pitch, grace, scalingFactor);
     }
     private createStaffEntryForTieNote(measure: StaffMeasure, absoluteTimestamp: Fraction, openTie: Tie): GraphicalStaffEntry {
         let graphicalStaffEntry: GraphicalStaffEntry;
         graphicalStaffEntry = this.symbolFactory.createStaffEntry(openTie.Start.ParentStaffEntry, measure);
         graphicalStaffEntry.RelInMeasureTimestamp = new Fraction(absoluteTimestamp - measure.ParentSourceMeasure.AbsoluteTimestamp);
-        resetYPositionForLeadSheet(graphicalStaffEntry.PositionAndShape);
+        this.resetYPositionForLeadSheet(graphicalStaffEntry.PositionAndShape);
         measure.addGraphicalStaffEntry(graphicalStaffEntry);
         return graphicalStaffEntry;
     }
@@ -988,7 +1012,7 @@ export class MusicSheetCalculator {
                                     if (voiceEntry.hasTie() && graphicalStaffEntry.RelInMeasureTimestamp !== voiceEntry.Timestamp)
                                         continue;
                                     this.layoutOrnament(voiceEntry.OrnamentContainer, voiceEntry, graphicalStaffEntry);
-                                    if (!this.staffEntriesWithOrnaments.indexOf(graphicalStaffEntry) !== -1)
+                                    if (!(this.staffEntriesWithOrnaments.indexOf(graphicalStaffEntry) !== -1))
                                         this.staffEntriesWithOrnaments.push(graphicalStaffEntry);
                                 }
                             }
@@ -1022,9 +1046,9 @@ export class MusicSheetCalculator {
         secondRestNote.PositionAndShape.RelativePosition = new PointF2D(0.0, 2.5);
         graphicalStaffEntry.PositionAndShape.calculateAbsolutePositionsRecursiveWithoutTopelement();
         firstRestNote.PositionAndShape.computeNonOverlappingPositionWithMargin(graphicalStaffEntry.PositionAndShape, ColDirEnum.Up,
-            new PointF2D(0.0, secondRestNote.PositionAndShape.RelativePosition.Y));
+            new PointF2D(0.0, secondRestNote.PositionAndShape.RelativePosition.y));
         let relative: PointF2D = firstRestNote.PositionAndShape.RelativePosition;
-        relative.Y -= 1.0;
+        relative.y -= 1.0;
         firstRestNote.PositionAndShape.RelativePosition = relative;
         graphicalStaffEntry.PositionAndShape.calculateBoundingBox();
     }
@@ -1049,18 +1073,18 @@ export class MusicSheetCalculator {
         }
         if (collision) {
             if (restNote.SourceNote.ParentVoiceEntry.ParentVoice instanceof LinkedVoice) {
-                let bottomBorder: number = graphicalNotes[0].PositionAndShape.BorderMarginBottom + graphicalNotes[0].PositionAndShape.RelativePosition.Y;
+                let bottomBorder: number = graphicalNotes[0].PositionAndShape.BorderMarginBottom + graphicalNotes[0].PositionAndShape.RelativePosition.y;
                 restNote.PositionAndShape.RelativePosition = new PointF2D(0.0, bottomBorder - restNote.PositionAndShape.BorderMarginTop + 0.5);
             } else {
+                let last: GraphicalNote  = graphicalNotes[graphicalNotes.length-1];
+                let topBorder: number = last.PositionAndShape.BorderMarginTop + last.PositionAndShape.RelativePosition.y;
                 if (graphicalNotes[0].SourceNote.ParentVoiceEntry.ParentVoice instanceof LinkedVoice) {
-                    let topBorder: number = graphicalNotes.Last().PositionAndShape.BorderMarginTop + graphicalNotes.Last().PositionAndShape.RelativePosition.Y;
                     restNote.PositionAndShape.RelativePosition = new PointF2D(0.0, topBorder - restNote.PositionAndShape.BorderMarginBottom - 0.5);
                 } else {
-                    let topBorder: number = graphicalNotes.Last().PositionAndShape.BorderMarginTop + graphicalNotes.Last().PositionAndShape.RelativePosition.Y;
-                    let bottomBorder: number = graphicalNotes[0].PositionAndShape.BorderMarginBottom + graphicalNotes[0].PositionAndShape.RelativePosition.Y;
+                    let bottomBorder: number = graphicalNotes[0].PositionAndShape.BorderMarginBottom + graphicalNotes[0].PositionAndShape.RelativePosition.y;
                     if (bottomBorder < 2.0)
-                    restNote.PositionAndShape.RelativePosition = new PointF2D(0.0, bottomBorder - restNote.PositionAndShape.BorderMarginTop + 0.5);
- else restNote.PositionAndShape.RelativePosition = new PointF2D(0.0, topBorder - restNote.PositionAndShape.BorderMarginBottom - 0.0);
+                        restNote.PositionAndShape.RelativePosition = new PointF2D(0.0, bottomBorder - restNote.PositionAndShape.BorderMarginTop + 0.5);
+                    else restNote.PositionAndShape.RelativePosition = new PointF2D(0.0, topBorder - restNote.PositionAndShape.BorderMarginBottom - 0.0);
                 }
             }
         }
@@ -1125,7 +1149,7 @@ export class MusicSheetCalculator {
         for (let idx: number = 0, len: number = this.graphicalMusicSheet.ParentMusicSheet.Instruments.length; idx < len; ++idx) {
             let instrument: Instrument = this.graphicalMusicSheet.ParentMusicSheet.Instruments[idx];
             if (instrument.HasLyrics && instrument.LyricVersesNumbers.length > 0)
-                instrument.LyricVersesNumbers.Sort();
+                instrument.LyricVersesNumbers.sort();
         }
         for (let idx: number = 0, len: number = this.graphicalMusicSheet.MusicPages.length; idx < len; ++idx) {
             let graphicalMusicPage: GraphicalMusicPage = this.graphicalMusicSheet.MusicPages[idx];

+ 12 - 1
src/MusicalScore/Graphical/OctaveShiftParams.ts

@@ -1 +1,12 @@
-
+import {Fraction} from "../../Common/DataObjects/fraction";
+import {OctaveShift} from "../VoiceData/Expressions/ContinuousExpressions/octaveShift";
+export class OctaveShiftParams {
+    constructor(openOctaveShift: OctaveShift, absoluteStartTimestamp: Fraction, absoluteEndTimestamp: Fraction) {
+        this.GetOpenOctaveShift = openOctaveShift;
+        this.GetAbsoluteStartTimestamp = absoluteStartTimestamp;
+        this.GetAbsoluteEndTimestamp = absoluteEndTimestamp;
+    }
+    public GetOpenOctaveShift: OctaveShift;
+    public GetAbsoluteStartTimestamp: Fraction;
+    public GetAbsoluteEndTimestamp: Fraction;
+}

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

@@ -67,9 +67,9 @@ export class StaffLine extends GraphicalObject {
             let graphicalMeasure: StaffMeasure = this.Measures[idx];
             for (let idx2: number = 0, len2: number = graphicalMeasure.StaffEntries.length; idx2 < len2; ++idx2) {
                 let graphicalStaffEntry: GraphicalStaffEntry = graphicalMeasure.StaffEntries[idx2];
-                if (Math.abs(graphicalStaffEntry.PositionAndShape.RelativePosition.X - xPosition + graphicalMeasure.PositionAndShape.RelativePosition.X) < 5.0)
+                if (Math.abs(graphicalStaffEntry.PositionAndShape.RelativePosition.x - xPosition + graphicalMeasure.PositionAndShape.RelativePosition.x) < 5.0)
                 {
-                    difference = Math.abs(graphicalStaffEntry.PositionAndShape.RelativePosition.X - xPosition + graphicalMeasure.PositionAndShape.RelativePosition.X);
+                    difference = Math.abs(graphicalStaffEntry.PositionAndShape.RelativePosition.x - xPosition + graphicalMeasure.PositionAndShape.RelativePosition.x);
                     closestStaffentry = graphicalStaffEntry;
                 }
             }

+ 6 - 5
src/MusicalScore/Graphical/StaffMeasure.ts

@@ -11,6 +11,7 @@ import {Fraction} from "../../Common/DataObjects/fraction";
 import {Voice} from "../VoiceData/Voice";
 import {VoiceEntry} from "../VoiceData/VoiceEntry";
 import {GraphicalNote} from "./GraphicalNote";
+import {SystemLinesEnum} from "./SystemLinesEnum";
 export class StaffMeasure extends GraphicalObject {
     protected firstInstructionStaffEntry: GraphicalStaffEntry;
     protected lastInstructionStaffEntry: GraphicalStaffEntry;
@@ -92,7 +93,7 @@ export class StaffMeasure extends GraphicalObject {
         let duration: Fraction = new Fraction(0, 1);
         for (let idx: number = 0, len: number = this.StaffEntries.length; idx < len; ++idx) {
             let graphicalStaffEntry: GraphicalStaffEntry = this.StaffEntries[idx];
-            duration.push(graphicalStaffEntry.findStaffEntryMinNoteLength());
+            duration.Add(graphicalStaffEntry.findStaffEntryMinNoteLength());
         }
         return duration === this.ParentSourceMeasure.Duration;
     }
@@ -104,7 +105,7 @@ export class StaffMeasure extends GraphicalObject {
             let staffEntry: GraphicalStaffEntry = this.StaffEntries[idx];
             for (let idx2: number = 0, len2: number = staffEntry.SourceStaffEntry.VoiceEntries.length; idx2 < len2; ++idx2) {
                 let voiceEntry: VoiceEntry = staffEntry.SourceStaffEntry.VoiceEntries[idx2];
-                if (!voices.indexOf(voiceEntry.ParentVoice) !== -1)
+                if (voices.indexOf(voiceEntry.ParentVoice) < 0)
                     voices.push(voiceEntry.ParentVoice);
             }
         }
@@ -122,7 +123,7 @@ export class StaffMeasure extends GraphicalObject {
             let graphicalStaffEntry: GraphicalStaffEntry = this.StaffEntries[idx];
             for (let idx2: number = 0, len2: number = graphicalStaffEntry.SourceStaffEntry.VoiceEntries.length; idx2 < len2; ++idx2) {
                 let voiceEntry: VoiceEntry = graphicalStaffEntry.SourceStaffEntry.VoiceEntries[idx2];
-                if (!voices.indexOf(voiceEntry.ParentVoice) !== -1)
+                if (voices.indexOf(voiceEntry.ParentVoice) < 0)
                     voices.push(voiceEntry.ParentVoice);
             }
         }
@@ -134,11 +135,11 @@ export class StaffMeasure extends GraphicalObject {
                 for (let idx3: number = 0, len3: number = graphicalStaffEntry.Notes.length; idx3 < len3; ++idx3) {
                     let graphicalNotes: GraphicalNote[] = graphicalStaffEntry.Notes[idx3];
                     if (graphicalNotes.length > 0 && graphicalNotes[0].SourceNote.ParentVoiceEntry.ParentVoice === voice)
-                        voiceDuration.push(graphicalNotes[0].GraphicalNoteLength);
+                        voiceDuration.Add(graphicalNotes[0].GraphicalNoteLength);
                 }
             }
             if (voiceDuration > duration)
-                duration = new Fraction(voiceDuration);
+                duration = Fraction.createFromFraction(voiceDuration);
         }
         return duration;
     }

+ 43 - 0
src/MusicalScore/Graphical/VexFlow/VexFlowGraphicalSymbolFactory.ts

@@ -0,0 +1,43 @@
+export class VexFlowGraphicalSymbolFactory implements IGraphicalSymbolFactory {
+    public createMusicSystem(page: GraphicalMusicPage, systemIndex: number): MusicSystem {
+        return new VexFlowMusicSystem(page, systemIndex);
+    }
+    public createStaffLine(parentSystem: MusicSystem, parentStaff: Staff): StaffLine {
+        return new VexFlowStaffLine(parentSystem, parentStaff);
+    }
+    public createStaffMeasure(sourceMeasure: SourceMeasure, staff: Staff): StaffMeasure {
+        var measure: VexFlowMeasure = new VexFlowMeasure(sourceMeasure, staff);
+        return measure;
+    }
+    public createExtraStaffMeasure(staffLine: StaffLine): StaffMeasure {
+        var measure: VexFlowMeasure = new VexFlowMeasure(staffLine);
+        return measure;
+    }
+    public createStaffEntry(sourceStaffEntry: SourceStaffEntry, measure: StaffMeasure): GraphicalStaffEntry {
+        return new VexFlowStaffEntry(<VexFlowMeasure>measure, sourceStaffEntry, null);
+    }
+    public createGraceStaffEntry(staffEntryParent: GraphicalStaffEntry, measure: StaffMeasure): GraphicalStaffEntry {
+        return new VexFlowStaffEntry(<VexFlowMeasure>measure, null, <VexFlowStaffEntry>staffEntryParent);
+    }
+    public createNote(note: Note, numberOfDots: number, graphicalStaffEntry: GraphicalStaffEntry, activeClef: ClefInstruction, octaveShift: OctaveEnum = OctaveEnum.NONE): GraphicalNote {
+        throw new NotImplementedException();
+    }
+    public createGraceNote(note: Note, numberOfDots: number, graphicalStaffEntry: GraphicalStaffEntry, activeClef: ClefInstruction, octaveShift: OctaveEnum = OctaveEnum.NONE): GraphicalNote {
+        throw new NotImplementedException();
+    }
+    public addGraphicalAccidental(graphicalNote: GraphicalNote, pitch: Pitch, grace: boolean, graceScalingFactor: number): void {
+
+    }
+    public addFermataAtTiedEndNote(tiedNote: Note, graphicalStaffEntry: GraphicalStaffEntry): void {
+
+    }
+    public createGraphicalTechnicalInstruction(technicalInstruction: TechnicalInstruction, graphicalStaffEntry: GraphicalStaffEntry): void {
+
+    }
+    public createInStaffClef(graphicalStaffEntry: GraphicalStaffEntry, clefInstruction: ClefInstruction): void {
+
+    }
+    public createChordSymbol(sourceStaffEntry: SourceStaffEntry, graphicalStaffEntry: GraphicalStaffEntry, transposeHalftones: number): void {
+
+    }
+}

+ 46 - 0
src/MusicalScore/Graphical/VexFlow/VexFlowMeasure.ts

@@ -0,0 +1,46 @@
+import {StaffMeasure} from "../StaffMeasure";
+import {SourceMeasure} from "../../VoiceData/SourceMeasure";
+import {Staff} from "../../VoiceData/Staff";
+import {BoundingBox} from "../BoundingBox";
+import {StaffLine} from "../StaffLine";
+import {SystemLinesEnum} from "../SystemLinesEnum";
+import {ClefInstruction} from "../../VoiceData/Instructions/ClefInstruction";
+import {KeyInstruction} from "../../VoiceData/Instructions/KeyInstruction";
+import {RhythmInstruction} from "../../VoiceData/Instructions/RhythmInstruction";
+export class VexFlowMeasure extends StaffMeasure {
+    constructor(sourceMeasure: SourceMeasure, staff: Staff) {
+        super(staff, sourceMeasure);
+        this.PositionAndShape = new BoundingBox(this);
+    }
+    constructor(staffLine: StaffLine) {
+        super(staffLine);
+        this.PositionAndShape = new BoundingBox(staffLine.PositionAndShape, this);
+    }
+    public resetLayout(): void {
+        throw new NotImplementedException();
+    }
+    public getLineWidth(line: SystemLinesEnum): number {
+        throw new NotImplementedException();
+    }
+    public addClefAtBegin(clef: ClefInstruction): void {
+        throw new NotImplementedException();
+    }
+    public addKeyAtBegin(currentKey: KeyInstruction, previousKey: KeyInstruction, currentClef: ClefInstruction): void {
+        throw new NotImplementedException();
+    }
+    public addRhythmAtBegin(rhythm: RhythmInstruction): void {
+        throw new NotImplementedException();
+    }
+    public addClefAtEnd(clef: ClefInstruction): void {
+        throw new NotImplementedException();
+    }
+    public setPositionInStaffline(xPos: number): void {
+        throw new NotImplementedException();
+    }
+    public setWidth(width: number): void {
+        throw new NotImplementedException();
+    }
+    public layoutSymbols(): void {
+        throw new NotImplementedException();
+    }
+}

+ 96 - 0
src/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetCalculator.ts

@@ -0,0 +1,96 @@
+export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
+    constructor() {
+        super(new VexFlowGraphicalSymbolFactory());
+
+    }
+    public calculate(): void {
+        clearSystemsAndMeasures();
+        clearRecreatedObjects();
+        calculateXLayout(this.graphicalMusicSheet, maxInstrNameLabelLength());
+        this.graphicalMusicSheet.MusicPages.Clear();
+        this.calculateMusicSystems();
+        this.graphicalMusicSheet.MusicPages[0].PositionAndShape.BorderMarginBottom += 9;
+        GraphicalMusicSheet.transformRelativeToAbsolutePosition(this.graphicalMusicSheet);
+    }
+    protected calculateMeasureXLayout(measures: List<StaffMeasure>): number {
+        throw new NotImplementedException();
+    }
+    protected calculateMusicSystems(): void {
+        var measureList: List<List<StaffMeasure>> = this.graphicalMusicSheet.MeasureList.Select(ml => ml.Where(m => m.isVisible()).ToList()).ToList();
+        var numberOfStaffLines: number = 0;
+        for (var idx: number = 0, len = measureList.Count; idx < len; ++idx) {
+            var gmlist: List<StaffMeasure> = measureList[idx];
+            numberOfStaffLines = Math.Max(gmlist.Count, numberOfStaffLines);
+            break;
+        }
+        if (numberOfStaffLines == 0)
+            return
+        var musicSystemBuilder: MusicSystemBuilder = new MusicSystemBuilder();
+        musicSystemBuilder.initialize(this.graphicalMusicSheet, measureList, numberOfStaffLines, this.symbolFactory);
+        musicSystemBuilder.buildMusicSystems();
+        checkMeasuresForWholeRestNotes();
+    }
+    protected updateStaffLineBorders(staffLine: StaffLine): void {
+        throw new NotImplementedException();
+    }
+    protected calculateMeasureNumberPlacement(musicSystem: MusicSystem): void {
+        throw new NotImplementedException();
+    }
+    protected layoutVoiceEntry(voiceEntry: VoiceEntry, graphicalNotes: List<GraphicalNote>, graphicalStaffEntry: GraphicalStaffEntry, hasPitchedNote: boolean, isGraceStaffEntry: boolean): void {
+
+    }
+    protected layoutStaffEntry(graphicalStaffEntry: GraphicalStaffEntry): void {
+
+    }
+    protected calculateSystemYLayout(): void {
+        for (var idx: number = 0, len = this.graphicalMusicSheet.MusicPages.Count; idx < len; ++idx) {
+            var graphicalMusicPage: GraphicalMusicPage = this.graphicalMusicSheet.MusicPages[idx];
+            if (!leadSheet) {
+                for (var idx2: number = 0, len2 = graphicalMusicPage.MusicSystems.Count; idx2 < len2; ++idx2) {
+                    var musicSystem: MusicSystem = graphicalMusicPage.MusicSystems[idx2];
+                }
+            }
+        }
+    }
+    protected initStaffMeasuresCreation(): void {
+
+    }
+    protected handleTie(tie: Tie, startGraphicalStaffEntry: GraphicalStaffEntry, staffIndex: number, measureIndex: number): void {
+
+    }
+    protected layoutGraphicalTie(tie: GraphicalTie, tieIsAtSystemBreak: boolean): void {
+
+    }
+    protected calculateSingleStaffLineLyricsPosition(staffLine: StaffLine, lyricVersesNumber: List<number>): void {
+        throw new NotImplementedException();
+    }
+    protected calculateSingleOctaveShift(sourceMeasure: SourceMeasure, multiExpression: MultiExpression, measureIndex: number, staffIndex: number): void {
+        throw new NotImplementedException();
+    }
+    protected calculateWordRepetitionInstruction(repetitionInstruction: RepetitionInstruction, measureIndex: number): void {
+        throw new NotImplementedException();
+    }
+    protected calculateMoodAndUnknownExpression(multiExpression: MultiExpression, measureIndex: number, staffIndex: number): void {
+        throw new NotImplementedException();
+    }
+    protected createGraphicalTieNote(beams: List<Beam>, activeClef: ClefInstruction,
+        octaveShiftValue: OctaveEnum, graphicalStaffEntry: GraphicalStaffEntry, duration: Fraction, numberOfDots: number,
+        openTie: Tie, isLastTieNote: boolean): void {
+
+    }
+    protected handleBeam(graphicalNote: GraphicalNote, beam: Beam, openBeams: List<Beam>): void {
+
+    }
+    protected handleVoiceEntryLyrics(lyricsEntries: Dictionary<number, LyricsEntry>, voiceEntry: VoiceEntry, graphicalStaffEntry: GraphicalStaffEntry, openLyricWords: List<LyricWord>): void {
+
+    }
+    protected handleVoiceEntryOrnaments(ornamentContainer: OrnamentContainer, voiceEntry: VoiceEntry, graphicalStaffEntry: GraphicalStaffEntry): void {
+
+    }
+    protected handleVoiceEntryArticulations(articulations: List<ArticulationEnum>, voiceEntry: VoiceEntry, graphicalStaffEntry: GraphicalStaffEntry): void {
+
+    }
+    protected handleTuplet(graphicalNote: GraphicalNote, tuplet: Tuplet, openTuplets: List<Tuplet>): void {
+
+    }
+}

+ 24 - 0
src/MusicalScore/Graphical/VexFlow/VexFlowMusicSystem.ts

@@ -0,0 +1,24 @@
+export class VexFlowMusicSystem extends MusicSystem {
+    constructor(parent: GraphicalMusicPage, id: number) {
+        super(parent, id);
+
+    }
+    public createSystemLeftVerticalLineObject(lineWidth: number, systemLabelsRightMargin: number): void {
+
+    }
+    public createVerticalLineForMeasure(position: number, lineType: SystemLinesEnum, lineWidth: number, index: number): void {
+
+    }
+    public setYPositionsToVerticalLineObjectsAndCreateLines(rules: EngravingRules): void {
+
+    }
+    protected calcInstrumentsBracketsWidth(): number {
+        return 0;
+    }
+    protected createInstrumentBracket(rightUpper: PointF_2D, rightLower: PointF_2D): void {
+
+    }
+    protected createGroupBracket(rightUpper: PointF_2D, rightLower: PointF_2D, staffHeight: number, recursionDepth: number): void {
+
+    }
+}

+ 6 - 0
src/MusicalScore/Graphical/VexFlow/VexFlowStaffEntry.ts

@@ -0,0 +1,6 @@
+export class VexFlowStaffEntry extends GraphicalStaffEntry {
+    constructor(measure: VexFlowMeasure, sourceStaffEntry: SourceStaffEntry, staffEntryParent: VexFlowStaffEntry) {
+        super(measure, sourceStaffEntry, staffEntryParent);
+
+    }
+}

+ 6 - 0
src/MusicalScore/Graphical/VexFlow/VexFlowStaffLine.ts

@@ -0,0 +1,6 @@
+export class VexFlowStaffLine extends StaffLine {
+    constructor(parentSystem: MusicSystem, parentStaff: Staff) {
+        super(parentSystem, parentStaff);
+
+    }
+}

+ 5 - 0
src/MusicalScore/Interfaces/ITextMeasurer.ts

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

+ 7 - 0
src/MusicalScore/Interfaces/ITransposeCalculator.ts

@@ -0,0 +1,7 @@
+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;
+}

+ 1 - 1
src/MusicalScore/MusicSheet.ts

@@ -454,7 +454,7 @@ export class MusicSheet /*implements ISettableMusicSheet, IComparable<MusicSheet
     //}
     public getEnrolledSelectionStartTimeStampWorkaround(): Fraction {
         let iter: MusicPartManagerIterator = this.MusicPartManager.getIterator(this.SelectionStart);
-        return Fraction.CreateFractionFromFraction(iter.CurrentEnrolledTimestamp);
+        return Fraction.createFromFraction(iter.CurrentEnrolledTimestamp);
     }
     public get SheetEndTimestamp(): Fraction {
         let lastMeasure: SourceMeasure = this.getLastSourceMeasure();

+ 1 - 1
src/MusicalScore/MusicSource/Repetition.ts

@@ -113,7 +113,7 @@ export class Repetition extends PartListEntry /*implements IRepetition*/ {
         this.fromWords = value;
     }
     public get AbsoluteTimestamp(): Fraction {
-        return Fraction.CreateFractionFromFraction(this.musicSheet2.SourceMeasures[this.startMarker.measureIndex].AbsoluteTimestamp);
+        return Fraction.createFromFraction(this.musicSheet2.SourceMeasures[this.startMarker.measureIndex].AbsoluteTimestamp);
     }
     public get StartIndex(): number {
         return this.startMarker.measureIndex;

+ 1 - 1
src/MusicalScore/MusicSource/SourceMusicPart.ts

@@ -32,7 +32,7 @@ export class SourceMusicPart extends PartListEntry {
         this.parentRepetition = value;
     }
     public get AbsoluteTimestamp(): Fraction {
-        return Fraction.CreateFractionFromFraction(this.musicSheet.SourceMeasures[this.startIndex].AbsoluteTimestamp);
+        return Fraction.createFromFraction(this.musicSheet.SourceMeasures[this.startIndex].AbsoluteTimestamp);
     }
     public setStartIndex(startIndex: number): void {
         this.startIndex = startIndex;

+ 1 - 1
src/MusicalScore/VoiceData/ChordSymbolContainer.ts

@@ -68,7 +68,7 @@ export class ChordSymbolContainer {
                         break;
                     }
             }
-            text += chordSymbol.ChordDegree.Value.ToString();
+            text += chordSymbol.ChordDegree.Value;
             if (chordSymbol.ChordDegree.Alteration != AccidentalEnum.NONE)
                 text += ChordSymbolContainer.getTextForAccidental(chordSymbol.ChordDegree.Alteration);
         }

+ 4 - 7
src/MusicalScore/VoiceData/SourceMeasure.ts

@@ -6,11 +6,8 @@ import {Staff} from "./Staff";
 import {VoiceEntry} from "./VoiceEntry";
 import {Voice} from "./Voice";
 import {MusicSheet} from "../MusicSheet";
-//import {Logging} from "../../Common/logging";
-
-type MultiExpression = any;
-type MultiTempoExpression = any;
-
+import {MultiExpression} from "./Expressions/multiExpression";
+import {MultiTempoExpression} from "./Expressions/multiTempoExpression";
 export class SourceMeasure {
     constructor(completeNumberOfStaves: number) {
         this.completeNumberOfStaves = completeNumberOfStaves;
@@ -33,7 +30,7 @@ export class SourceMeasure {
     private absoluteTimestamp: Fraction;
     private completeNumberOfStaves: number;
     private duration: Fraction;
-    private staffLinkedExpressions: MultiExpression[] = [];
+    private staffLinkedExpressions: MultiExpression[][] = [];
     private tempoExpressions: MultiTempoExpression[] = [];
     private verticalSourceStaffEntryContainers: VerticalSourceStaffEntryContainer[] = [];
     private implicitMeasure: boolean;
@@ -77,7 +74,7 @@ export class SourceMeasure {
     public set BreakSystemAfter(value: boolean) {
         this.breakSystemAfter = value;
     }
-    public get StaffLinkedExpressions(): MultiExpression[] {
+    public get StaffLinkedExpressions(): MultiExpression[][] {
         return this.staffLinkedExpressions;
     }
     public get TempoExpressions(): MultiTempoExpression[] {

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

@@ -147,7 +147,7 @@ export class VoiceEntry {
         let baselength: Fraction = baseNote.calculateNoteLengthWithoutTie();
         let baseVoice: Voice = voiceEntryWithOrnament.ParentVoice;
         let baseTimestamp: Fraction = voiceEntryWithOrnament.Timestamp;
-        let currentTimestamp: Fraction = Fraction.CreateFractionFromFraction(baseTimestamp);
+        let currentTimestamp: Fraction = Fraction.createFromFraction(baseTimestamp);
         //let length: Fraction;
         switch (voiceEntryWithOrnament.ornamentContainer.GetOrnament) {
             case OrnamentEnum.Trill: {