Andrea Condoluci 9 lat temu
rodzic
commit
f24027e02d

+ 15 - 6
extras/macrogen.py

@@ -12,11 +12,18 @@ replace = (
 
     ("var ", "let "),
 
+    # Lists --> Arrays
     ("new List<List<([a-zA-Z]*)>>\(\)", "[]"),
     ("List<List<([a-zA-Z]*)>>", "$1[][]"),
     ("new List<([a-zA-Z]*)>\(\)", "[]"),
     ("List<([a-zA-Z]*)>", "$1[]"),
 
+    # Dictionaries:
+    ("new Dictionary<number, ([a-zA-Z0-9\\[\\]\\.]*)>\\(\\)", "{}"),
+    ("Dictionary<number, ([a-zA-Z0-9\\[\\]\\.]*)>", "{ [_: number]: $1; }"),
+    ("new Dictionary<string, ([a-zA-Z0-9\\[\\]\\.]*)>\\(\\)", "{}"),
+    ("Dictionary<string, ([a-zA-Z0-9\\[\\]\\.]*)>", "{ [_: string]: $1; }"),
+
     ("IEnumerable<([a-zA-Z0-9]+)>", "$1[]"),
 
     ("\\.Count", ".length"),
@@ -29,6 +36,7 @@ replace = (
     ("\\.Clear\(\);", ".length = 0;"),
     ("\\.IndexOf", ".indexOf"),
     ("\\.ToArray\\(\\)", ""),
+    ("\\.ContainsKey", ".hasOwnProperty"),
 
     ("\\.Contains\(([a-zA-Z0-9.]+)\)", ".indexOf($1) !== -1"),
 
@@ -73,12 +81,12 @@ def checkForIssues(filename, content):
 def applyAll():
     root = sys.argv[1]
     filenames = []
+    recurse(root, filenames)
+    # if os.path.isdir(root):
+    #     recurse(root, filenames)
+    # else:
+    #     filenames.append(root)
 
-    if os.path.isdir(root):
-        recurse(root, filenames)
-    else:
-        filenames.append(root)
-        
     print("Apply replacements to:")
     for filename in filenames:
         print("  >>> " + os.path.basename(filename))
@@ -96,7 +104,8 @@ def recurse(folder, files):
     if os.path.isfile(folder):
         files.append(folder)
     if os.path.isdir(folder):
-        files.extend(os.path.join(folder, i) for i in os.listdir(folder))
+        for i in os.listdir(folder):
+            recurse(os.path.join(folder, i), files)
 
 def keycode(c):
     if len(c) > 1:

+ 45 - 28
src/MusicalScore/Graphical/AccidentalCalculator.ts

@@ -4,60 +4,77 @@ 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 keySignatureNoteAlterationsDict: { [_: number]: AccidentalEnum; } = {};
+    private currentAlterationsComparedToKeyInstructionDict: number[] = [];
+    private currentInMeasureNoteAlterationsDict: { [_: 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;
+        this.currentInMeasureNoteAlterationsDict = {};
+        for (let key in this.keySignatureNoteAlterationsDict) {
+            if (this.keySignatureNoteAlterationsDict.hasOwnProperty(key)) {
+                this.currentInMeasureNoteAlterationsDict[key] = this.keySignatureNoteAlterationsDict[key];
+            }
         }
     }
+
     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);
+        if (pitch === undefined) {
+            return;
+        }
+        let pitchKey: number = <number>pitch.FundamentalNote + pitch.Octave * 12;
+        let pitchKeyGivenInMeasureDict: boolean = this.currentInMeasureNoteAlterationsDict.hasOwnProperty(pitchKey as string);
+        if (
+            (pitchKeyGivenInMeasureDict && this.currentInMeasureNoteAlterationsDict[pitchKey] !== pitch.Accidental)
+            || (!pitchKeyGivenInMeasureDict && pitch.Accidental !== AccidentalEnum.NONE)
+        ) {
+            if (this.currentAlterationsComparedToKeyInstructionDict.indexOf(pitchKey) === -1) {
+                this.currentAlterationsComparedToKeyInstructionDict.push(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);
+        } else if (
+            this.currentAlterationsComparedToKeyInstructionDict.indexOf(pitchKey) !== -1
+            && ((pitchKeyGivenInMeasureDict && this.currentInMeasureNoteAlterationsDict[pitchKey] !== pitch.Accidental)
+            || (!pitchKeyGivenInMeasureDict && pitch.Accidental === AccidentalEnum.NONE))
+        ) {
+            delete this.currentAlterationsComparedToKeyInstructionDict[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)
+        let noteEnums: NoteEnum[] = KeyInstruction.getNoteEnumList(this.activeKeyInstruction);
+        let 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);
+        } else {
+            keyAccidentalType = AccidentalEnum.FLAT;
+        }
+        this.keySignatureNoteAlterationsDict = {};
+        this.currentAlterationsComparedToKeyInstructionDict.length = 0;
+        for (let octave: number = -9; octave < 9; octave++) {
+            for (let i: number = 0; i < noteEnums.length; i++) {
+                this.keySignatureNoteAlterationsDict[<number>noteEnums[i] + octave * 12] = keyAccidentalType;
             }
         }
         this.doCalculationsAtEndOfMeasure();
     }
-}
+}

+ 1 - 50
src/MusicalScore/Graphical/DrawingEnums.ts

@@ -1,110 +1,61 @@
 export enum OutlineAndFillStyleEnum {
     BaseWritingColor,
-
     FollowingCursor,
-
     AlternativeFollowingCursor,
-
     PlaybackCursor,
-
     Highlighted,
-
     ErrorUnderlay,
-
     Selected,
-
     SelectionSymbol,
-
     DebugColor1,
-
     DebugColor2,
-
     DebugColor3,
-
     SplitScreenDivision,
-
     GreyTransparentOverlay,
-
     MarkedArea1,
-
     MarkedArea2,
-
     MarkedArea3,
-
     MarkedArea4,
-
     MarkedArea5,
-
     MarkedArea6,
-
     MarkedArea7,
-
     MarkedArea8,
-
     MarkedArea9,
-
     MarkedArea10,
-
     Comment1,
-
     Comment2,
-
     Comment3,
-
     Comment4,
-
     Comment5,
-
     Comment6,
-
     Comment7,
-
     Comment8,
-
     Comment9,
-
     Comment10
 }
 export enum StyleSets {
     MarkedArea,
-
     Comment
 }
 export enum GraphicalLayers {
     Background,
-
     Highlight,
-
     MeasureError,
-
     SelectionSymbol,
-
     Cursor,
-
     PSI_Debug,
-
     Notes,
-
     Comment,
-
     Debug_above
 }
 export enum NoteState {
     Normal,
-
     Selected,
-
     Follow_Confirmed,
-
     QFeedback_NotFound,
-
     QFeedback_OK,
-
     QFeedback_Perfect,
-
     Debug1,
-
     Debug2,
-
     Debug3
-}
+}

+ 24 - 21
src/MusicalScore/Graphical/EngravingRules.ts

@@ -74,7 +74,7 @@ export class EngravingRules {
     private betweenDotsDistance: number;
     private ornamentAccidentalScalingFactor: number;
     private chordSymbolTextHeight: number;
-    private chordSymbolYOffset: number;
+    //private chordSymbolYOffset: number;
     private fingeringLabelFontHeight: number;
     private measureNumberLabelHeight: number;
     private measureNumberLabelOffset: number;
@@ -269,10 +269,11 @@ 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) {
+        } catch (ex) {
             Logging.log("EngravingRules()", ex);
         }
 
@@ -1070,37 +1071,39 @@ export class EngravingRules {
         for (let i: number = 0; i < this.noteDistances.length; i++) {
             switch (i) {
                 case 0:
-                    this.durationDistanceDict.push(0.015625, this.noteDistances[i]);
-                    this.durationScalingDistanceDict.push(0.015625, this.noteDistancesScalingFactors[i]);
+                    this.durationDistanceDict[0.015625] = this.noteDistances[i];
+                    this.durationScalingDistanceDict[0.015625] = this.noteDistancesScalingFactors[i];
                     break;
                 case 1:
-                    this.durationDistanceDict.push(0.03125, this.noteDistances[i]);
-                    this.durationScalingDistanceDict.push(0.03125, this.noteDistancesScalingFactors[i]);
+                    this.durationDistanceDict[0.03125] = this.noteDistances[i];
+                    this.durationScalingDistanceDict[0.03125] = this.noteDistancesScalingFactors[i];
                     break;
                 case 2:
-                    this.durationDistanceDict.push(0.0625, this.noteDistances[i]);
-                    this.durationScalingDistanceDict.push(0.0625, this.noteDistancesScalingFactors[i]);
+                    this.durationDistanceDict[0.0625] = this.noteDistances[i];
+                    this.durationScalingDistanceDict[0.0625] = this.noteDistancesScalingFactors[i];
                     break;
                 case 3:
-                    this.durationDistanceDict.push(0.125, this.noteDistances[i]);
-                    this.durationScalingDistanceDict.push(0.125, this.noteDistancesScalingFactors[i]);
+                    this.durationDistanceDict[0.125] = this.noteDistances[i];
+                    this.durationScalingDistanceDict[0.125] = this.noteDistancesScalingFactors[i];
                     break;
                 case 4:
-                    this.durationDistanceDict.push(0.25, this.noteDistances[i]);
-                    this.durationScalingDistanceDict.push(0.25, this.noteDistancesScalingFactors[i]);
+                    this.durationDistanceDict[0.25] = this.noteDistances[i];
+                    this.durationScalingDistanceDict[0.25] = this.noteDistancesScalingFactors[i];
                     break;
                 case 5:
-                    this.durationDistanceDict.push(0.5, this.noteDistances[i]);
-                    this.durationScalingDistanceDict.push(0.5, this.noteDistancesScalingFactors[i]);
+                    this.durationDistanceDict[0.5] = this.noteDistances[i];
+                    this.durationScalingDistanceDict[0.5] = this.noteDistancesScalingFactors[i];
                     break;
                 case 6:
-                    this.durationDistanceDict.push(1.0, this.noteDistances[i]);
-                    this.durationScalingDistanceDict.push(1.0, this.noteDistancesScalingFactors[i]);
+                    this.durationDistanceDict[1.0] = this.noteDistances[i];
+                    this.durationScalingDistanceDict[1.0] = this.noteDistancesScalingFactors[i];
                     break;
                 case 7:
-                    this.durationDistanceDict.push(2.0, this.noteDistances[i]);
-                    this.durationScalingDistanceDict.push(2.0, this.noteDistancesScalingFactors[i]);
+                    this.durationDistanceDict[2.0] = this.noteDistances[i];
+                    this.durationScalingDistanceDict[2.0] = this.noteDistancesScalingFactors[i];
                     break;
+                default:
+                    // FIXME
             }
         }
     }
@@ -1110,7 +1113,7 @@ export class EngravingRules {
         this.factorOne = new Array(this.bezierCurveStepSize);
         this.factorTwo = new Array(this.bezierCurveStepSize);
         for (let i: number = 0; i < this.bezierCurveStepSize; i++) {
-            let t: number = <number>i / this.bezierCurveStepSize;
+            let t: number = i / this.bezierCurveStepSize;
             this.tPower3[i] = Math.pow(t, 3);
             this.oneMinusTPower3[i] = Math.pow((1 - t), 3);
             this.factorOne[i] = 3 * Math.pow((1 - t), 2) * t;

+ 8 - 10
src/MusicalScore/Graphical/FontInfo.ts

@@ -3,9 +3,11 @@ 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>();
+
     constructor() {
         this.createSymbols();
     }
@@ -18,8 +20,7 @@ export class FontInfo {
     public getSymbolInfo(symbol: MusicSymbol): SymbolInfo {
         try {
             return this.symbolMapping[symbol];
-        }
-        catch (ex) {
+        } catch (ex) {
             Logging.debug("FontInfo.getSymbolInfo", ex);
             return new SymbolInfo();
         }
@@ -28,8 +29,7 @@ export class FontInfo {
     public getBoundingBox(symbol: MusicSymbol): SizeF2D {
         try {
             return this.symbolMapping[symbol].boundingBox;
-        }
-        catch (ex) {
+        } catch (ex) {
             Logging.debug("FontInfo.getBoundingBox", ex);
             return new SizeF2D();
         }
@@ -68,8 +68,7 @@ export class FontInfo {
     protected getString(symbol: MusicSymbol): string {
         try {
             return this.symbolMapping[symbol].symbol;
-        }
-        catch (ex) {
+        } catch (ex) {
             Logging.debug("FontInfo.getString", ex);
             return undefined;
         }
@@ -78,15 +77,14 @@ export class FontInfo {
     protected getScaleFactor(symbol: MusicSymbol): number {
         try {
             return this.symbolMapping[symbol].scaleFactor;
-        }
-        catch (ex) {
+        } catch (ex) {
             Logging.debug("FontInfo.getScaleFactor", ex);
             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,
@@ -284,7 +282,7 @@ export class FontInfo {
             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++) {
+        for (let c: string = <string>0x21; c <<string>0x21 + values.length; c++) {
             let si: SymbolInfo = new SymbolInfo(c.ToString(), i, scaleVector[i], centerVector[i], marginVector[i]);
             this.symbolMapping.push(<MusicSymbol>values.GetValue(i), si);
             i++;

+ 5 - 5
src/MusicalScore/Graphical/MusicSheetCalculator.ts

@@ -156,7 +156,7 @@ export class MusicSheetCalculator {
         octaveShiftValue: OctaveEnum,
         graphicalStaffEntry: GraphicalStaffEntry, duration: Fraction, numberOfDots: number,
         openTie: Tie, isLastTieNote: boolean): void { throw new Error('not implemented'); }
-    protected handleVoiceEntryLyrics(lyricsEntries: Dictionary<number, LyricsEntry>, voiceEntry: VoiceEntry, graphicalStaffEntry: GraphicalStaffEntry,
+    protected handleVoiceEntryLyrics(lyricsEntries: { [_: number]: LyricsEntry; }, voiceEntry: VoiceEntry, graphicalStaffEntry: GraphicalStaffEntry,
         openLyricWords: LyricWord[]): void { throw new Error('not implemented'); }
     protected handleVoiceEntryOrnaments(ornamentContainer: OrnamentContainer, voiceEntry: VoiceEntry,
         graphicalStaffEntry: GraphicalStaffEntry): void { throw new Error('not implemented'); }
@@ -188,13 +188,13 @@ export class MusicSheetCalculator {
         if (this.graphicalMusicSheet.MeasureList === undefined) return;
         
         let allMeasures: StaffMeasure[][] = this.graphicalMusicSheet.MeasureList;
-        if (allMeasures == null)
+        if (allMeasures === undefined)
             return;
         let visibleMeasureList: StaffMeasure[][] = [];
-        for (var idx: number = 0, len = allMeasures.length; idx < len; ++idx) {
+        for (let idx: number = 0, len: number = allMeasures.length; idx < len; ++idx) {
             let staffMeasures: StaffMeasure[] = allMeasures[idx];
             let visibleStaffMeasures: StaffMeasure[] = [];
-            for (var idx2: number = 0, len2 = staffMeasures.length; idx2 < len2; ++idx2) {
+            for (let idx2: number = 0, len2: number = staffMeasures.length; idx2 < len2; ++idx2) {
                 let staffMeasure: StaffMeasure = allMeasures[idx][idx2];
                 if (staffMeasure.isVisible())
                     visibleStaffMeasures.push(staffMeasure);
@@ -556,7 +556,7 @@ export class MusicSheetCalculator {
                             let gse: GraphicalStaffEntry = measure.StaffEntries[0];
                             if (gse.Notes.length > 0 && gse.Notes[0].length > 0) {
                                 let graphicalNote: GraphicalNote = gse.Notes[0][0];
-                                if (graphicalNote.SourceNote.Pitch === undefined && graphicalNote.SourceNote.Length >= new Fraction(1, 2)) {
+                                if (graphicalNote.SourceNote.Pitch === undefined && graphicalNote.SourceNote.length >= new Fraction(1, 2)) {
                                     this.layoutMeasureWithWholeRest(graphicalNote, gse, measure);
                                 }
                             }

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

@@ -19,16 +19,16 @@ export class StaffMeasure extends GraphicalObject {
     private staff: Staff;
     private measureNumber: number = -1;
     private parentStaffLine: StaffLine;
-    constructor(staff: Staff = null, staffLine: StaffLine = null, parentSourceMeasure: SourceMeasure = null) {
+    constructor(staff: Staff = undefined, staffLine: StaffLine = undefined, parentSourceMeasure: SourceMeasure = undefined) {
         this.staff = staff;
         this.ParentSourceMeasure = parentSourceMeasure;
         this.parentStaffLine = staffLine;
-        if (staffLine != null)
+        if (staffLine !== undefined)
             this.staff = staffLine.ParentStaff;
-        if (this.ParentSourceMeasure != null)
+        if (this.ParentSourceMeasure !== undefined)
             this.measureNumber = this.ParentSourceMeasure.MeasureNumber;
         this.StaffEntries = [];
-        if (staffLine != null)
+        if (staffLine !== undefined)
             this.PositionAndShape = new BoundingBox(staffLine.PositionAndShape, this);
         else this.PositionAndShape = new BoundingBox(this);
     }
@@ -95,7 +95,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.Add(graphicalStaffEntry.findStaffEntryMinNoteLength());
+            duration.push(graphicalStaffEntry.findStaffEntryMinNoteLength());
         }
         return duration === this.ParentSourceMeasure.Duration;
     }
@@ -137,7 +137,7 @@ 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.Add(graphicalNotes[0].GraphicalNoteLength);
+                        voiceDuration.push(graphicalNotes[0].GraphicalNoteLength);
                 }
             }
             if (voiceDuration > duration)

+ 4 - 4
src/MusicalScore/Graphical/VexFlow/VexFlowGraphicalSymbolFactory.ts

@@ -46,7 +46,7 @@ export class VexFlowGraphicalSymbolFactory implements IGraphicalSymbolFactory {
      * @returns {VexFlowMeasure}
      */
     public createStaffMeasure(sourceMeasure: SourceMeasure, staff: Staff): StaffMeasure {
-        var measure: VexFlowMeasure = new VexFlowMeasure(sourceMeasure, staff);
+        let measure: VexFlowMeasure = new VexFlowMeasure(sourceMeasure, staff);
         return measure;
     }
 
@@ -56,7 +56,7 @@ export class VexFlowGraphicalSymbolFactory implements IGraphicalSymbolFactory {
      * @returns {VexFlowMeasure}
      */
     public createExtraStaffMeasure(staffLine: StaffLine): StaffMeasure {
-        var measure: VexFlowMeasure = new VexFlowMeasure(staffLine);
+        let measure: VexFlowMeasure = new VexFlowMeasure(staffLine);
         return measure;
     }
 
@@ -67,7 +67,7 @@ export class VexFlowGraphicalSymbolFactory implements IGraphicalSymbolFactory {
      * @returns {VexFlowStaffEntry}
      */
     public createStaffEntry(sourceStaffEntry: SourceStaffEntry, measure: StaffMeasure): GraphicalStaffEntry {
-        return new VexFlowStaffEntry(<VexFlowMeasure>measure, sourceStaffEntry, null);
+        return new VexFlowStaffEntry(<VexFlowMeasure>measure, sourceStaffEntry, undefined);
     }
 
     /**
@@ -79,7 +79,7 @@ export class VexFlowGraphicalSymbolFactory implements IGraphicalSymbolFactory {
      * @returns {VexFlowStaffEntry}
      */
     public createGraceStaffEntry(staffEntryParent: GraphicalStaffEntry, measure: StaffMeasure): GraphicalStaffEntry {
-        return new VexFlowStaffEntry(<VexFlowMeasure>measure, null, <VexFlowStaffEntry>staffEntryParent);
+        return new VexFlowStaffEntry(<VexFlowMeasure>measure, undefined, <VexFlowStaffEntry>staffEntryParent);
     }
 
     /**

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

@@ -10,7 +10,7 @@ import {RhythmInstruction} from "../../VoiceData/Instructions/RhythmInstruction"
 export class VexFlowMeasure extends StaffMeasure {
     constructor(staff: Staff, staffLine: StaffLine = undefined, sourceMeasure: SourceMeasure = undefined) {
         super(staff, staffLine, sourceMeasure);
-
+        // this.MinimumStaffEntriesWidth =
     }
 
     /**
@@ -18,6 +18,7 @@ export class VexFlowMeasure extends StaffMeasure {
      * This is needed to evaluate a measure a second time by system builder.
      */
     public resetLayout(): void {
+        this.BeginInstructionsWidth = 0;
 
     }
 
@@ -27,7 +28,8 @@ export class VexFlowMeasure extends StaffMeasure {
      * @returns {SystemLinesEnum} the x-width
      */
     public getLineWidth(line: SystemLinesEnum): number {
-        return SystemLinesEnum.SingleThin;
+        //SystemLinesEnum.
+        return 5;
     }
 
     /**
@@ -36,7 +38,7 @@ export class VexFlowMeasure extends StaffMeasure {
      * @param clef
      */
     public addClefAtBegin(clef: ClefInstruction): void {
-
+        this.BeginInstructionsWidth += 20;
     }
 
     /**
@@ -92,4 +94,4 @@ export class VexFlowMeasure extends StaffMeasure {
     public layoutSymbols(): void {
 
     }
-}
+}

+ 1 - 1
src/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetCalculator.ts

@@ -151,7 +151,7 @@ export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
     protected handleBeam(graphicalNote: GraphicalNote, beam: Beam, openBeams: Beam[]): void {
 
     }
-    protected handleVoiceEntryLyrics(lyricsEntries: Dictionary<number, LyricsEntry>, voiceEntry: VoiceEntry, graphicalStaffEntry: GraphicalStaffEntry, openLyricWords: LyricWord[]): void {
+    protected handleVoiceEntryLyrics(lyricsEntries: { [_: number]: LyricsEntry; }, voiceEntry: VoiceEntry, graphicalStaffEntry: GraphicalStaffEntry, openLyricWords: LyricWord[]): void {
 
     }
     protected handleVoiceEntryOrnaments(ornamentContainer: OrnamentContainer, voiceEntry: VoiceEntry, graphicalStaffEntry: GraphicalStaffEntry): void {

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

@@ -67,4 +67,4 @@ export class VexFlowMusicSystem extends MusicSystem {
     protected createGroupBracket(rightUpper: PointF2D, rightLower: PointF2D, staffHeight: number, recursionDepth: number): void {
 
     }
-}
+}