浏览代码

Linting with new conventions

Andrea Condoluci 9 年之前
父节点
当前提交
3d5ece0138
共有 33 个文件被更改,包括 607 次插入609 次删除
  1. 8 7
      src/Common/DataObjects/MusicSheetErrors.ts
  2. 27 35
      src/Common/FileIO/Xml.ts
  3. 38 39
      src/MusicalScore/Calculation/MeasureSizeCalculator.ts
  4. 1 1
      src/MusicalScore/Exceptions.ts
  5. 14 14
      src/MusicalScore/Instrument.ts
  6. 3 3
      src/MusicalScore/Interfaces/ITextTranslation.ts
  7. 1 1
      src/MusicalScore/MusicParts/MusicPartManager.ts
  8. 16 16
      src/MusicalScore/MusicParts/MusicPartManagerIterator.ts
  9. 15 26
      src/MusicalScore/MusicSheet.ts
  10. 6 7
      src/MusicalScore/MusicSource/PartListEntry.ts
  11. 7 7
      src/MusicalScore/MusicSource/Repetition.ts
  12. 7 5
      src/MusicalScore/MusicSource/SourceMusicPart.ts
  13. 91 91
      src/MusicalScore/ScoreIO/InstrumentReader.ts
  14. 95 95
      src/MusicalScore/ScoreIO/MusicSheetReader.ts
  15. 76 76
      src/MusicalScore/ScoreIO/VoiceGenerator.ts
  16. 11 11
      src/MusicalScore/SubInstrument.ts
  17. 6 6
      src/MusicalScore/VoiceData/ChordSymbolContainer.ts
  18. 22 22
      src/MusicalScore/VoiceData/Expressions/ContinuousExpressions/Slur.ts
  19. 9 4
      src/MusicalScore/VoiceData/Expressions/ContinuousExpressions/continuousDynamicExpression.ts
  20. 36 35
      src/MusicalScore/VoiceData/Expressions/ContinuousExpressions/continuousTempoExpression.ts
  21. 12 6
      src/MusicalScore/VoiceData/Expressions/ContinuousExpressions/octaveShift.ts
  22. 10 10
      src/MusicalScore/VoiceData/HelperObjects/DynamicsContainer.ts
  23. 36 35
      src/MusicalScore/VoiceData/Instructions/RepetitionInstruction.ts
  24. 2 1
      src/MusicalScore/VoiceData/Instructions/RhythmInstruction.ts
  25. 11 11
      src/MusicalScore/VoiceData/Lyrics/LyricsEntry.ts
  26. 8 7
      src/MusicalScore/VoiceData/Lyrics/LyricsWord.ts
  27. 5 5
      src/MusicalScore/VoiceData/Note.ts
  28. 7 7
      src/MusicalScore/VoiceData/SourceMeasure.ts
  29. 5 5
      src/MusicalScore/VoiceData/Staff.ts
  30. 3 2
      src/MusicalScore/VoiceData/VoiceEntry.ts
  31. 1 1
      src/Util/fft.ts
  32. 16 16
      test/Common/FileIO/Xml.ts
  33. 2 2
      test/Util/fft.ts

+ 8 - 7
src/Common/DataObjects/MusicSheetErrors.ts

@@ -1,11 +1,12 @@
 // skeleton by Andrea
 
 export class MusicSheetErrors {
+    public measureErrors: { [n: number]: string[] };
+
     private errors: string[];
     private tempErrors: string[];
-    public MeasureErrors: { [n: number]: string[] };
 
-    public TransferTempErrorsToDict(measureNumber: number) {
+    public TransferTempErrorsToDict(measureNumber: number): void {
         for (let errorString of this.tempErrors) {
             this.addErrorMessageAtIndex(measureNumber, errorString);
         }
@@ -13,18 +14,18 @@ export class MusicSheetErrors {
     }
 
     // Add an error message to the temporary errors list
-    public pushTemp(errorMsg: string) {
+    public pushTemp(errorMsg: string): void {
         this.tempErrors.push(errorMsg);
     }
 
-    public push(errorMsg: string) {
+    public push(errorMsg: string): void {
         this.errors.push(errorMsg);
     }
 
-    private addErrorMessageAtIndex(measureNumber: number, errorString: string) {
-        let list: string[] = this.MeasureErrors[measureNumber];
+    private addErrorMessageAtIndex(measureNumber: number, errorString: string): void {
+        let list: string[] = this.measureErrors[measureNumber];
         if (list === undefined) {
-            this.MeasureErrors[measureNumber] = [errorString];
+            this.measureErrors[measureNumber] = [errorString];
         } else {
             list.push(errorString);
         }

+ 27 - 35
src/Common/FileIO/Xml.ts

@@ -1,65 +1,57 @@
-export class IXmlAttribute {
-  public Name: string;
-  public Value: string;
-
-  constructor(attr: Attr) {
-    this.Name = attr.name;
-    this.Value = attr.value;
-  };
-}
+export type IXmlAttribute = Attr;
 
 export class IXmlElement {
-  public Name: string;
-  public Value: string;
-  public HasAttributes: boolean = false;
-  public FirstAttribute: IXmlAttribute;
-  public HasElements: boolean;
+  public name: string;
+  public value: string;
+  public hasAttributes: boolean = false;
+  public firstAttribute: IXmlAttribute;
+  public hasElements: boolean;
 
-  private _attrs: IXmlAttribute[];
-  private _elem: Element;
+  private attrs: IXmlAttribute[];
+  private elem: Element;
 
   constructor(elem: Element) {
-    this._elem = elem;
-    this.Name = elem.nodeName;
+    this.elem = elem;
+    this.name = elem.nodeName;
 
     if (elem.hasAttributes()) {
-      this.HasAttributes = true;
-      this.FirstAttribute = new IXmlAttribute(elem.attributes[0]);
+      this.hasAttributes = true;
+      this.firstAttribute = elem.attributes[0];
       }
-    this.HasElements = elem.hasChildNodes();
+    this.hasElements = elem.hasChildNodes();
     // Look for a value
     if (
       elem.childNodes.length === 1 &&
       elem.childNodes[0].nodeType === Node.TEXT_NODE
     ) {
-      this.Value = elem.childNodes[0].nodeValue;
+      this.value = elem.childNodes[0].nodeValue;
     }
   }
 
-  public Attribute(attributeName: string): IXmlAttribute {
-    return new IXmlAttribute(this._elem.attributes.getNamedItem(attributeName));
+  public attribute(attributeName: string): IXmlAttribute {
+    return this.elem.attributes.getNamedItem(attributeName);
   }
 
-  public Attributes(): IXmlAttribute[] {
-    if (typeof this._attrs === "undefined") {
-      let attributes: NamedNodeMap = this._elem.attributes;
+  public attributes(): IXmlAttribute[] {
+    if (typeof this.attrs === "undefined") {
+      let attributes: NamedNodeMap = this.elem.attributes;
       let attrs: IXmlAttribute[] = [];
       for (let i: number = 0; i < attributes.length; i += 1) {
-        attrs.push(new IXmlAttribute(attributes[i]));
+        attrs.push(attributes[i]);
       }
-      this._attrs = attrs;
+      this.attrs = attrs;
     }
-    return this._attrs;
+    return this.attrs;
   }
 
-  public Element(elementName: string): IXmlElement {
-    return this.Elements(elementName)[0];
+  public element(elementName: string): IXmlElement {
+    return this.elements(elementName)[0];
   }
 
-  public Elements(nodeName?: string): IXmlElement[] {
-    let nodes: NodeList = this._elem.childNodes;
+  public elements(nodeName?: string): IXmlElement[] {
+    let nodes: NodeList = this.elem.childNodes;
     let ret: IXmlElement[] = [];
-    let nameUnset: boolean = typeof nodeName === "undefined";
+    let nameUnset: boolean = typeof nodeName === "undefined"; // FIXME check
     for (let i: number = 0; i < nodes.length; i += 1) {
       let node: Node = nodes[i];
       if (node.nodeType === Node.ELEMENT_NODE &&

+ 38 - 39
src/MusicalScore/Calculation/MeasureSizeCalculator.ts

@@ -48,6 +48,44 @@ export class MeasureSizeCalculator {
     this.format();
   }
 
+  public static getClefBoundingBox(clef: Vex.Flow.Clef): Vex.Flow.BoundingBox {
+    let clef2: any = clef;
+    clef2.placeGlyphOnLine(clef2.glyph, clef2.stave, clef2.clef.line);
+    let glyph: any = clef.glyph;
+    let posX: number = clef.x + glyph.x_shift;
+    let posY: number = clef.stave.getYForGlyphs() + glyph.y_shift;
+    let scale: number = glyph.scale;
+    let outline: any[] = glyph.metrics.outline;
+    let xmin: number = 0, xmax: number = 0, ymin: number = 0, ymax: number = 0;
+
+    function update(i: number): void {
+      let x: number = outline[i + 1];
+      let y: number = outline[i + 2];
+      xmin = Math.min(xmin, x);
+      xmax = Math.max(xmax, x);
+      ymin = Math.min(ymin, y);
+      ymax = Math.max(ymax, y);
+    }
+
+    for (let i: number = 0, len: number = outline.length; i < len; i += 3) {
+      console.log(i, outline[i]);
+      switch (<string> outline[i]) {
+        case "m": update(i); break;
+        case "l": update(i); break;
+        case "q": i += 2; update(i); break;
+        case "b": i += 4; update(i); break;
+        default: break;
+      }
+
+    }
+    return new Vex.Flow.BoundingBox(
+        posX + xmin * scale,
+        posY - ymin * scale,
+        (xmax - xmin) * scale,
+        (ymin - ymax) * scale
+    );
+  }
+
   public getWidth(): number {
     // begin_modifiers + voices + end_modifiers
     return this.offsetLeft + this.voicesWidth + this.offsetRight;
@@ -123,43 +161,4 @@ export class MeasureSizeCalculator {
     );
   }
 
-  public static getClefBoundingBox(clef: Vex.Flow.Clef): Vex.Flow.BoundingBox {
-    let clef2: any = clef;
-    clef2.placeGlyphOnLine(clef2.glyph, clef2.stave, clef2.clef.line);
-    let glyph: any = clef.glyph;
-    let x_pos: number = clef.x + glyph.x_shift;
-    let y_pos: number = clef.stave.getYForGlyphs() + glyph.y_shift;
-    let scale: number = glyph.scale;
-    let outline: any[] = glyph.metrics.outline;
-    let xmin: number = 0, xmax: number = 0, ymin: number = 0, ymax: number = 0;
-
-    function update(i: number): void {
-      let x: number = outline[i + 1];
-      let y: number = outline[i + 2];
-      xmin = Math.min(xmin, x);
-      xmax = Math.max(xmax, x);
-      ymin = Math.min(ymin, y);
-      ymax = Math.max(ymax, y);
-    }
-
-    for (let i = 0, len = outline.length; i < len; i += 3) {
-      console.log(i, outline[i]);
-      switch (<string> outline[i]) {
-        case "m": update(i); break;
-        case "l": update(i); break;
-        case "q": i += 2; update(i); break;
-        case "b": i += 4; update(i); break;
-        default: break;
-      }
-
-    }
-    return new Vex.Flow.BoundingBox(
-      x_pos + xmin * scale,
-      y_pos - ymin * scale,
-      (xmax - xmin) * scale,
-      (ymin - ymax) * scale
-    );
-  }
-
-
 }

+ 1 - 1
src/MusicalScore/Exceptions.ts

@@ -26,4 +26,4 @@ export class InvalidEnumArgumentException implements Error {
     constructor(message: string) {
         this.message = message;
     }
-}
+}

+ 14 - 14
src/MusicalScore/Instrument.ts

@@ -6,7 +6,6 @@ import { Staff } from "./VoiceData/Staff";
 import { SubInstrument } from "./SubInstrument";
 import { MidiInstrument } from "./VoiceData/Instructions/ClefInstruction";
 
-
 export class Instrument extends InstrumentalGroup {
     constructor(id: number, idString: string, musicSheet: MusicSheet, parent: InstrumentalGroup) {
         super(undefined, musicSheet, parent);
@@ -15,8 +14,8 @@ export class Instrument extends InstrumentalGroup {
         this.nameLabel = new Label(idString);
     }
 
-    public Transpose: number = 0;
-    public Highlight: boolean;
+    public transpose: number = 0;
+    public highlight: boolean;
 
     private voices: Voice[] = [];
     private staves: Staff[] = [];
@@ -29,6 +28,7 @@ export class Instrument extends InstrumentalGroup {
 
     private lyricVersesNumbers: number[] = [];
     private subInstruments: SubInstrument[] = [];
+
     public get Voices(): Voice[] {
         return this.voices;
     }
@@ -69,18 +69,18 @@ export class Instrument extends InstrumentalGroup {
         return this.id;
     }
     public get MidiInstrumentId(): MidiInstrument {
-        return this.subInstruments[0].MidiInstrumentId;
+        return this.subInstruments[0].midiInstrumentID;
     }
     public set MidiInstrumentId(value: MidiInstrument) {
-        this.subInstruments[0].MidiInstrumentId = value;
+        this.subInstruments[0].midiInstrumentID = value;
     }
     public get Volume(): number {
-        return this.subInstruments[0].Volume;
+        return this.subInstruments[0].volume;
     }
     public set Volume(value: number) {
         for (let idx: number = 0, len: number = this.subInstruments.length; idx < len; ++idx) {
             let subInstrument: SubInstrument = this.subInstruments[idx];
-            subInstrument.Volume = value;
+            subInstrument.volume = value;
         }
     }
     public get PlaybackTranspose(): number {
@@ -96,7 +96,7 @@ export class Instrument extends InstrumentalGroup {
     public getSubInstrument(subInstrumentIdString: string): SubInstrument {
         for (let idx: number = 0, len: number = this.subInstruments.length; idx < len; ++idx) {
             let subInstrument: SubInstrument = this.subInstruments[idx];
-            if (subInstrument.IdString === subInstrumentIdString) {
+            if (subInstrument.idString === subInstrumentIdString) {
                 return subInstrument;
             }
         }
@@ -130,7 +130,7 @@ export class Instrument extends InstrumentalGroup {
         }
         for (let idx: number = 0, len: number = this.staves.length; idx < len; ++idx) {
             let staff: Staff = this.staves[idx];
-            staff.Audible = value;
+            staff.audible = value;
         }
     }
     public get Following(): boolean {
@@ -148,7 +148,7 @@ export class Instrument extends InstrumentalGroup {
         }
         for (let idx: number = 0, len: number = this.staves.length; idx < len; ++idx) {
             let staff: Staff = this.staves[idx];
-            staff.Following = value;
+            staff.following = value;
         }
     }
     public SetVoiceAudible(voiceId: number, audible: boolean): void {
@@ -171,7 +171,7 @@ export class Instrument extends InstrumentalGroup {
     }
     public SetStaffAudible(staffId: number, audible: boolean): void {
         let staff: Staff = this.staves[staffId - 1];
-        staff.Audible = audible;
+        staff.audible = audible;
         if (audible) {
             for (let idx: number = 0, len: number = staff.Voices.length; idx < len; ++idx) {
                 let v: Voice = staff.Voices[idx];
@@ -183,7 +183,7 @@ export class Instrument extends InstrumentalGroup {
                 let isAudibleInOtherStaves: boolean = false;
                 for (let idx2: number = 0, len2: number = this.Staves.length; idx2 < len2; ++idx2) {
                     let st: Staff = this.Staves[idx2];
-                    if (st.Id === staffId || !st.Audible) { continue; }
+                    if (st.Id === staffId || !st.audible) { continue; }
                     for (let idx3: number = 0, len3: number = st.Voices.length; idx3 < len3; ++idx3) {
                         let v: Voice = st.Voices[idx3];
                         if (v === voice) {
@@ -199,7 +199,7 @@ export class Instrument extends InstrumentalGroup {
     }
     public SetStaffFollow(staffId: number, follow: boolean): void {
         let staff: Staff = this.staves[staffId - 1];
-        staff.Following = follow;
+        staff.following = follow;
         if (follow) {
             for (let idx: number = 0, len: number = staff.Voices.length; idx < len; ++idx) {
                 let v: Voice = staff.Voices[idx];
@@ -211,7 +211,7 @@ export class Instrument extends InstrumentalGroup {
                 let isFollowingInOtherStaves: boolean = false;
                 for (let idx2: number = 0, len2: number = this.Staves.length; idx2 < len2; ++idx2) {
                     let st: Staff = this.Staves[idx2];
-                    if (st.Id === staffId || !st.Following) { continue; }
+                    if (st.Id === staffId || !st.following) { continue; }
                     for (let idx3: number = 0, len3: number = st.Voices.length; idx3 < len3; ++idx3) {
                         let v: Voice = st.Voices[idx3];
                         if (v === voice) {

+ 3 - 3
src/MusicalScore/Interfaces/ITextTranslation.ts

@@ -1,8 +1,8 @@
 export class ITextTranslation {
-    public static DefaultTextTranslation: ITextTranslation;
+    public static defaultTextTranslation: ITextTranslation;
 
     public static translateText(tag: string, text: string): string {
-        if (this.DefaultTextTranslation == undefined) {
+        if (this.defaultTextTranslation === undefined) {
             return text;
         }
 
@@ -10,4 +10,4 @@ export class ITextTranslation {
     }
 
     //declare public translate(tag: string, text: string): string;
-}
+}

+ 1 - 1
src/MusicalScore/MusicParts/MusicPartManager.ts

@@ -73,7 +73,7 @@ export class MusicPartManager /*implements ISelectionListener*/ {
         while (!iterator.EndReached) {
             if (iterator.JumpOccurred || currentRepetition !== iterator.CurrentRepetition) {
                 currentRepetition = iterator.CurrentRepetition;
-                if (iterator.BackJumpOccurred) {
+                if (iterator.backJumpOccurred) {
                     let jumpRep: Repetition = iterator.JumpResponsibleRepetition;
                     curTimestampTransform.nextBackJump = iterator.CurrentEnrolledTimestamp;
                     curTimestampTransform.curRepetition = jumpRep;

+ 16 - 16
src/MusicalScore/MusicParts/MusicPartManagerIterator.ts

@@ -50,8 +50,8 @@ export class MusicPartManagerIterator {
         }
 
     }
-    public BackJumpOccurred: boolean;
-    public ForwardJumpOccurred: boolean;
+    public backJumpOccurred: boolean;
+    public forwardJumpOccurred: boolean;
     private manager: MusicPartManager;
     private currentMappingPart: MappingSourceMusicPart;
     private currentMeasure: SourceMeasure;
@@ -113,7 +113,7 @@ export class MusicPartManagerIterator {
         return this.currentTimeStamp;
     }
     public get JumpOccurred(): boolean {
-        return this.BackJumpOccurred || this.ForwardJumpOccurred;
+        return this.backJumpOccurred || this.forwardJumpOccurred;
     }
     public get ActiveTempoExpression(): MultiTempoExpression {
         return this.activeTempoExpression;
@@ -206,7 +206,7 @@ export class MusicPartManagerIterator {
     //    return this.manager.MusicSheet.SheetPlaybackSetting;
     //}
     public moveToNext(): void {
-        this.ForwardJumpOccurred = this.BackJumpOccurred = false;
+        this.forwardJumpOccurred = this.backJumpOccurred = false;
         if (this.endReached) { return; }
         if (this.currentVoiceEntries !== undefined) {
             this.currentVoiceEntries = [];
@@ -296,8 +296,8 @@ export class MusicPartManagerIterator {
     private handleRepetitionsAtMeasureBegin(): void {
         for (let idx: number = 0, len: number = this.currentMeasure.FirstRepetitionInstructions.length; idx < len; ++idx) {
             let repetitionInstruction: RepetitionInstruction = this.currentMeasure.FirstRepetitionInstructions[idx];
-            if (repetitionInstruction.ParentRepetition === undefined) { continue; }
-            let currentRepetition: Repetition = repetitionInstruction.ParentRepetition;
+            if (repetitionInstruction.parentRepetition === undefined) { continue; }
+            let currentRepetition: Repetition = repetitionInstruction.parentRepetition;
             this.currentRepetition = currentRepetition;
             if (currentRepetition.StartIndex === this.currentMeasureIndex) {
                 if (
@@ -315,16 +315,16 @@ export class MusicPartManagerIterator {
     private handleRepetitionsAtMeasureEnd(): void {
         for (let idx: number = 0, len: number = this.currentMeasure.LastRepetitionInstructions.length; idx < len; ++idx) {
             let repetitionInstruction: RepetitionInstruction = this.currentMeasure.LastRepetitionInstructions[idx];
-            let currentRepetition: Repetition = repetitionInstruction.ParentRepetition;
+            let currentRepetition: Repetition = repetitionInstruction.parentRepetition;
             if (currentRepetition === undefined) { continue; }
             if (currentRepetition.BackwardJumpInstructions.indexOf(repetitionInstruction) > -1) {
                 if (this.getRepetitionIterationCount(currentRepetition) < currentRepetition.UserNumberOfRepetitions) {
                     this.doBackJump(currentRepetition);
-                    this.BackJumpOccurred = true;
+                    this.backJumpOccurred = true;
                     return;
                 }
             }
-            if (repetitionInstruction === currentRepetition.ForwardJumpInstruction) {
+            if (repetitionInstruction === currentRepetition.forwardJumpInstruction) {
                 if (
                   this.JumpResponsibleRepetition !== undefined
                   && currentRepetition !== this.JumpResponsibleRepetition
@@ -342,7 +342,7 @@ export class MusicPartManagerIterator {
                     this.currentMeasure = this.manager.MusicSheet.SourceMeasures[this.currentMeasureIndex];
                     this.currentVoiceEntryIndex = -1;
                     this.jumpResponsibleRepetition = currentRepetition;
-                    this.ForwardJumpOccurred = true;
+                    this.forwardJumpOccurred = true;
                     return;
                 }
                 if (forwardJumpTargetMeasureIndex === -2) {
@@ -372,7 +372,7 @@ export class MusicPartManagerIterator {
             for (let idx: number = 0, len: number = instructions.length; idx < len; ++idx) {
                 let abstractNotationInstruction: AbstractNotationInstruction = instructions[idx];
                 if (abstractNotationInstruction instanceof RhythmInstruction) {
-                    this.manager.MusicSheet.SheetPlaybackSetting.Rhythm = (<RhythmInstruction>abstractNotationInstruction).Rhythm;
+                    this.manager.MusicSheet.SheetPlaybackSetting.rhythm = (<RhythmInstruction>abstractNotationInstruction).Rhythm;
                 }
             }
         }
@@ -398,12 +398,12 @@ export class MusicPartManagerIterator {
           && timeSortedDynamics[this.currentDynamicEntryIndex].parMultiExpression().AbsoluteTimestamp === this.CurrentSourceTimestamp
         ) {
             let dynamicsContainer: DynamicsContainer = timeSortedDynamics[this.currentDynamicEntryIndex];
-            let staffIndex: number = dynamicsContainer.StaffNumber;
+            let staffIndex: number = dynamicsContainer.staffNumber;
             if (this.CurrentSourceTimestamp === dynamicsContainer.parMultiExpression().AbsoluteTimestamp) {
-                if (dynamicsContainer.ContinuousDynamicExpression !== undefined) {
-                    this.activeDynamicExpressions[staffIndex] = dynamicsContainer.ContinuousDynamicExpression;
-                } else if (dynamicsContainer.InstantaneousDynamicExpression !== undefined) {
-                    this.activeDynamicExpressions[staffIndex] = dynamicsContainer.InstantaneousDynamicExpression;
+                if (dynamicsContainer.continuousDynamicExpression !== undefined) {
+                    this.activeDynamicExpressions[staffIndex] = dynamicsContainer.continuousDynamicExpression;
+                } else if (dynamicsContainer.instantaneousDynamicExpression !== undefined) {
+                    this.activeDynamicExpressions[staffIndex] = dynamicsContainer.instantaneousDynamicExpression;
                 }
             }
             this.currentDynamicEntryIndex++;

+ 15 - 26
src/MusicalScore/MusicSheet.ts

@@ -7,10 +7,7 @@ import {InstrumentalGroup} from "./InstrumentalGroup";
 import {Instrument} from "./Instrument";
 import {Label} from "./Label";
 import {Staff} from "./VoiceData/Staff";
-import {Note} from "./VoiceData/Note";
-import {VoiceEntry} from "./VoiceData/VoiceEntry";
 import {MusicPartManagerIterator} from "./MusicParts/MusicPartManagerIterator";
-import {PartListEntry} from "./MusicSource/PartListEntry";
 import {VerticalSourceStaffEntryContainer} from "./VoiceData/VerticalSourceStaffEntryContainer";
 import {Voice} from "./VoiceData/Voice";
 import {MusicSheetErrors} from "../Common/DataObjects/MusicSheetErrors";
@@ -32,7 +29,7 @@ import {MultiTempoExpression} from "./VoiceData/Expressions/multiTempoExpression
 // FIXME Andrea: Commented out some things, have a look at (*)
 
 export class PlaybackSettings {
-    public Rhythm: Fraction;
+    public rhythm: Fraction;
 }
 
 
@@ -44,14 +41,14 @@ export class MusicSheet /*implements ISettableMusicSheet, IComparable<MusicSheet
         //     console.log("MusicSheet Error: EngravingRules");
         // }
         // (*) this.playbackSettings = new PlaybackSettings(new Fraction(4, 4, false), 100);
-        this.UserStartTempoInBPM = 100;
-        this.PageWidth = 120;
+        this.userStartTempoInBPM = 100;
+        this.pageWidth = 120;
         this.MusicPartManager = new MusicPartManager(this);
     }
     public static defaultTitle: string = "[kein Titel]";
 
-    public UserStartTempoInBPM: number;
-    public PageWidth: number;
+    public userStartTempoInBPM: number;
+    public pageWidth: number;
 
     //private idString: string = "kjgdfuilhsda�oihfsvjh";
     private sourceMeasures: SourceMeasure[] = [];
@@ -81,15 +78,10 @@ export class MusicSheet /*implements ISettableMusicSheet, IComparable<MusicSheet
     private currentEnrolledPosition: Fraction = new Fraction(0, 1);
     // (*) private musicSheetParameterObject: MusicSheetParameterObject = undefined;
     // (*) private engravingRules: EngravingRules;
-    // (*) private phonicScoreInterface: IPhonicScoreInterface;
     // (*) private musicSheetParameterChangedDelegate: MusicSheetParameterChangedDelegate;
-
-    // (*) public get PhonicScoreInterface(): IPhonicScoreInterface {
-    //     return this.phonicScoreInterface;
-    // }
-    // public set PhonicScoreInterface(value: IPhonicScoreInterface) {
-    //     this.phonicScoreInterface = value;
-    // }
+    public static getIndexFromStaff(staff: Staff): number {
+        return staff.idInMusicSheet;
+    }
     public get SourceMeasures(): SourceMeasure[] {
         return this.sourceMeasures;
     }
@@ -137,7 +129,7 @@ export class MusicSheet /*implements ISettableMusicSheet, IComparable<MusicSheet
     }
     public InitializeStartTempoInBPM(startTempo: number): void {
         // (*) this.playbackSettings.BeatsPerMinute = startTempo;
-        this.UserStartTempoInBPM = startTempo;
+        this.userStartTempoInBPM = startTempo;
     }
     public get DefaultStartTempoInBpm(): number {
         return this.defaultStartTempoInBpm;
@@ -239,7 +231,7 @@ export class MusicSheet /*implements ISettableMusicSheet, IComparable<MusicSheet
     //}
     public addMeasure(measure: SourceMeasure): void {
         this.SourceMeasures.push(measure);
-        measure.MeasureListIndex = this.SourceMeasures.length - 1;
+        measure.measureListIndex = this.SourceMeasures.length - 1;
     }
     public checkForInstrumentWithNoVoice(): void {
         for (let idx: number = 0, len: number = this.instruments.length; idx < len; ++idx) {
@@ -257,16 +249,13 @@ export class MusicSheet /*implements ISettableMusicSheet, IComparable<MusicSheet
             return undefined;
         }
     }
-    public static getIndexFromStaff(staff: Staff): number {
-        return staff.IdInMusicSheet;
-    }
     public fillStaffList(): void {
         let i: number = 0;
         for (let idx: number = 0, len: number = this.instruments.length; idx < len; ++idx) {
             let instrument: Instrument = this.instruments[idx];
             for (let idx2: number = 0, len2: number = instrument.Staves.length; idx2 < len2; ++idx2) {
                 let staff: Staff = instrument.Staves[idx2];
-                staff.IdInMusicSheet = i;
+                staff.idInMusicSheet = i;
                 this.staves.push(staff);
                 i++;
             }
@@ -279,12 +268,12 @@ export class MusicSheet /*implements ISettableMusicSheet, IComparable<MusicSheet
         this.musicPartManager = value;
     }
     public getCompleteNumberOfStaves(): number {
-        let number: number = 0;
+        let num: number = 0;
         for (let idx: number = 0, len: number = this.instruments.length; idx < len; ++idx) {
             let instrument: Instrument = this.instruments[idx];
-            number += instrument.Staves.length;
+            num += instrument.Staves.length;
         }
-        return number;
+        return num;
     }
     public getListOfMeasuresFromIndeces(start: number, end: number): SourceMeasure[] {
         let measures: SourceMeasure[] = [];
@@ -393,7 +382,7 @@ export class MusicSheet /*implements ISettableMusicSheet, IComparable<MusicSheet
     //    return this.UserStartTempoInBPM;
     //}
     public get Errors(): { [n: number]: string[]; } {
-        return this.musicSheetErrors.MeasureErrors;
+        return this.musicSheetErrors.measureErrors;
     }
     public get FirstMeasureNumber(): number {
         try {

+ 6 - 7
src/MusicalScore/MusicSource/PartListEntry.ts

@@ -7,14 +7,13 @@ export class PartListEntry {
         this.musicSheet = musicSheet;
     }
 
-    public AbsoluteTimestamp: Fraction;
-    public StartIndex: number;
-    public EndIndex: number;
+    public absoluteTimestamp: Fraction;
+    public startIndex: number;
+    public endIndex: number;
 
     protected enrolledTimestamps: Fraction[] = [];
     protected visible: boolean = true;
-
-    private musicSheet: MusicSheet;
+    protected musicSheet: MusicSheet;
 
     public get Visible(): boolean {
         return this.visible;
@@ -23,9 +22,9 @@ export class PartListEntry {
         this.visible = value;
     }
     public getFirstSourceMeasure(): SourceMeasure {
-        return this.musicSheet.SourceMeasures[this.StartIndex];
+        return this.musicSheet.SourceMeasures[this.startIndex];
     }
     public getLastSourceMeasure(): SourceMeasure {
-        return this.musicSheet.SourceMeasures[this.EndIndex];
+        return this.musicSheet.SourceMeasures[this.endIndex];
     }
 }

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

@@ -13,9 +13,9 @@ export class Repetition extends PartListEntry /*implements IRepetition*/ {
         this.virtualOverallRepetition = virtualOverallRepetition;
     }
 
-    public StartMarker: RepetitionInstruction;
-    public EndMarker: RepetitionInstruction;
-    public ForwardJumpInstruction: RepetitionInstruction;
+    public startMarker: RepetitionInstruction;
+    public endMarker: RepetitionInstruction;
+    public forwardJumpInstruction: RepetitionInstruction;
 
     private backwardJumpInstructions: RepetitionInstruction[] = [];
     private endingParts: RepetitionEndingPart[] = [];
@@ -71,7 +71,7 @@ export class Repetition extends PartListEntry /*implements IRepetition*/ {
         return -1;
     }
     public getBackwardJumpTarget(): number {
-        return this.StartMarker.MeasureIndex;
+        return this.startMarker.measureIndex;
     }
     public SetEndingStartIndex(endingNumbers: number[], startIndex: number): void {
         let part: RepetitionEndingPart = new RepetitionEndingPart(new SourceMusicPart(this.musicSheet2, startIndex, startIndex));
@@ -113,16 +113,16 @@ 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.CreateFractionFromFraction(this.musicSheet2.SourceMeasures[this.startMarker.measureIndex].AbsoluteTimestamp);
     }
     public get StartIndex(): number {
-        return this.StartMarker.MeasureIndex;
+        return this.startMarker.measureIndex;
     }
     public get EndIndex(): number {
         if (this.BackwardJumpInstructions.length === 0) {
             return this.StartIndex;
         }
-        let result: number = this.backwardJumpInstructions[this.backwardJumpInstructions.length - 1].MeasureIndex;
+        let result: number = this.backwardJumpInstructions[this.backwardJumpInstructions.length - 1].measureIndex;
         if (this.endingIndexDict[this.NumberOfEndings] !== undefined) {
             result = Math.max(this.endingIndexDict[this.NumberOfEndings].part.EndIndex, result);
         }

+ 7 - 5
src/MusicalScore/MusicSource/SourceMusicPart.ts

@@ -6,14 +6,16 @@ import {MusicSheet} from "../MusicSheet";
 export class SourceMusicPart extends PartListEntry {
     constructor(musicSheet: MusicSheet, startIndex?: number, endIndex?: number) {
         super(musicSheet);
-        this.musicSheet2 = musicSheet;
+        this.musicSheet = musicSheet;
         this.startIndex = startIndex;
         this.endIndex = endIndex;
     }
-    protected musicSheet2: MusicSheet;
+
+    //protected musicSheet: MusicSheet;
     protected parentRepetition: Repetition;
-    private startIndex: number;
-    private endIndex: number;
+    //private startIndex: number;
+    //private endIndex: number;
+
     public get MeasuresCount(): number {
         return this.endIndex - this.startIndex + 1;
     }
@@ -30,7 +32,7 @@ export class SourceMusicPart extends PartListEntry {
         this.parentRepetition = value;
     }
     public get AbsoluteTimestamp(): Fraction {
-        return Fraction.CreateFractionFromFraction(this.musicSheet2.SourceMeasures[this.startIndex].AbsoluteTimestamp);
+        return Fraction.CreateFractionFromFraction(this.musicSheet.SourceMeasures[this.startIndex].AbsoluteTimestamp);
     }
     public setStartIndex(startIndex: number): void {
         this.startIndex = startIndex;

+ 91 - 91
src/MusicalScore/ScoreIO/InstrumentReader.ts

@@ -113,18 +113,18 @@ export class InstrumentReader {
     this.maxTieNoteFraction = new Fraction(0, 1);
     let lastNoteWasGrace: boolean = false;
     try {
-      let xmlMeasureListArr: IXmlElement[] = this.xmlMeasureList[this.currentXmlMeasureIndex].Elements();
+      let xmlMeasureListArr: IXmlElement[] = this.xmlMeasureList[this.currentXmlMeasureIndex].elements();
       for (let idx: number = 0, len: number = xmlMeasureListArr.length; idx < len; ++idx) {
         let xmlNode: IXmlElement = xmlMeasureListArr[idx];
-        if (xmlNode.Name === "note") {
-          if ((xmlNode.HasAttributes && xmlNode.Attribute("print-object") !== undefined && xmlNode.Attribute("print-spacing") !== undefined)) {
+        if (xmlNode.name === "note") {
+          if ((xmlNode.hasAttributes && xmlNode.attribute("print-object") !== undefined && xmlNode.attribute("print-spacing") !== undefined)) {
             continue;
           }
           let noteStaff: number = 1;
           if (this.instrument.Staves.length > 1) {
             try {
-              if (xmlNode.Element("staff") !== undefined) {
-                noteStaff = parseInt(xmlNode.Element("staff").Value);
+              if (xmlNode.element("staff") !== undefined) {
+                noteStaff = parseInt(xmlNode.element("staff").value);
               }
             } catch (ex) {
               logging.debug("InstrumentReader.readNextXmlMeasure.get staff number", ex);
@@ -133,9 +133,9 @@ export class InstrumentReader {
 
           }
           this.currentStaff = this.instrument.Staves[noteStaff - 1];
-          let isChord: boolean = xmlNode.Element("chord") !== undefined;
-          if (xmlNode.Element("voice") !== undefined) {
-            let noteVoice: number = parseInt(xmlNode.Element("voice").Value);
+          let isChord: boolean = xmlNode.element("chord") !== undefined;
+          if (xmlNode.element("voice") !== undefined) {
+            let noteVoice: number = parseInt(xmlNode.element("voice").value);
             this.currentVoiceGenerator = this.getOrCreateVoiceGenerator(noteVoice, noteStaff - 1);
           } else {
             if (!isChord || this.currentVoiceGenerator === undefined) {
@@ -145,14 +145,14 @@ export class InstrumentReader {
           let noteDivisions: number = 0;
           let noteDuration: Fraction = new Fraction(0, 1);
           let isTuplet: boolean = false;
-          if (xmlNode.Element("duration") !== undefined) {
+          if (xmlNode.element("duration") !== undefined) {
             try {
-              noteDivisions = parseInt(xmlNode.Element("duration").Value);
+              noteDivisions = parseInt(xmlNode.element("duration").value);
               noteDuration = new Fraction(noteDivisions, 4 * this.divisions);
               if (noteDivisions === 0) {
                 noteDuration = this.getNoteDurationFromTypeNode(xmlNode);
               }
-              if (xmlNode.Element("time-modification") !== undefined) {
+              if (xmlNode.element("time-modification") !== undefined) {
                 noteDuration = this.getNoteDurationForTuplet(xmlNode);
                 isTuplet = true;
               }
@@ -164,8 +164,8 @@ export class InstrumentReader {
             }
 
           }
-          let restNote: boolean = xmlNode.Element("rest") !== undefined;
-          let isGraceNote: boolean = xmlNode.Element("grace") !== undefined || noteDivisions === 0 || isChord && lastNoteWasGrace;
+          let restNote: boolean = xmlNode.element("rest") !== undefined;
+          let isGraceNote: boolean = xmlNode.element("grace") !== undefined || noteDivisions === 0 || isChord && lastNoteWasGrace;
           let musicTimestamp: Fraction = Fraction.CreateFractionFromFraction(currentFraction);
           if (isChord) {
             musicTimestamp = Fraction.CreateFractionFromFraction(previousFraction);
@@ -224,8 +224,8 @@ export class InstrumentReader {
             this.maxTieNoteFraction, isChord, guitarPro
             );
           }
-          let notationsNode: IXmlElement = xmlNode.Element("notations");
-          if (notationsNode !== undefined && notationsNode.Element("dynamics") !== undefined) {
+          let notationsNode: IXmlElement = xmlNode.element("notations");
+          if (notationsNode !== undefined && notationsNode.element("dynamics") !== undefined) {
             // (*) let expressionReader: ExpressionReader = this.expressionReaders[this.readExpressionStaffNumber(xmlNode) - 1];
             //if (expressionReader !== undefined) {
             //  expressionReader.readExpressionParameters(
@@ -237,11 +237,11 @@ export class InstrumentReader {
             //}
           }
           lastNoteWasGrace = isGraceNote;
-        } else if (xmlNode.Name === "attributes") {
-          let divisionsNode: IXmlElement = xmlNode.Element("divisions");
+        } else if (xmlNode.name === "attributes") {
+          let divisionsNode: IXmlElement = xmlNode.element("divisions");
           if (divisionsNode !== undefined) {
             try {
-              this.divisions = parseInt(divisionsNode.Value);
+              this.divisions = parseInt(divisionsNode.value);
             } catch (e) {
               let errorMsg: string = ITextTranslation.translateText("ReaderErrorMessages/DivisionError", "Invalid divisions value at Instrument: ");
               logging.debug("InstrumentReader.readNextXmlMeasure", errorMsg, e.toString());
@@ -256,7 +256,7 @@ export class InstrumentReader {
 
           }
           if (
-            xmlNode.Element("divisions") === undefined &&
+            xmlNode.element("divisions") === undefined &&
             this.divisions === 0 &&
             this.currentXmlMeasureIndex === 0
           ) {
@@ -276,11 +276,11 @@ export class InstrumentReader {
           if (this.isAttributesNodeAtEndOfMeasure(this.xmlMeasureList[this.currentXmlMeasureIndex], xmlNode)) {
             this.saveClefInstructionAtEndOfMeasure();
           }
-        } else if (xmlNode.Name === "forward") {
-          let forFraction: number = parseInt(xmlNode.Element("duration").Value);
+        } else if (xmlNode.name === "forward") {
+          let forFraction: number = parseInt(xmlNode.element("duration").value);
           currentFraction.Add(new Fraction(forFraction, 4 * this.divisions));
-        } else if (xmlNode.Name === "backup") {
-          let backFraction: number = parseInt(xmlNode.Element("duration").Value);
+        } else if (xmlNode.name === "backup") {
+          let backFraction: number = parseInt(xmlNode.element("duration").value);
           currentFraction.Sub(new Fraction(backFraction, 4 * this.divisions));
           if (currentFraction.Numerator < 0) {
             currentFraction = new Fraction(0, 1);
@@ -289,8 +289,8 @@ export class InstrumentReader {
           if (previousFraction.Numerator < 0) {
             previousFraction = new Fraction(0, 1);
           }
-        } else if (xmlNode.Name === "direction") {
-          let directionTypeNode: IXmlElement = xmlNode.Element("direction-type");
+        } else if (xmlNode.name === "direction") {
+          let directionTypeNode: IXmlElement = xmlNode.element("direction-type");
           // (*) MetronomeReader.readMetronomeInstructions(xmlNode, this.musicSheet, this.currentXmlMeasureIndex);
           let relativePositionInMeasure: number = Math.min(1, currentFraction.RealValue);
           if (this.activeRhythm !== undefined && this.activeRhythm.Rhythm !== undefined) {
@@ -307,7 +307,7 @@ export class InstrumentReader {
           //    expressionReader = this.expressionReaders[staffIndex];
           //  }
           //  if (expressionReader !== undefined) {
-          //    if (directionTypeNode.Element("octave-shift") !== undefined) {
+          //    if (directionTypeNode.element("octave-shift") !== undefined) {
           //      expressionReader.readExpressionParameters(
           //        xmlNode, this.instrument, this.divisions, currentFraction, previousFraction, this.currentMeasure.MeasureNumber, true
           //      );
@@ -319,19 +319,19 @@ export class InstrumentReader {
           //    expressionReader.read(xmlNode, this.currentMeasure, currentFraction);
           //  }
           //}
-        } else if (xmlNode.Name === "barline") {
+        } else if (xmlNode.name === "barline") {
           // (*)
           //if (this.repetitionInstructionReader !== undefined) {
           //  let measureEndsSystem: boolean = false;
           //  this.repetitionInstructionReader.handleLineRepetitionInstructions(xmlNode, measureEndsSystem);
           //  if (measureEndsSystem) {
           //    this.currentMeasure.BreakSystemAfter = true;
-          //    this.currentMeasure.EndsPiece = true;
+          //    this.currentMeasure.endsPiece = true;
           //  }
           //}
-        } else if (xmlNode.Name === "sound") {
+        } else if (xmlNode.name === "sound") {
           // (*) MetronomeReader.readTempoInstruction(xmlNode, this.musicSheet, this.currentXmlMeasureIndex);
-        } else if (xmlNode.Name === "harmony") {
+        } else if (xmlNode.name === "harmony") {
           // (*) this.openChordSymbolContainer = ChordSymbolReader.readChordSymbol(xmlNode, this.musicSheet, this.activeKey);
         }
       }
@@ -454,14 +454,14 @@ export class InstrumentReader {
     }
   }
   private isAttributesNodeAtBeginOfMeasure(parentNode: IXmlElement, attributesNode: IXmlElement): boolean {
-    let children: IXmlElement[] = parentNode.Elements().slice();
+    let children: IXmlElement[] = parentNode.elements().slice();
     let attributesNodeIndex: number = children.indexOf(attributesNode); // FIXME | 0
-    if (attributesNodeIndex > 0 && children[attributesNodeIndex - 1].Name === "backup") {
+    if (attributesNodeIndex > 0 && children[attributesNodeIndex - 1].name === "backup") {
       return true;
     }
     let firstNoteNodeIndex: number = -1;
     for (let i: number = 0; i < children.length; i++) {
-      if (children[i].Name === "note") {
+      if (children[i].name === "note") {
         firstNoteNodeIndex = i;
         break;
       }
@@ -469,7 +469,7 @@ export class InstrumentReader {
     return (attributesNodeIndex < firstNoteNodeIndex && firstNoteNodeIndex > 0) || (firstNoteNodeIndex < 0);
   }
   private isAttributesNodeAtEndOfMeasure(parentNode: IXmlElement, attributesNode: IXmlElement): boolean {
-    let childs: IXmlElement[] = parentNode.Elements().slice();
+    let childs: IXmlElement[] = parentNode.elements().slice();
     let attributesNodeIndex: number = 0;
     for (let i: number = 0; i < childs.length; i++) {
       if (childs[i] === attributesNode) {
@@ -479,7 +479,7 @@ export class InstrumentReader {
     }
     let nextNoteNodeIndex: number = 0;
     for (let i: number = attributesNodeIndex; i < childs.length; i++) {
-      if (childs[i].Name === "note") {
+      if (childs[i].name === "note") {
         nextNoteNodeIndex = i;
         break;
       }
@@ -487,27 +487,27 @@ export class InstrumentReader {
     return attributesNodeIndex > nextNoteNodeIndex;
   }
   private getNoteDurationFromTypeNode(xmlNode: IXmlElement): Fraction {
-    if (xmlNode.Element("type") !== undefined) {
-      let typeNode: IXmlElement = xmlNode.Element("type");
+    if (xmlNode.element("type") !== undefined) {
+      let typeNode: IXmlElement = xmlNode.element("type");
       if (typeNode !== undefined) {
-        let type: string = typeNode.Value;
+        let type: string = typeNode.value;
         return this.currentVoiceGenerator.getNoteDurationFromType(type);
       }
     }
     return new Fraction(0, 4 * this.divisions);
   }
   private addAbstractInstruction(node: IXmlElement, guitarPro: boolean): void {
-    if (node.Element("divisions") !== undefined) {
-      if (node.Elements().length === 1) { return; }
+    if (node.element("divisions") !== undefined) {
+      if (node.elements().length === 1) { return; }
     }
-    let transposeNode: IXmlElement = node.Element("transpose");
+    let transposeNode: IXmlElement = node.element("transpose");
     if (transposeNode !== undefined) {
-      let chromaticNode: IXmlElement = transposeNode.Element("chromatic");
+      let chromaticNode: IXmlElement = transposeNode.element("chromatic");
       if (chromaticNode !== undefined) {
-        this.instrument.PlaybackTranspose = parseInt(chromaticNode.Value);
+        this.instrument.PlaybackTranspose = parseInt(chromaticNode.value);
       }
     }
-    let clefList: IXmlElement[] = node.Elements("clef");
+    let clefList: IXmlElement[] = node.elements("clef");
     let errorMsg: string;
     if (clefList.length > 0) {
       for (let idx: number = 0, len: number = clefList.length; idx < len; ++idx) {
@@ -516,10 +516,10 @@ export class InstrumentReader {
         let line: number = 2;
         let staffNumber: number = 1;
         let clefOctaveOffset: number = 0;
-        let lineNode: IXmlElement = nodeList.Element("line");
+        let lineNode: IXmlElement = nodeList.element("line");
         if (lineNode !== undefined) {
           try {
-            line = parseInt(lineNode.Value);
+            line = parseInt(lineNode.value);
           } catch (ex) {
             errorMsg = ITextTranslation.translateText(
               "ReaderErrorMessages/ClefLineError",
@@ -531,10 +531,10 @@ export class InstrumentReader {
           }
 
         }
-        let signNode: IXmlElement = nodeList.Element("sign");
+        let signNode: IXmlElement = nodeList.element("sign");
         if (signNode !== undefined) {
           try {
-            // (*) clefEnum = <ClefEnum>Enum.Parse(/*typeof*/ClefEnum, signNode.Value);
+            // (*) clefEnum = <ClefEnum>Enum.Parse(/*typeof*/ClefEnum, signNode.value);
             if (!ClefInstruction.isSupportedClef(clefEnum)) {
               if (clefEnum === ClefEnum.TAB && guitarPro) {
                 clefOctaveOffset = -1;
@@ -559,10 +559,10 @@ export class InstrumentReader {
           }
 
         }
-        let clefOctaveNode: IXmlElement = nodeList.Element("clef-octave-change");
+        let clefOctaveNode: IXmlElement = nodeList.element("clef-octave-change");
         if (clefOctaveNode !== undefined) {
           try {
-            clefOctaveOffset = parseInt(clefOctaveNode.Value);
+            clefOctaveOffset = parseInt(clefOctaveNode.value);
           } catch (e) {
             errorMsg = ITextTranslation.translateText(
               "ReaderErrorMessages/ClefOctaveError",
@@ -573,9 +573,9 @@ export class InstrumentReader {
           }
 
         }
-        if (nodeList.HasAttributes && nodeList.Attributes()[0].Name === "number") {
+        if (nodeList.hasAttributes && nodeList.attributes()[0].name === "number") {
           try {
-            staffNumber = parseInt(nodeList.Attributes()[0].Value);
+            staffNumber = parseInt(nodeList.attributes()[0].value);
           } catch (err) {
             errorMsg = ITextTranslation.translateText(
               "ReaderErrorMessages/ClefError",
@@ -590,12 +590,12 @@ export class InstrumentReader {
         this.abstractInstructions[staffNumber] = clefInstruction;
       }
     }
-    if (node.Element("key") !== undefined && this.instrument.MidiInstrumentId !== MidiInstrument.Percussion) {
+    if (node.element("key") !== undefined && this.instrument.MidiInstrumentId !== MidiInstrument.Percussion) {
       let key: number = 0;
-      let keyNode: IXmlElement = node.Element("key").Element("fifths");
+      let keyNode: IXmlElement = node.element("key").element("fifths");
       if (keyNode !== undefined) {
         try {
-          key = <number>parseInt(keyNode.Value);
+          key = <number>parseInt(keyNode.value);
         } catch (ex) {
           let errorMsg: string = ITextTranslation.translateText(
             "ReaderErrorMessages/KeyError",
@@ -608,11 +608,11 @@ export class InstrumentReader {
 
       }
       let keyEnum: KeyEnum = KeyEnum.none;
-      let modeNode: IXmlElement = node.Element("key");
-      if (modeNode !== undefined) { modeNode = modeNode.Element("mode"); }
+      let modeNode: IXmlElement = node.element("key");
+      if (modeNode !== undefined) { modeNode = modeNode.element("mode"); }
       if (modeNode !== undefined) {
         try {
-          // (*) keyEnum = <KeyEnum>Enum.Parse(/*typeof*/KeyEnum, modeNode.Value);
+          // (*) keyEnum = <KeyEnum>Enum.Parse(/*typeof*/KeyEnum, modeNode.value);
         } catch (ex) {
           errorMsg = ITextTranslation.translateText(
             "ReaderErrorMessages/KeyError",
@@ -627,33 +627,33 @@ export class InstrumentReader {
       let keyInstruction: KeyInstruction = new KeyInstruction(undefined, key, keyEnum);
       this.abstractInstructions[1] = keyInstruction;
     }
-    if (node.Element("time") !== undefined) {
+    if (node.element("time") !== undefined) {
       let symbolEnum: RhythmSymbolEnum = RhythmSymbolEnum.NONE;
-      let timeNode: IXmlElement = node.Element("time");
+      let timeNode: IXmlElement = node.element("time");
       if (
         timeNode !== undefined &&
-        timeNode.HasAttributes &&
-        timeNode.Attributes() !== undefined
+        timeNode.hasAttributes &&
+        timeNode.attributes() !== undefined
       ) {
-        let firstAttr: IXmlAttribute = timeNode.Attributes()[0];
-        if (firstAttr.Name === "symbol") {
-          if (firstAttr.Value === "common") {
+        let firstAttr: IXmlAttribute = timeNode.attributes()[0];
+        if (firstAttr.name === "symbol") {
+          if (firstAttr.value === "common") {
             symbolEnum = RhythmSymbolEnum.COMMON;
-          } else if (firstAttr.Value === "cut") {
+          } else if (firstAttr.value === "cut") {
             symbolEnum = RhythmSymbolEnum.CUT;
           }
         }
       }
       let num: number = 0;
       let denom: number = 0;
-      let senzaMisura: boolean = (timeNode !== undefined && timeNode.Element("senza-misura") !== undefined);
-      let timeList: IXmlElement[] = node.Elements("time");
+      let senzaMisura: boolean = (timeNode !== undefined && timeNode.element("senza-misura") !== undefined);
+      let timeList: IXmlElement[] = node.elements("time");
       let beatsList: IXmlElement[] = [];
       let typeList: IXmlElement[] = [];
       for (let idx: number = 0, len: number = timeList.length; idx < len; ++idx) {
         let xmlNode: IXmlElement = timeList[idx];
-        beatsList.push.apply(beatsList, xmlNode.Elements("beats"));
-        typeList.push.apply(typeList, xmlNode.Elements("beat-type"));
+        beatsList.push.apply(beatsList, xmlNode.elements("beats"));
+        typeList.push.apply(typeList, xmlNode.elements("beat-type"));
       }
       if (!senzaMisura) {
         try {
@@ -662,7 +662,7 @@ export class InstrumentReader {
             let fractions: Fraction[] = new Array(length);
             let maxDenom: number = 0;
             for (let i: number = 0; i < length; i++) {
-              let s: string = beatsList[i].Value;
+              let s: string = beatsList[i].value;
               let n: number = 0;
               let d: number = 0;
               if (s.indexOf("+") !== -1) {
@@ -673,7 +673,7 @@ export class InstrumentReader {
               } else {
                 n = parseInt(s);
               }
-              d = parseInt(typeList[i].Value);
+              d = parseInt(typeList[i].value);
               maxDenom = Math.max(maxDenom, d);
               fractions[i] = new Fraction(n, d, false);
             }
@@ -686,8 +686,8 @@ export class InstrumentReader {
             }
             denom = maxDenom;
           } else {
-            num = parseInt(node.Element("time").Element("beats").Value);
-            denom = parseInt(node.Element("time").Element("beat-type").Value);
+            num = parseInt(node.element("time").element("beats").value);
+            denom = parseInt(node.element("time").element("beat-type").value);
           }
         } catch (ex) {
           errorMsg = ITextTranslation.translateText("ReaderErrorMessages/RhythmError", "Invalid rhythm found -> set to default.");
@@ -874,15 +874,15 @@ export class InstrumentReader {
   private getNoteDurationForTuplet(xmlNode: IXmlElement): Fraction {
     let duration: Fraction = new Fraction(0, 1);
     let typeDuration: Fraction = this.getNoteDurationFromTypeNode(xmlNode);
-    if (xmlNode.Element("time-modification") !== undefined) {
-      let time: IXmlElement = xmlNode.Element("time-modification");
+    if (xmlNode.element("time-modification") !== undefined) {
+      let time: IXmlElement = xmlNode.element("time-modification");
       if (time !== undefined) {
-        if (time.Element("actual-notes") !== undefined && time.Element("normal-notes") !== undefined) {
-          let actualNotes: IXmlElement = time.Element("actual-notes");
-          let normalNotes: IXmlElement = time.Element("normal-notes");
+        if (time.element("actual-notes") !== undefined && time.element("normal-notes") !== undefined) {
+          let actualNotes: IXmlElement = time.element("actual-notes");
+          let normalNotes: IXmlElement = time.element("normal-notes");
           if (actualNotes !== undefined && normalNotes !== undefined) {
-            let actual: number = parseInt(actualNotes.Value);
-            let normal: number = parseInt(normalNotes.Value);
+            let actual: number = parseInt(actualNotes.value);
+            let normal: number = parseInt(normalNotes.value);
             duration = new Fraction(normal * typeDuration.Numerator, actual * typeDuration.Denominator);
           }
         }
@@ -892,11 +892,11 @@ export class InstrumentReader {
   }
   private readExpressionStaffNumber(xmlNode: IXmlElement): number {
     let directionStaffNumber: number = 1;
-    if (xmlNode.Element("staff") !== undefined) {
-      let staffNode: IXmlElement = xmlNode.Element("staff");
+    if (xmlNode.element("staff") !== undefined) {
+      let staffNode: IXmlElement = xmlNode.element("staff");
       if (staffNode !== undefined) {
         try {
-          directionStaffNumber = parseInt(staffNode.Value);
+          directionStaffNumber = parseInt(staffNode.value);
         } catch (ex) {
           let errorMsg: string = ITextTranslation.translateText(
             "ReaderErrorMessages/ExpressionStaffError", "Invalid Expression staff number -> set to default."
@@ -915,18 +915,18 @@ export class InstrumentReader {
     let xmlMeasureIndex: number = this.currentXmlMeasureIndex;
     let read: boolean = false;
     while (!read) {
-      let xmlMeasureListArr: IXmlElement[] = this.xmlMeasureList[xmlMeasureIndex].Elements();
+      let xmlMeasureListArr: IXmlElement[] = this.xmlMeasureList[xmlMeasureIndex].elements();
       for (let idx: number = 0, len: number = xmlMeasureListArr.length; idx < len; ++idx) {
         let xmlNode: IXmlElement = xmlMeasureListArr[idx];
-        if (xmlNode.Name === "note" && xmlNode.Element("time-modification") === undefined) {
-          if (xmlNode.Element("duration") !== undefined && xmlNode.Element("type") !== undefined) {
-            let durationNode: IXmlElement = xmlNode.Element("duration");
-            let typeNode: IXmlElement = xmlNode.Element("type");
+        if (xmlNode.name === "note" && xmlNode.element("time-modification") === undefined) {
+          if (xmlNode.element("duration") !== undefined && xmlNode.element("type") !== undefined) {
+            let durationNode: IXmlElement = xmlNode.element("duration");
+            let typeNode: IXmlElement = xmlNode.element("type");
             if (durationNode !== undefined && typeNode !== undefined) {
-              let type: string = typeNode.Value;
+              let type: string = typeNode.value;
               let noteDuration: number = 0;
               try {
-                noteDuration = parseInt(durationNode.Value);
+                noteDuration = parseInt(durationNode.value);
               } catch (ex) {
                 logging.debug("InstrumentReader.readDivisionsFromNotes", ex);
                 continue;

+ 95 - 95
src/MusicalScore/ScoreIO/MusicSheetReader.ts

@@ -58,20 +58,20 @@ export class MusicSheetReader /*implements IMusicSheetReader*/ {
   //  if (root !== undefined) {
   //    this.pushSheetLabels(root, path);
   //    if (this.musicSheet.Title !== undefined) {
-  //      sheetObject.Title = this.musicSheet.Title.Text;
+  //      sheetObject.Title = this.musicSheet.Title.text;
   //    }
   //    if (this.musicSheet.Composer !== undefined) {
-  //      sheetObject.Composer = this.musicSheet.Composer.Text;
+  //      sheetObject.Composer = this.musicSheet.Composer.text;
   //    }
   //    if (this.musicSheet.Lyricist !== undefined) {
-  //      sheetObject.Lyricist = this.musicSheet.Lyricist.Text;
+  //      sheetObject.Lyricist = this.musicSheet.Lyricist.text;
   //    }
-  //    let partlistNode: IXmlElement = root.Element("part-list");
-  //    let partList: IXmlElement[] = partlistNode.Elements();
+  //    let partlistNode: IXmlElement = root.element("part-list");
+  //    let partList: IXmlElement[] = partlistNode.elements();
   //    this.createInstrumentGroups(partList);
   //    for (let idx: number = 0, len: number = this.musicSheet.Instruments.length; idx < len; ++idx) {
   //      let instr: Instrument = this.musicSheet.Instruments[idx];
-  //      sheetObject.InstrumentList.push(__init(new MusicSheetParameterObject.LibrarySheetInstrument(), { Name: instr.Name }));
+  //      sheetObject.InstrumentList.push(__init(new MusicSheetParameterObject.LibrarySheetInstrument(), { name: instr.name }));
   //    }
   //  }
   //  return sheetObject;
@@ -103,26 +103,26 @@ export class MusicSheetReader /*implements IMusicSheetReader*/ {
     try {
       if (root !== undefined) {
         // this.pushSheetLabels(root, path); // FIXME Andrea
-        let partlistNode: IXmlElement = root.Element("part-list");
+        let partlistNode: IXmlElement = root.element("part-list");
         if (partlistNode !== undefined) {
-          let partInst: IXmlElement[] = root.Elements("part");
-          let partList: IXmlElement[] = partlistNode.Elements();
+          let partInst: IXmlElement[] = root.elements("part");
+          let partList: IXmlElement[] = partlistNode.elements();
           this.initializeReading(partList, partInst, instrumentReaders);
           let couldReadMeasure: boolean = true;
           this.currentFraction = new Fraction(0, 1);
           let guitarPro: boolean = false;
-          let encoding: IXmlElement = root.Element("identification");
+          let encoding: IXmlElement = root.element("identification");
           if (encoding !== undefined) {
-            encoding = encoding.Element("encoding");
+            encoding = encoding.element("encoding");
           }
           if (encoding !== undefined) {
-            encoding = encoding.Element("software");
+            encoding = encoding.element("software");
           }
-          if (encoding !== undefined && encoding.Value === "Guitar Pro 5") {
+          if (encoding !== undefined && encoding.value === "Guitar Pro 5") {
             guitarPro = true;
           }
           while (couldReadMeasure) {
-            if (this.currentMeasure !== undefined && this.currentMeasure.EndsPiece) {
+            if (this.currentMeasure !== undefined && this.currentMeasure.endsPiece) {
               sourceMeasureCounter = 0;
             }
             this.currentMeasure = new SourceMeasure(this.completeNumberOfStaves);
@@ -193,12 +193,12 @@ export class MusicSheetReader /*implements IMusicSheetReader*/ {
     let partInstArr: IXmlElement[] = partInst.slice();
     for (let idx: number = 0, len: number = partInstArr.length; idx < len; ++idx) {
       let node: IXmlElement = partInstArr[idx];
-      if (node.Attribute("id") !== undefined) {
-        let idNode: IXmlAttribute = node.Attribute("id");
+      if (node.attribute("id") !== undefined) {
+        let idNode: IXmlAttribute = node.attribute("id");
         if (idNode !== undefined) {
-          let partInstId: string = idNode.Value;
+          let partInstId: string = idNode.value;
           let currentInstrument: Instrument = instrumentDict[partInstId];
-          let xmlMeasureList: IXmlElement[] = node.Elements("measure");
+          let xmlMeasureList: IXmlElement[] = node.elements("measure");
           let instrumentNumberOfStaves: number = 1;
           try {
             instrumentNumberOfStaves = this.getInstrumentNumberOfStavesFromXml(node);
@@ -438,25 +438,25 @@ export class MusicSheetReader /*implements IMusicSheetReader*/ {
   }
   // Checks whether _elem_ has an attribute with value _val_.
   private presentAttrsWithValue(elem: IXmlElement, val: string): boolean {
-    for (let attr of elem.Attributes()) {
-      if (attr.Value === val) { return true; }
+    for (let attr of elem.attributes()) {
+      if (attr.value === val) { return true; }
     }
     return false;
   }
 
   private readComposer(root: IXmlElement): void {
-    let identificationNode: IXmlElement = root.Element("identification");
+    let identificationNode: IXmlElement = root.element("identification");
     if (identificationNode !== undefined) {
-      let creators: IXmlElement[] = identificationNode.Elements("creator");
+      let creators: IXmlElement[] = identificationNode.elements("creator");
       for (let idx: number = 0, len: number = creators.length; idx < len; ++idx) {
         let creator: IXmlElement = creators[idx];
-        if (creator.HasAttributes) {
+        if (creator.hasAttributes) {
           if (this.presentAttrsWithValue(creator, "composer")) {
-            this.musicSheet.Composer = new Label(this.trimString(creator.Value));
+            this.musicSheet.Composer = new Label(this.trimString(creator.value));
             continue;
           }
           if (this.presentAttrsWithValue(creator, "lyricist") || this.presentAttrsWithValue(creator, "poet")) {
-            this.musicSheet.Lyricist = new Label(this.trimString(creator.Value));
+            this.musicSheet.Lyricist = new Label(this.trimString(creator.value));
           }
         }
       }
@@ -470,27 +470,27 @@ export class MusicSheetReader /*implements IMusicSheetReader*/ {
     let largestCreditYInfo: number = 0;
     let finalSubtitle: string = undefined;
     let possibleTitle: string = undefined;
-    let creditElements: IXmlElement[] = root.Elements("credit");
+    let creditElements: IXmlElement[] = root.elements("credit");
     for (let idx: number = 0, len: number = creditElements.length; idx < len; ++idx) {
       let credit: IXmlElement = creditElements[idx];
-      if (credit.Attribute("page") === undefined) { return; }
-      if (credit.Attribute("page").Value === "1") {
+      if (credit.attribute("page") === undefined) { return; }
+      if (credit.attribute("page").value === "1") {
         let creditChild: IXmlElement = undefined;
         if (credit !== undefined) {
-          creditChild = credit.Element("credit-words");
-          if (creditChild.Attribute("justify") === undefined) {
+          creditChild = credit.element("credit-words");
+          if (creditChild.attribute("justify") === undefined) {
             break;
           }
-          let creditJustify: string = creditChild.Attribute("justify").Value;
-          let creditY: string = creditChild.Attribute("default-y").Value;
+          let creditJustify: string = creditChild.attribute("justify").value;
+          let creditY: string = creditChild.attribute("default-y").value;
           let creditYInfo: number = parseFloat(creditY);
           if (creditYInfo > systemYCoordinates) {
             if (this.musicSheet.Title === undefined) {
-              let creditSize: string = creditChild.Attribute("font-size").Value;
+              let creditSize: string = creditChild.attribute("font-size").value;
               let titleCreditSizeInt: number = parseFloat(creditSize);
               if (largestTitleCreditSize < titleCreditSizeInt) {
                 largestTitleCreditSize = titleCreditSizeInt;
-                finalTitle = creditChild.Value;
+                finalTitle = creditChild.value;
               }
             }
             if (this.musicSheet.Subtitle === undefined) {
@@ -499,9 +499,9 @@ export class MusicSheetReader /*implements IMusicSheetReader*/ {
                   largestCreditYInfo = creditYInfo;
                   if (possibleTitle) {
                     finalSubtitle = possibleTitle;
-                    possibleTitle = creditChild.Value;
+                    possibleTitle = creditChild.value;
                   } else {
-                    possibleTitle = creditChild.Value;
+                    possibleTitle = creditChild.value;
                   }
                 }
               }
@@ -509,10 +509,10 @@ export class MusicSheetReader /*implements IMusicSheetReader*/ {
             if (!(this.musicSheet.Composer !== undefined && this.musicSheet.Lyricist !== undefined)) {
               switch (creditJustify) {
                 case "right":
-                  this.musicSheet.Composer = new Label(this.trimString(creditChild.Value));
+                  this.musicSheet.Composer = new Label(this.trimString(creditChild.value));
                   break;
                 case "left":
-                  this.musicSheet.Lyricist = new Label(this.trimString(creditChild.Value));
+                  this.musicSheet.Lyricist = new Label(this.trimString(creditChild.value));
                   break;
                 default: break;
               }
@@ -529,25 +529,25 @@ export class MusicSheetReader /*implements IMusicSheetReader*/ {
     }
   }
   private computeSystemYCoordinates(root: IXmlElement): number {
-    if (root.Element("defaults") === undefined) {
+    if (root.element("defaults") === undefined) {
       return 0;
     }
     let paperHeight: number = 0;
     let topSystemDistance: number = 0;
-    let defi: string = root.Element("defaults").Element("page-layout").Element("page-height").Value;
+    let defi: string = root.element("defaults").element("page-layout").element("page-height").value;
     paperHeight = parseFloat(defi);
     let found: boolean = false;
-    let parts: IXmlElement[] = root.Elements("part");
+    let parts: IXmlElement[] = root.elements("part");
     for (let idx: number = 0, len: number = parts.length; idx < len; ++idx) {
-      let measures: IXmlElement[] = parts[idx].Elements("measure");
+      let measures: IXmlElement[] = parts[idx].elements("measure");
       for (let idx2: number = 0, len2: number = measures.length; idx2 < len2; ++idx2) {
         let measure: IXmlElement = measures[idx2];
-        if (measure.Element("print") !== undefined) {
-          let systemLayouts: IXmlElement[] = measure.Element("print").Elements("system-layout");
+        if (measure.element("print") !== undefined) {
+          let systemLayouts: IXmlElement[] = measure.element("print").elements("system-layout");
           for (let idx3: number = 0, len3: number = systemLayouts.length; idx3 < len3; ++idx3) {
             let syslab: IXmlElement = systemLayouts[idx3];
-            if (syslab.Element("top-system-distance") !== undefined) {
-              let topSystemDistanceString: string = syslab.Element("top-system-distance").Value;
+            if (syslab.element("top-system-distance") !== undefined) {
+              let topSystemDistanceString: string = syslab.element("top-system-distance").value;
               topSystemDistance = parseFloat(topSystemDistanceString);
               found = true;
               break;
@@ -558,10 +558,10 @@ export class MusicSheetReader /*implements IMusicSheetReader*/ {
       }
       if (found) { break; }
     }
-    if (root.Element("defaults").Element("system-layout") !== undefined) {
-      let syslay: IXmlElement = root.Element("defaults").Element("system-layout");
-      if (syslay.Element("top-system-distance") !== undefined) {
-        let topSystemDistanceString: string = root.Element("defaults").Element("system-layout").Element("top-system-distance").Value;
+    if (root.element("defaults").element("system-layout") !== undefined) {
+      let syslay: IXmlElement = root.element("defaults").element("system-layout");
+      if (syslay.element("top-system-distance") !== undefined) {
+        let topSystemDistanceString: string = root.element("defaults").element("system-layout").element("top-system-distance").value;
         topSystemDistance = parseFloat(topSystemDistanceString);
       }
     }
@@ -569,27 +569,27 @@ export class MusicSheetReader /*implements IMusicSheetReader*/ {
     return paperHeight - topSystemDistance;
   }
   private readTitle(root: IXmlElement): void {
-    let titleNode: IXmlElement = root.Element("work");
+    let titleNode: IXmlElement = root.element("work");
     let titleNodeChild: IXmlElement = undefined;
     if (titleNode !== undefined) {
-      titleNodeChild = titleNode.Element("work-title");
-      if (titleNodeChild !== undefined && titleNodeChild.Value) {
-        this.musicSheet.Title = new Label(this.trimString(titleNodeChild.Value));
+      titleNodeChild = titleNode.element("work-title");
+      if (titleNodeChild !== undefined && titleNodeChild.value) {
+        this.musicSheet.Title = new Label(this.trimString(titleNodeChild.value));
       }
     }
-    let movementNode: IXmlElement = root.Element("movement-title");
+    let movementNode: IXmlElement = root.element("movement-title");
     let finalSubTitle: string = "";
     if (movementNode !== undefined) {
       if (this.musicSheet.Title === undefined) {
-        this.musicSheet.Title = new Label(this.trimString(movementNode.Value));
+        this.musicSheet.Title = new Label(this.trimString(movementNode.value));
       } else {
-        finalSubTitle = this.trimString(movementNode.Value);
+        finalSubTitle = this.trimString(movementNode.value);
       }
     }
     if (titleNode !== undefined) {
-      let subtitleNodeChild: IXmlElement = titleNode.Element("work-number");
+      let subtitleNodeChild: IXmlElement = titleNode.element("work-number");
       if (subtitleNodeChild !== undefined) {
-        let workNumber: string = subtitleNodeChild.Value;
+        let workNumber: string = subtitleNodeChild.value;
         if (workNumber) {
           if (finalSubTitle) {
             finalSubTitle = workNumber;
@@ -612,60 +612,60 @@ export class MusicSheetReader /*implements IMusicSheetReader*/ {
       let entryArray: IXmlElement[] = entryList;
       for (let idx: number = 0, len: number = entryArray.length; idx < len; ++idx) {
         let node: IXmlElement = entryArray[idx];
-        if (node.Name === "score-part") {
-          let instrIdString: string = node.Attribute("id").Value;
+        if (node.name === "score-part") {
+          let instrIdString: string = node.attribute("id").value;
           let instrument: Instrument = new Instrument(instrumentId, instrIdString, this.musicSheet, currentGroup);
           instrumentId++;
-          let partElements: IXmlElement[] = node.Elements();
+          let partElements: IXmlElement[] = node.elements();
           for (let idx2: number = 0, len2: number = partElements.length; idx2 < len2; ++idx2) {
             let partElement: IXmlElement = partElements[idx2];
             try {
-              if (partElement.Name === "part-name") {
-                instrument.Name = partElement.Value;
-              } else if (partElement.Name === "score-instrument") {
+              if (partElement.name === "part-name") {
+                instrument.Name = partElement.value;
+              } else if (partElement.name === "score-instrument") {
                 let subInstrument: SubInstrument = new SubInstrument(instrument);
-                subInstrument.IdString = partElement.FirstAttribute.Value;
+                subInstrument.idString = partElement.firstAttribute.value;
                 instrument.SubInstruments.push(subInstrument);
-                let subElement: IXmlElement = partElement.Element("instrument-name");
+                let subElement: IXmlElement = partElement.element("instrument-name");
                 if (subElement !== undefined) {
-                  subInstrument.Name = subElement.Value;
-                  subInstrument.setMidiInstrument(subElement.Value);
+                  subInstrument.name = subElement.value;
+                  subInstrument.setMidiInstrument(subElement.value);
                 }
-              } else if (partElement.Name === "midi-instrument") {
-                let subInstrument: SubInstrument = instrument.getSubInstrument(partElement.FirstAttribute.Value);
+              } else if (partElement.name === "midi-instrument") {
+                let subInstrument: SubInstrument = instrument.getSubInstrument(partElement.firstAttribute.value);
                 for (let idx3: number = 0, len3: number = instrument.SubInstruments.length; idx3 < len3; ++idx3) {
                   let subInstr: SubInstrument = instrument.SubInstruments[idx3];
-                  if (subInstr.IdString === partElement.Value) {
+                  if (subInstr.idString === partElement.value) {
                     subInstrument = subInstr;
                     break;
                   }
                 }
-                let instrumentElements: IXmlElement[] = partElement.Elements();
+                let instrumentElements: IXmlElement[] = partElement.elements();
                 for (let idx3: number = 0, len3: number = instrumentElements.length; idx3 < len3; ++idx3) {
                   let instrumentElement: IXmlElement = instrumentElements[idx3];
                   try {
-                    if (instrumentElement.Name === "midi-channel") {
-                      if (parseInt(instrumentElement.Value) === 10) {
+                    if (instrumentElement.name === "midi-channel") {
+                      if (parseInt(instrumentElement.value) === 10) {
                         instrument.MidiInstrumentId = MidiInstrument.Percussion;
                       }
-                    } else if (instrumentElement.Name === "midi-program") {
+                    } else if (instrumentElement.name === "midi-program") {
                       if (instrument.SubInstruments.length > 0 && instrument.MidiInstrumentId !== MidiInstrument.Percussion) {
-                        subInstrument.MidiInstrumentId = <MidiInstrument>Math.max(0, parseInt(instrumentElement.Value) - 1);
+                        subInstrument.midiInstrumentID = <MidiInstrument>Math.max(0, parseInt(instrumentElement.value) - 1);
                       }
-                    } else if (instrumentElement.Name === "midi-unpitched") {
-                      subInstrument.FixedKey = Math.max(0, parseInt(instrumentElement.Value));
-                    } else if (instrumentElement.Name === "volume") {
+                    } else if (instrumentElement.name === "midi-unpitched") {
+                      subInstrument.fixedKey = Math.max(0, parseInt(instrumentElement.value));
+                    } else if (instrumentElement.name === "volume") {
                       try {
-                        let result: number = <number>parseFloat(instrumentElement.Value);
-                        subInstrument.Volume = result / 127.0;
+                        let result: number = <number>parseFloat(instrumentElement.value);
+                        subInstrument.volume = result / 127.0;
                       } catch (ex) {
                         logging.debug("ExpressionReader.readExpressionParameters", "read volume", ex);
                       }
 
-                    } else if (instrumentElement.Name === "pan") {
+                    } else if (instrumentElement.name === "pan") {
                       try {
-                        let result: number = <number>parseFloat(instrumentElement.Value);
-                        subInstrument.Pan = result / 64.0;
+                        let result: number = <number>parseFloat(instrumentElement.value);
+                        subInstrument.pan = result / 64.0;
                       } catch (ex) {
                         logging.debug("ExpressionReader.readExpressionParameters", "read pan", ex);
                       }
@@ -695,7 +695,7 @@ export class MusicSheetReader /*implements IMusicSheetReader*/ {
             this.musicSheet.Instruments.push(instrument);
           }
         } else {
-          if ((node.Name === "part-group") && (node.Attribute("type").Value === "start")) {
+          if ((node.name === "part-group") && (node.attribute("type").value === "start")) {
             let iG: InstrumentalGroup = new InstrumentalGroup("group", this.musicSheet, currentGroup);
             if (currentGroup !== undefined) {
               currentGroup.InstrumentalGroups.push(iG);
@@ -704,7 +704,7 @@ export class MusicSheetReader /*implements IMusicSheetReader*/ {
             }
             currentGroup = iG;
           } else {
-            if ((node.Name === "part-group") && (node.Attribute("type").Value === "stop")) {
+            if ((node.name === "part-group") && (node.attribute("type").value === "stop")) {
               if (currentGroup !== undefined) {
                 if (currentGroup.InstrumentalGroups.length === 1) {
                   let instr: InstrumentalGroup = currentGroup.InstrumentalGroups[0];
@@ -742,18 +742,18 @@ export class MusicSheetReader /*implements IMusicSheetReader*/ {
     let partInstArr: IXmlElement[] = partInst;
     for (let idx: number = 0, len: number = partInstArr.length; idx < len; ++idx) {
       let partNode: IXmlElement = partInstArr[idx];
-      let xmlMeasureList: IXmlElement[] = partNode.Elements("measure");
+      let xmlMeasureList: IXmlElement[] = partNode.elements("measure");
       if (xmlMeasureList !== undefined) {
         let xmlMeasure: IXmlElement = xmlMeasureList[0];
         if (xmlMeasure !== undefined) {
-          let stavesNode: IXmlElement = xmlMeasure.Element("attributes");
+          let stavesNode: IXmlElement = xmlMeasure.element("attributes");
           if (stavesNode !== undefined) {
-            stavesNode = stavesNode.Element("staves");
+            stavesNode = stavesNode.element("staves");
           }
           if (stavesNode === undefined) {
             number++;
           } else {
-            number += parseInt(stavesNode.Value);
+            number += parseInt(stavesNode.value);
           }
         }
       }
@@ -768,17 +768,17 @@ export class MusicSheetReader /*implements IMusicSheetReader*/ {
   }
   private getInstrumentNumberOfStavesFromXml(partNode: IXmlElement): number {
     let number: number = 0;
-    let xmlMeasure: IXmlElement = partNode.Element("measure");
+    let xmlMeasure: IXmlElement = partNode.element("measure");
     if (xmlMeasure !== undefined) {
-      let attributes: IXmlElement = xmlMeasure.Element("attributes");
+      let attributes: IXmlElement = xmlMeasure.element("attributes");
       let staves: IXmlElement = undefined;
       if (attributes !== undefined) {
-        staves = attributes.Element("staves");
+        staves = attributes.element("staves");
       }
       if (attributes === undefined || staves === undefined) {
         number = 1;
       } else {
-        number = parseInt(staves.Value);
+        number = parseInt(staves.value);
       }
     }
     if (number <= 0) {

+ 76 - 76
src/MusicalScore/ScoreIO/VoiceGenerator.ts

@@ -83,11 +83,11 @@ export class VoiceGenerator {
         try {
             this.currentNote = restNote ? this.addRestNote(noteDuration, divisions) : this.addSingleNote(noteNode, noteDuration, divisions, graceNote, chord, guitarPro);
             // (*)
-            //if (this.lyricsReader !== undefined && noteNode.Element("lyric") !== undefined) {
+            //if (this.lyricsReader !== undefined && noteNode.element("lyric") !== undefined) {
             //    this.lyricsReader.addLyricEntry(noteNode, this.currentVoiceEntry);
             //    this.voice.Parent.HasLyrics = true;
             //}
-            let notationNode: IXmlElement = noteNode.Element("notations");
+            let notationNode: IXmlElement = noteNode.element("notations");
             if (notationNode !== undefined) {
                 let articNode: IXmlElement = undefined;
                 // (*)
@@ -96,15 +96,15 @@ export class VoiceGenerator {
                 //}
                 //let slurNodes: IXmlElement[] = undefined;
                 // (*)
-                //if (this.slurReader !== undefined && (slurNodes = notationNode.Elements("slur")))
+                //if (this.slurReader !== undefined && (slurNodes = notationNode.elements("slur")))
                 //    this.slurReader.addSlur(slurNodes, this.currentNote);
                 let tupletNodeList: IXmlElement[] = undefined;
-                if ((tupletNodeList = notationNode.Elements("tuplet")))
+                if ((tupletNodeList = notationNode.elements("tuplet")))
                     this.openTupletNumber = this.addTuplet(noteNode, tupletNodeList);
-                if (notationNode.Element("arpeggiate") !== undefined && !graceNote)
+                if (notationNode.element("arpeggiate") !== undefined && !graceNote)
                     this.currentVoiceEntry.ArpeggiosNotesIndices.push(this.currentVoiceEntry.Notes.indexOf(this.currentNote));
                 let tiedNodeList: IXmlElement[] = undefined;
-                if ((tiedNodeList = notationNode.Elements("tied")))
+                if ((tiedNodeList = notationNode.elements("tied")))
                     this.addTie(tiedNodeList, measureStartAbsoluteTimestamp, maxTieNoteFraction);
 
                 let openTieDict: { [_: number]: Tie; } = this.openTieDict;
@@ -114,7 +114,7 @@ export class VoiceGenerator {
                         delete openTieDict[key];
                 }
             }
-            if (noteNode.Element("time-modification") !== undefined && notationNode === undefined) {
+            if (noteNode.element("time-modification") !== undefined && notationNode === undefined) {
                 this.handleTimeModificationNode(noteNode);
             }
         }
@@ -128,7 +128,7 @@ export class VoiceGenerator {
         return this.currentNote;
     }
     public checkForOpenGraceNotes(): void {
-        if (this.currentStaffEntry !== undefined && this.currentStaffEntry.VoiceEntries.length === 0 && this.currentVoiceEntry.GraceVoiceEntriesBefore !== undefined && this.currentVoiceEntry.GraceVoiceEntriesBefore.length > 0) {
+        if (this.currentStaffEntry !== undefined && this.currentStaffEntry.VoiceEntries.length === 0 && this.currentVoiceEntry.graceVoiceEntriesBefore !== undefined && this.currentVoiceEntry.graceVoiceEntriesBefore.length > 0) {
             let voice: Voice = this.currentVoiceEntry.ParentVoice;
             let horizontalIndex: number = this.currentMeasure.VerticalSourceStaffEntryContainers.indexOf(this.currentStaffEntry.VerticalContainerParent);
             let verticalIndex: number = this.currentStaffEntry.VerticalContainerParent.StaffEntries.indexOf(this.currentStaffEntry);
@@ -139,12 +139,12 @@ export class VoiceGenerator {
                     let voiceEntry: VoiceEntry = previousStaffEntry.VoiceEntries[idx];
                     if (voiceEntry.ParentVoice === voice) {
                         previousVoiceEntry = voiceEntry;
-                        previousVoiceEntry.GraceVoiceEntriesAfter = [];
-                        for (let idx2: number = 0, len2 = this.currentVoiceEntry.GraceVoiceEntriesBefore.length; idx2 < len2; ++idx2) {
-                            let graceVoiceEntry: VoiceEntry = this.currentVoiceEntry.GraceVoiceEntriesBefore[idx2];
-                            previousVoiceEntry.GraceVoiceEntriesAfter.push(graceVoiceEntry);
+                        previousVoiceEntry.graceVoiceEntriesAfter = [];
+                        for (let idx2: number = 0, len2 = this.currentVoiceEntry.graceVoiceEntriesBefore.length; idx2 < len2; ++idx2) {
+                            let graceVoiceEntry: VoiceEntry = this.currentVoiceEntry.graceVoiceEntriesBefore[idx2];
+                            previousVoiceEntry.graceVoiceEntriesAfter.push(graceVoiceEntry);
                         }
-                        this.currentVoiceEntry.GraceVoiceEntriesBefore = [];
+                        this.currentVoiceEntry.graceVoiceEntriesBefore = [];
                         this.currentStaffEntry = undefined;
                         break;
                     }
@@ -226,16 +226,16 @@ export class VoiceGenerator {
     // (*)
     //private readArticulations(notationNode: IXmlElement, currentVoiceEntry: VoiceEntry): void {
     //    let articNode: IXmlElement;
-    //    if ((articNode = notationNode.Element("articulations")) !== undefined)
+    //    if ((articNode = notationNode.element("articulations")) !== undefined)
     //        this.articulationReader.addArticulationExpression(articNode, currentVoiceEntry);
     //    let fermaNode: IXmlElement = undefined;
-    //    if ((fermaNode = notationNode.Element("fermata")) !== undefined)
+    //    if ((fermaNode = notationNode.element("fermata")) !== undefined)
     //        this.articulationReader.addFermata(fermaNode, currentVoiceEntry);
     //    let tecNode: IXmlElement = undefined;
-    //    if ((tecNode = notationNode.Element("technical")) !== undefined)
+    //    if ((tecNode = notationNode.element("technical")) !== undefined)
     //        this.articulationReader.addTechnicalArticulations(tecNode, currentVoiceEntry);
     //    let ornaNode: IXmlElement = undefined;
-    //    if ((ornaNode = notationNode.Element("ornaments")) !== undefined)
+    //    if ((ornaNode = notationNode.element("ornaments")) !== undefined)
     //        this.articulationReader.addOrnament(ornaNode, currentVoiceEntry);
     //}
     private addSingleNote(node: IXmlElement, noteDuration: number, divisions: number, graceNote: boolean, chord: boolean,
@@ -244,18 +244,18 @@ export class VoiceGenerator {
         let noteStep: NoteEnum = NoteEnum.C;
         let noteOctave: number = 0;
         let playbackInstrumentId: string = undefined;
-        let xmlnodeElementsArr: IXmlElement[] = node.Elements();
+        let xmlnodeElementsArr: IXmlElement[] = node.elements();
         for (let idx: number = 0, len = xmlnodeElementsArr.length; idx < len; ++idx) {
             let noteElement: IXmlElement = xmlnodeElementsArr[idx];
             try {
-                if (noteElement.Name === "pitch") {
-                    let noteElementsArr: IXmlElement[] = noteElement.Elements();
+                if (noteElement.name === "pitch") {
+                    let noteElementsArr: IXmlElement[] = noteElement.elements();
                     for (let idx2: number = 0, len2 = noteElementsArr.length; idx2 < len2; ++idx2) {
                         let pitchElement: IXmlElement = noteElementsArr[idx2];
                         try {
-                            if (pitchElement.Name === "step") {
+                            if (pitchElement.name === "step") {
                                 try {
-                                    switch (pitchElement.Value) {
+                                    switch (pitchElement.value) {
                                         case "C":
                                             {
                                                 noteStep = NoteEnum.C;
@@ -303,9 +303,9 @@ export class VoiceGenerator {
                                 }
 
                             }
-                            else if (pitchElement.Name === "alter") {
+                            else if (pitchElement.name === "alter") {
                                 try {
-                                    noteAlter = parseInt(pitchElement.Value);
+                                    noteAlter = parseInt(pitchElement.value);
                                 }
                                 catch (e) {
                                     let errorMsg: string = ITextTranslation.translateText("ReaderErrorMessages/NoteAlterationError",
@@ -315,9 +315,9 @@ export class VoiceGenerator {
                                 }
 
                             }
-                            else if (pitchElement.Name === "octave") {
+                            else if (pitchElement.name === "octave") {
                                 try {
-                                    noteOctave = parseInt(pitchElement.Value);
+                                    noteOctave = parseInt(pitchElement.value);
                                 }
                                 catch (e) {
                                     let errorMsg: string = ITextTranslation.translateText("ReaderErrorMessages/NoteOctaveError",
@@ -334,21 +334,21 @@ export class VoiceGenerator {
 
                     }
                 }
-                else if (noteElement.Name === "unpitched") {
+                else if (noteElement.name === "unpitched") {
                     let displayStep: IXmlElement = undefined;
-                    if ((displayStep = noteElement.Element("display-step")) !== undefined) {
-                        noteStep = NoteEnum[displayStep.Value.toUpperCase()];
+                    if ((displayStep = noteElement.element("display-step")) !== undefined) {
+                        noteStep = NoteEnum[displayStep.value.toUpperCase()];
                     }
                     let octave: IXmlElement = undefined;
-                    if ((octave = noteElement.Element("display-octave")) !== undefined) {
-                        noteOctave = parseInt(octave.Value);
+                    if ((octave = noteElement.element("display-octave")) !== undefined) {
+                        noteOctave = parseInt(octave.value);
                         if (guitarPro)
                             noteOctave += 1;
                     }
                 }
-                else if (noteElement.Name === "instrument") {
-                    if (noteElement.FirstAttribute !== undefined)
-                        playbackInstrumentId = noteElement.FirstAttribute.Value;
+                else if (noteElement.name === "instrument") {
+                    if (noteElement.firstAttribute !== undefined)
+                        playbackInstrumentId = noteElement.firstAttribute.value;
                 }
             }
             catch (ex) {
@@ -364,7 +364,7 @@ export class VoiceGenerator {
         if (!graceNote)
             this.currentVoiceEntry.Notes.push(note);
         else this.handleGraceNote(node, note);
-        if (node.Elements("beam") && !chord) {
+        if (node.elements("beam") && !chord) {
             this.createBeam(node, note, graceNote);
         }
         return note;
@@ -379,14 +379,14 @@ export class VoiceGenerator {
     }
     private createBeam(node: IXmlElement, note: Note, grace: boolean): void {
         try {
-            let beamNode: IXmlElement = node.Element("beam");
+            let beamNode: IXmlElement = node.element("beam");
             let beamAttr: IXmlAttribute = undefined;
-            if (beamNode !== undefined && beamNode.HasAttributes)
-                beamAttr = beamNode.Attribute("number");
+            if (beamNode !== undefined && beamNode.hasAttributes)
+                beamAttr = beamNode.attribute("number");
             if (beamAttr !== undefined) {
-                let beamNumber: number = parseInt(beamAttr.Value);
-                let mainBeamNode: IXmlElement[] = node.Elements("beam");
-                let currentBeamTag: string = mainBeamNode[0].Value;
+                let beamNumber: number = parseInt(beamAttr.value);
+                let mainBeamNode: IXmlElement[] = node.elements("beam");
+                let currentBeamTag: string = mainBeamNode[0].value;
                 if (beamNumber === 1 && mainBeamNode !== undefined) {
                     if (currentBeamTag === "begin" && this.lastBeamTag !== currentBeamTag) {
                         if (grace) {
@@ -481,10 +481,10 @@ export class VoiceGenerator {
     private handleGraceNote(node: IXmlElement, note: Note): void {
         let graceChord: boolean = false;
         let type: string = "";
-        if (node.Elements("type")) {
-            let typeNode: IXmlElement[] = node.Elements("type");
+        if (node.elements("type")) {
+            let typeNode: IXmlElement[] = node.elements("type");
             if (typeNode) {
-                type = typeNode[0].Value;
+                type = typeNode[0].value;
                 try {
                     note.Length = this.getNoteDurationFromType(type);
                     note.Length.Numerator = 1;
@@ -498,28 +498,28 @@ export class VoiceGenerator {
 
             }
         }
-        let graceNode: IXmlElement = node.Element("grace");
-        if (graceNode !== undefined && graceNode.Attributes()) {
-            if (graceNode.Attribute("slash") !== undefined) {
-                let slash: string = graceNode.Attribute("slash").Value;
+        let graceNode: IXmlElement = node.element("grace");
+        if (graceNode !== undefined && graceNode.attributes()) {
+            if (graceNode.attribute("slash") !== undefined) {
+                let slash: string = graceNode.attribute("slash").value;
                 if (slash === "yes")
                     note.GraceNoteSlash = true;
             }
         }
-        if (node.Element("chord") !== undefined)
+        if (node.element("chord") !== undefined)
             graceChord = true;
         let graceVoiceEntry: VoiceEntry = undefined;
         if (!graceChord) {
             graceVoiceEntry = new VoiceEntry(
                 new Fraction(0, 1), this.currentVoiceEntry.ParentVoice, this.currentStaffEntry
             );
-            if (this.currentVoiceEntry.GraceVoiceEntriesBefore === undefined)
-                this.currentVoiceEntry.GraceVoiceEntriesBefore = [];
-            this.currentVoiceEntry.GraceVoiceEntriesBefore.push(graceVoiceEntry);
+            if (this.currentVoiceEntry.graceVoiceEntriesBefore === undefined)
+                this.currentVoiceEntry.graceVoiceEntriesBefore = [];
+            this.currentVoiceEntry.graceVoiceEntriesBefore.push(graceVoiceEntry);
         }
         else {
-            if (this.currentVoiceEntry.GraceVoiceEntriesBefore !== undefined && this.currentVoiceEntry.GraceVoiceEntriesBefore.length > 0)
-                graceVoiceEntry = CollectionUtil.last(this.currentVoiceEntry.GraceVoiceEntriesBefore);
+            if (this.currentVoiceEntry.graceVoiceEntriesBefore !== undefined && this.currentVoiceEntry.graceVoiceEntriesBefore.length > 0)
+                graceVoiceEntry = CollectionUtil.last(this.currentVoiceEntry.graceVoiceEntriesBefore);
         }
         if (graceVoiceEntry !== undefined) {
             graceVoiceEntry.Notes.push(note);
@@ -528,22 +528,22 @@ export class VoiceGenerator {
     }
     private addTuplet(node: IXmlElement, tupletNodeList: IXmlElement[]): number {
         if (tupletNodeList !== undefined && tupletNodeList.length > 1) {
-            let timeModNode: IXmlElement = node.Element("time-modification");
+            let timeModNode: IXmlElement = node.element("time-modification");
             if (timeModNode !== undefined)
-                timeModNode = timeModNode.Element("actual-notes");
+                timeModNode = timeModNode.element("actual-notes");
             let tupletNodeListArr: IXmlElement[] = tupletNodeList;
             for (let idx: number = 0, len = tupletNodeListArr.length; idx < len; ++idx) {
                 let tupletNode: IXmlElement = tupletNodeListArr[idx];
-                if (tupletNode !== undefined && tupletNode.Attributes()) {
-                    let type: string = tupletNode.Attribute("type").Value;
+                if (tupletNode !== undefined && tupletNode.attributes()) {
+                    let type: string = tupletNode.attribute("type").value;
                     if (type === "start") {
                         let tupletNumber: number = 1;
-                        if (tupletNode.Attribute("nummber") !== undefined)
-                            tupletNumber = parseInt(tupletNode.Attribute("number").Value);
+                        if (tupletNode.attribute("nummber") !== undefined)
+                            tupletNumber = parseInt(tupletNode.attribute("number").value);
                         let tupletLabelNumber: number = 0;
                         if (timeModNode !== undefined) {
                             try {
-                                tupletLabelNumber = parseInt(timeModNode.Value);
+                                tupletLabelNumber = parseInt(timeModNode.value);
                             }
                             catch (e) {
                                 let errorMsg: string = ITextTranslation.translateText("ReaderErrorMessages/TupletNoteDurationError",
@@ -571,8 +571,8 @@ export class VoiceGenerator {
                     }
                     else if (type === "stop") {
                         let tupletNumber: number = 1;
-                        if (tupletNode.Attribute("number") !== undefined)
-                            tupletNumber = parseInt(tupletNode.Attribute("number").Value);
+                        if (tupletNode.attribute("number") !== undefined)
+                            tupletNumber = parseInt(tupletNode.attribute("number").value);
                         let tuplet: Tuplet = this.tupletDict[tupletNumber];
                         if (tuplet !== undefined) {
                             let subnotelist: Note[] = [];
@@ -592,13 +592,13 @@ export class VoiceGenerator {
         }
         else if (tupletNodeList[0] !== undefined) {
             let n: IXmlElement = tupletNodeList[0];
-            if (n.HasAttributes) {
-                let type: string = n.Attribute("type").Value;
+            if (n.hasAttributes) {
+                let type: string = n.attribute("type").value;
                 let tupletnumber: number = 1;
                 let noTupletNumbering: boolean = false;
                 try {
-                    if (n.Attribute("number") !== undefined)
-                        tupletnumber = parseInt(n.Attribute("number").Value);
+                    if (n.attribute("number") !== undefined)
+                        tupletnumber = parseInt(n.attribute("number").value);
                 }
                 catch (err) {
                     noTupletNumbering = true;
@@ -606,12 +606,12 @@ export class VoiceGenerator {
 
                 if (type === "start") {
                     let tupletLabelNumber: number = 0;
-                    let timeModNode: IXmlElement = node.Element("time-modification");
+                    let timeModNode: IXmlElement = node.element("time-modification");
                     if (timeModNode !== undefined)
-                        timeModNode = timeModNode.Element("actual-notes");
+                        timeModNode = timeModNode.element("actual-notes");
                     if (timeModNode !== undefined) {
                         try {
-                            tupletLabelNumber = parseInt(timeModNode.Value);
+                            tupletLabelNumber = parseInt(timeModNode.value);
                         }
                         catch (e) {
                             let errorMsg: string = ITextTranslation.translateText("ReaderErrorMessages/TupletNoteDurationError",
@@ -696,8 +696,8 @@ export class VoiceGenerator {
         if (tieNodeList !== undefined) {
             if (tieNodeList.length === 1) {
                 let tieNode: IXmlElement = tieNodeList[0];
-                if (tieNode !== undefined && tieNode.Attributes()) {
-                    let type: string = tieNode.Attribute("type").Value;
+                if (tieNode !== undefined && tieNode.attributes()) {
+                    let type: string = tieNode.attribute("type").value;
                     try {
                         if (type === "start") {
                             let number: number = this.findCurrentNoteInTieDict(this.currentNote);
@@ -846,10 +846,10 @@ export class VoiceGenerator {
         return -1;
     }
     private getTupletNoteDurationFromType(xmlNode: IXmlElement): Fraction {
-        if (xmlNode.Element("type") !== undefined) {
-            let typeNode: IXmlElement = xmlNode.Element("type");
+        if (xmlNode.element("type") !== undefined) {
+            let typeNode: IXmlElement = xmlNode.element("type");
             if (typeNode !== undefined) {
-                let type: string = typeNode.Value;
+                let type: string = typeNode.value;
                 try {
                     return this.getNoteDurationFromType(type);
                 }
@@ -863,4 +863,4 @@ export class VoiceGenerator {
         }
         return undefined;
     }
-}
+}

+ 11 - 11
src/MusicalScore/SubInstrument.ts

@@ -4,10 +4,10 @@ import {MidiInstrument} from "./VoiceData/Instructions/ClefInstruction";
 export class SubInstrument {
     constructor(parentInstrument: Instrument) {
         this.parentInstrument = parentInstrument;
-        this.FixedKey = -1;
-        this.Name = this.parseMidiInstrument(this.parentInstrument.Name);
-        this.MidiInstrumentId = SubInstrument.midiInstrument[this.Name];
-        this.Volume = 1.0;
+        this.fixedKey = -1;
+        this.name = this.parseMidiInstrument(this.parentInstrument.Name);
+        this.midiInstrumentID = SubInstrument.midiInstrument[this.name];
+        this.volume = 1.0;
     }
     private static midiInstrument: { [key: string]: MidiInstrument; } = {
         "cello": MidiInstrument.Cello,
@@ -64,12 +64,12 @@ export class SubInstrument {
         "unnamed": MidiInstrument.Acoustic_Grand_Piano,
     };
 
-    public IdString: string;
-    public MidiInstrumentId: MidiInstrument;
-    public Volume: number;
-    public Pan: number;
-    public FixedKey: number;
-    public Name: string;
+    public idString: string;
+    public midiInstrumentID: MidiInstrument;
+    public volume: number;
+    public pan: number;
+    public fixedKey: number;
+    public name: string;
 
     private parentInstrument: Instrument;
 
@@ -84,7 +84,7 @@ export class SubInstrument {
           || instrument === MidiInstrument.Electric_Piano_2);
     }
     public setMidiInstrument(instrumentType: string): void {
-        this.MidiInstrumentId = SubInstrument.midiInstrument[this.parseMidiInstrument(instrumentType)];
+        this.midiInstrumentID = SubInstrument.midiInstrument[this.parseMidiInstrument(instrumentType)];
     }
 
     private parseMidiInstrument(instrumentType: string): string {

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

@@ -33,13 +33,13 @@ export class ChordSymbolContainer {
 
 export class Degree {
     constructor(value: number, alteration: AccidentalEnum, text: ChordDegreeText) {
-        this.Value = value;
-        this.Alteration = alteration;
-        this.Text = text;
+        this.value = value;
+        this.alteration = alteration;
+        this.text = text;
     }
-    public Value: number;
-    public Alteration: AccidentalEnum;
-    public Text: ChordDegreeText;
+    public value: number;
+    public alteration: AccidentalEnum;
+    public text: ChordDegreeText;
 }
 
 export enum ChordDegreeText {

+ 22 - 22
src/MusicalScore/VoiceData/Expressions/ContinuousExpressions/Slur.ts

@@ -22,20 +22,20 @@ export class Slur {
         this.endNote = value;
     }
     public startNoteHasMoreStartingSlurs(): boolean {
-        if (this.startNote == null) { return false; }
-        for (var idx: number = 0, len = this.startNote.NoteSlurs.length; idx < len; ++idx) {
-            var slur: Slur = this.startNote.NoteSlurs[idx];
-            if (slur != this && slur.StartNote == this.startNote) {
+        if (this.startNote === undefined) { return false; }
+        for (let idx: number = 0, len: number = this.startNote.NoteSlurs.length; idx < len; ++idx) {
+            let slur: Slur = this.startNote.NoteSlurs[idx];
+            if (slur !== this && slur.StartNote === this.startNote) {
                 return true;
             }
         }
         return false;
     }
     public endNoteHasMoreEndingSlurs(): boolean {
-        if (this.endNote == null) { return false; }
-        for (var idx: number = 0, len = this.endNote.NoteSlurs.length; idx < len; ++idx) {
-            var slur: Slur = this.endNote.NoteSlurs[idx];
-            if (slur != this && slur.EndNote == this.endNote) {
+        if (this.endNote === undefined) { return false; }
+        for (let idx: number = 0, len: number = this.endNote.NoteSlurs.length; idx < len; ++idx) {
+            let slur: Slur = this.endNote.NoteSlurs[idx];
+            if (slur !== this && slur.EndNote === this.endNote) {
                 return true;
             }
         }
@@ -45,27 +45,27 @@ export class Slur {
         return (this.startNote.ParentStaffEntry.ParentStaff !== this.endNote.ParentStaffEntry.ParentStaff);
     }
     public isSlurLonger(): boolean {
-        if (this.endNote === null || this.startNote === null) {
+        if (this.endNote === undefined || this.startNote === undefined) {
             return false;
         }
-        var length: Fraction = Fraction.minus(this.endNote.getAbsoluteTimestamp(), this.startNote.getAbsoluteTimestamp());
-        for (var idx: number = 0, len = this.startNote.NoteSlurs.length; idx < len; ++idx) {
-            var slur: Slur = this.startNote.NoteSlurs[idx];
+        let length: Fraction = Fraction.minus(this.endNote.getAbsoluteTimestamp(), this.startNote.getAbsoluteTimestamp());
+        for (let idx: number = 0, len: number = this.startNote.NoteSlurs.length; idx < len; ++idx) {
+            let slur: Slur = this.startNote.NoteSlurs[idx];
             if (
-                slur != this
-                && slur.EndNote != null
-                && slur.StartNote != null
-                && Fraction.minus(slur.EndNote.getAbsoluteTimestamp(), slur.StartNote.getAbsoluteTimestamp()).CompareTo(length) == -1
+                slur !== this
+                && slur.EndNote !== undefined
+                && slur.StartNote !== undefined
+                && Fraction.minus(slur.EndNote.getAbsoluteTimestamp(), slur.StartNote.getAbsoluteTimestamp()).CompareTo(length) === -1
             ) {
                 return true;
             }
         }
-        for (var idx: number = 0, len = this.endNote.NoteSlurs.length; idx < len; ++idx) {
-            var slur: Slur = this.endNote.NoteSlurs[idx];
+        for (let idx: number = 0, len: number = this.endNote.NoteSlurs.length; idx < len; ++idx) {
+            let slur: Slur = this.endNote.NoteSlurs[idx];
             if (
-                slur != this
-                && slur.EndNote != null
-                && slur.StartNote != null
+                slur !== this
+                && slur.EndNote !== undefined
+                && slur.StartNote !== undefined
                 && Fraction.minus(slur.EndNote.getAbsoluteTimestamp(), slur.StartNote.getAbsoluteTimestamp()).CompareTo(length)
             ) {
                 return true;
@@ -73,4 +73,4 @@ export class Slur {
         }
         return false;
     }
-}
+}

+ 9 - 4
src/MusicalScore/VoiceData/Expressions/ContinuousExpressions/continuousDynamicExpression.ts

@@ -1,7 +1,6 @@
 import {PlacementEnum, AbstractExpression} from "../abstractExpression";
 import {MultiExpression} from "../multiExpression";
 import {Fraction} from "../../../../Common/DataObjects/fraction";
-import {AbstractTempoExpression} from "../abstractTempoExpression";
 
 export class ContinuousDynamicExpression extends AbstractExpression {
     //constructor(placement: PlacementEnum, staffNumber: number, label: string) {
@@ -20,8 +19,9 @@ export class ContinuousDynamicExpression extends AbstractExpression {
         this.staffNumber = staffNumber;
         this.startVolume = -1;
         this.endVolume = -1;
+        this.setType();
     }
-    
+
     private static listContinuousDynamicIncreasing: string[] = ["crescendo", "cresc", "cresc.", "cres."];
     private static listContinuousDynamicDecreasing: string[] = ["decrescendo", "decresc", "decr.", "diminuendo", "dim.", "dim"];
     // private static listContinuousDynamicGeneral: string[] = ["subito","al niente","piu","meno"];
@@ -81,6 +81,7 @@ export class ContinuousDynamicExpression extends AbstractExpression {
     }
     public set Label(value: string) {
         this.label = value;
+        this.setType();
     }
     public static isInputStringContinuousDynamic(inputString: string): boolean {
         if (inputString === undefined) { return false; }
@@ -95,11 +96,15 @@ export class ContinuousDynamicExpression extends AbstractExpression {
         if (this.EndMultiExpression !== undefined) {
             continuousAbsoluteEndTimestamp = this.EndMultiExpression.AbsoluteTimestamp;
         } else {
-            continuousAbsoluteEndTimestamp = Fraction.plus(this.startMultiExpression.SourceMeasureParent.AbsoluteTimestamp, this.startMultiExpression.SourceMeasureParent.Duration);
+            continuousAbsoluteEndTimestamp = Fraction.plus(
+                this.startMultiExpression.SourceMeasureParent.AbsoluteTimestamp, this.startMultiExpression.SourceMeasureParent.Duration
+            );
         }
         if (currentAbsoluteTimestamp.lt(continuousAbsoluteStartTimestamp)) { return -1; }
         if (currentAbsoluteTimestamp.lt(continuousAbsoluteEndTimestamp)) { return -2; }
-        let interpolationRatio: number = Fraction.minus(currentAbsoluteTimestamp, continuousAbsoluteStartTimestamp).RealValue / Fraction.minus(continuousAbsoluteEndTimestamp, continuousAbsoluteStartTimestamp).RealValue;
+        let interpolationRatio: number =
+            Fraction.minus(currentAbsoluteTimestamp, continuousAbsoluteStartTimestamp).RealValue
+            / Fraction.minus(continuousAbsoluteEndTimestamp, continuousAbsoluteStartTimestamp).RealValue;
         let interpolatedVolume: number = Math.max(0.0, Math.min(99.9, this.startVolume + (this.endVolume - this.startVolume) * interpolationRatio));
         return interpolatedVolume;
     }

+ 36 - 35
src/MusicalScore/VoiceData/Expressions/ContinuousExpressions/continuousTempoExpression.ts

@@ -10,16 +10,32 @@ export class ContinuousTempoExpression extends AbstractTempoExpression {
         //super.placement = placement;
         //super.staffNumber = staffNumber;
         //super.parentMultiTempoExpression = parentMultiTempoExpression;
-
         this.setTempoType();
     }
 
+    private static listContinuousTempoFaster: string[] = ["accelerando", "piu mosso", "poco piu", "stretto"];
+    private static listContinuousTempoSlower: string[] = [
+        "poco meno", "meno mosso", "piu lento", "calando", "allargando", "rallentando", "ritardando",
+        "ritenuto", "ritard.", "ritard", "rit.", "rit", "riten.", "riten",
+    ];
     private absoluteEndTimestamp: Fraction;
     private tempoType: ContinuousTempoType;
     private startTempo: number;
     private endTempo: number;
-    private static listContinuousTempoFaster: string[] = ["accelerando","piu mosso","poco piu","stretto"];
-    private static listContinuousTempoSlower: string[] = ["poco meno","meno mosso","piu lento","calando","allargando","rallentando","ritardando","ritenuto","ritard.","ritard","rit.","rit","riten.","riten"];
+
+    public static isInputStringContinuousTempo(inputString: string): boolean {
+        if (inputString === undefined) { return false; }
+        return (
+            ContinuousTempoExpression.isStringInStringList(ContinuousTempoExpression.listContinuousTempoFaster, inputString)
+            || ContinuousTempoExpression.isStringInStringList(ContinuousTempoExpression.listContinuousTempoSlower, inputString)
+        );
+    }
+    public static isIncreasingTempo(tempoType: ContinuousTempoType): boolean {
+        return tempoType <= ContinuousTempoType.piuMosso;
+    }
+    public static isDecreasingTempo(tempoType: ContinuousTempoType): boolean {
+        return (tempoType >= ContinuousTempoType.allargando) && (tempoType <= ContinuousTempoType.ritenuto);
+    }
 
     public get TempoType(): ContinuousTempoType {
         return this.tempoType;
@@ -45,21 +61,6 @@ export class ContinuousTempoExpression extends AbstractTempoExpression {
     public set AbsoluteEndTimestamp(value: Fraction) {
         this.absoluteEndTimestamp = value;
     }
-    public static isInputStringContinuousTempo(inputString: string): boolean {
-        if (inputString == null)
-            return false;
-        if (ContinuousTempoExpression.isStringInStringList(ContinuousTempoExpression.listContinuousTempoFaster, inputString))
-            return true;
-        if (ContinuousTempoExpression.isStringInStringList(ContinuousTempoExpression.listContinuousTempoSlower, inputString))
-            return true;
-        return false;
-    }
-    private setTempoType(): void {
-        if (ContinuousTempoExpression.isStringInStringList(ContinuousTempoExpression.listContinuousTempoFaster, this.label))
-            this.tempoType = ContinuousTempoType.accelerando;
-        else if (ContinuousTempoExpression.isStringInStringList(ContinuousTempoExpression.listContinuousTempoSlower, this.label))
-            this.tempoType = ContinuousTempoType.ritardando;
-    }
     public get AbsoluteTimestamp(): Fraction {
         return this.ParentMultiTempoExpression.AbsoluteTimestamp;
     }
@@ -67,24 +68,24 @@ export class ContinuousTempoExpression extends AbstractTempoExpression {
         return this.ParentMultiTempoExpression.AbsoluteTimestamp.RealValue;
     }
     public getInterpolatedTempo(currentAbsoluteTimestamp: Fraction): number {
-        var continuousAbsoluteStartTimestamp: Fraction = Fraction.plus(this.parentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp, this.parentMultiTempoExpression.Timestamp);
-        if (currentAbsoluteTimestamp.lt(continuousAbsoluteStartTimestamp))
-            return -1;
-        if (currentAbsoluteTimestamp.lt(this.absoluteEndTimestamp))
-            return -2;
-        var interpolationRatio: number = Fraction.minus(currentAbsoluteTimestamp, continuousAbsoluteStartTimestamp).RealValue / Fraction.minus(this.absoluteEndTimestamp, continuousAbsoluteStartTimestamp).RealValue;
-        var interpolatedTempo: number = Math.max(0.0, Math.min(250.0, this.startTempo + (this.endTempo - this.startTempo) * interpolationRatio));
-        return <number>interpolatedTempo;
-    }
-    public static isIncreasingTempo(tempoType: ContinuousTempoType): boolean {
-        if (tempoType <= ContinuousTempoType.piuMosso)
-            return true;
-        else return false;
+        let continuousAbsoluteStartTimestamp: Fraction = Fraction.plus(
+            this.parentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp, this.parentMultiTempoExpression.Timestamp
+        );
+        if (currentAbsoluteTimestamp.lt(continuousAbsoluteStartTimestamp)) { return -1; }
+        if (currentAbsoluteTimestamp.lt(this.absoluteEndTimestamp)) { return -2; }
+        let interpolationRatio: number =
+            Fraction.minus(currentAbsoluteTimestamp, continuousAbsoluteStartTimestamp).RealValue
+            / Fraction.minus(this.absoluteEndTimestamp, continuousAbsoluteStartTimestamp).RealValue;
+        let interpolatedTempo: number = Math.max(0.0, Math.min(250.0, this.startTempo + (this.endTempo - this.startTempo) * interpolationRatio));
+        return interpolatedTempo;
     }
-    public static isDecreasingTempo(tempoType: ContinuousTempoType): boolean {
-        if ((tempoType >= ContinuousTempoType.allargando) && (tempoType <= ContinuousTempoType.ritenuto))
-            return true;
-        else return false;
+
+    private setTempoType(): void {
+        if (ContinuousTempoExpression.isStringInStringList(ContinuousTempoExpression.listContinuousTempoFaster, this.label)) {
+            this.tempoType = ContinuousTempoType.accelerando;
+        } else if (ContinuousTempoExpression.isStringInStringList(ContinuousTempoExpression.listContinuousTempoSlower, this.label)) {
+            this.tempoType = ContinuousTempoType.ritardando;
+        }
     }
 }
 

+ 12 - 6
src/MusicalScore/VoiceData/Expressions/ContinuousExpressions/octaveShift.ts

@@ -4,10 +4,12 @@ export class OctaveShift {
     constructor(type: string, octave: number) {
         this.setOctaveShiftValue(type, octave);
     }
+
     private octaveValue: OctaveEnum;
     private staffNumber: number;
     private startMultiExpression: MultiExpression;
     private endMultiExpression: MultiExpression;
+
     public get Type(): OctaveEnum {
         return this.octaveValue;
     }
@@ -32,22 +34,26 @@ export class OctaveShift {
     public set ParentEndMultiExpression(value: MultiExpression) {
         this.endMultiExpression = value;
     }
+
     private setOctaveShiftValue(type: string, octave: number): void {
-        if (octave == 1 && type == "down")
+        if (octave === 1 && type === "down") {
             this.octaveValue = OctaveEnum.VA8;
-        else if (octave == 1 && type == "up")
+        } else if (octave === 1 && type === "up") {
             this.octaveValue = OctaveEnum.VB8;
-        else if (octave == 2 && type == "down")
+        } else if (octave === 2 && type === "down") {
             this.octaveValue = OctaveEnum.MA15;
-        else if (octave == 2 && type == "up")
+        } else if (octave === 2 && type === "up") {
             this.octaveValue = OctaveEnum.MB15;
-        else this.octaveValue = OctaveEnum.NONE;
+        } else {
+            this.octaveValue = OctaveEnum.NONE;
+        }
     }
 }
+
 export enum OctaveEnum {
     VA8,
     VB8,
     MA15,
     MB15,
     NONE
-}
+}

+ 10 - 10
src/MusicalScore/VoiceData/HelperObjects/DynamicsContainer.ts

@@ -5,23 +5,23 @@ import {MultiExpression} from "../Expressions/multiExpression";
 export class DynamicsContainer /*implements IComparable<DynamicsContainer>*/ {
     constructor(dynamicExpression: ContinuousDynamicExpression|InstantaniousDynamicExpression, staffNumber: number) {
         if (dynamicExpression instanceof ContinuousDynamicExpression) {
-            this.ContinuousDynamicExpression = dynamicExpression;
+            this.continuousDynamicExpression = dynamicExpression;
         } else if (dynamicExpression instanceof InstantaniousDynamicExpression) {
-            this.InstantaneousDynamicExpression = dynamicExpression;
+            this.instantaneousDynamicExpression = dynamicExpression;
         }
-        this.StaffNumber = staffNumber;
+        this.staffNumber = staffNumber;
     }
 
-    public ContinuousDynamicExpression: ContinuousDynamicExpression;
-    public InstantaneousDynamicExpression: InstantaniousDynamicExpression;
-    public StaffNumber: number;
+    public continuousDynamicExpression: ContinuousDynamicExpression;
+    public instantaneousDynamicExpression: InstantaniousDynamicExpression;
+    public staffNumber: number;
 
     public parMultiExpression(): MultiExpression {
-        if (this.ContinuousDynamicExpression !== undefined) {
-            return this.ContinuousDynamicExpression.StartMultiExpression;
+        if (this.continuousDynamicExpression !== undefined) {
+            return this.continuousDynamicExpression.StartMultiExpression;
         }
-        if (this.InstantaneousDynamicExpression !== undefined) {
-            return this.InstantaneousDynamicExpression.ParentMultiExpression;
+        if (this.instantaneousDynamicExpression !== undefined) {
+            return this.instantaneousDynamicExpression.ParentMultiExpression;
         }
         return undefined;
     }

+ 36 - 35
src/MusicalScore/VoiceData/Instructions/RepetitionInstruction.ts

@@ -2,14 +2,14 @@ import {Repetition} from "../../MusicSource/Repetition";
 
 export class RepetitionInstructionComparer /*implements IComparer<RepetitionInstruction>*/ {
   public static Compare(x: RepetitionInstruction, y: RepetitionInstruction): number {
-    if (x.ParentRepetition !== undefined && y.ParentRepetition !== undefined) {
-      if (x.Alignment === AlignmentType.End && y.Alignment === AlignmentType.End) {
-        if (x.ParentRepetition.StartIndex < y.ParentRepetition.StartIndex) { return 1; }
-        if (x.ParentRepetition.StartIndex > y.ParentRepetition.StartIndex) { return -1; }
+    if (x.parentRepetition !== undefined && y.parentRepetition !== undefined) {
+      if (x.alignment === AlignmentType.End && y.alignment === AlignmentType.End) {
+        if (x.parentRepetition.StartIndex < y.parentRepetition.StartIndex) { return 1; }
+        if (x.parentRepetition.StartIndex > y.parentRepetition.StartIndex) { return -1; }
       }
-      if (x.Alignment === AlignmentType.Begin && y.Alignment === AlignmentType.Begin) {
-        if (x.ParentRepetition.EndIndex < y.ParentRepetition.EndIndex) { return 1; }
-        if (x.ParentRepetition.EndIndex > y.ParentRepetition.EndIndex) { return -1; }
+      if (x.alignment === AlignmentType.Begin && y.alignment === AlignmentType.Begin) {
+        if (x.parentRepetition.EndIndex < y.parentRepetition.EndIndex) { return 1; }
+        if (x.parentRepetition.EndIndex > y.parentRepetition.EndIndex) { return -1; }
       }
     }
     return 0;
@@ -21,7 +21,7 @@ export class RepetitionInstruction /*implements IComparable*/ {
   constructor(measureIndex: number, type: RepetitionInstructionEnum) {
     this(measureIndex, [], type, AlignmentType.End, undefined);
     if (type === RepetitionInstructionEnum.StartLine || type === RepetitionInstructionEnum.Segno || type === RepetitionInstructionEnum.Coda) {
-      this.Alignment = AlignmentType.Begin;
+      this.alignment = AlignmentType.Begin;
     }
   }
   constructor(measureIndex: number, type: RepetitionInstructionEnum, alignment: AlignmentType, parentRepetition: Repetition) {
@@ -34,54 +34,55 @@ export class RepetitionInstruction /*implements IComparable*/ {
   }
   */
   constructor(measureIndex: number, endingIndices: number[], type: RepetitionInstructionEnum, alignment: AlignmentType, parentRepetition: Repetition) {
-    this.MeasureIndex = measureIndex;
-    this.EndingIndices = endingIndices.slice();
-    this.Type = type;
-    this.Alignment = alignment;
-    this.ParentRepetition = parentRepetition;
+    this.measureIndex = measureIndex;
+    this.endingIndices = endingIndices.slice();
+    this.type = type;
+    this.alignment = alignment;
+    this.parentRepetition = parentRepetition;
   }
 
-  public MeasureIndex: number;
-  public EndingIndices: number[];
-  public Type: RepetitionInstructionEnum;
-  public Alignment: AlignmentType;
-  public ParentRepetition: Repetition;
+  public measureIndex: number;
+  public endingIndices: number[];
+  public type: RepetitionInstructionEnum;
+  public alignment: AlignmentType;
+  public parentRepetition: Repetition;
+
   public CompareTo(obj: Object): number {
     let other: RepetitionInstruction = <RepetitionInstruction>obj;
-    if (this.MeasureIndex > other.MeasureIndex) {
+    if (this.measureIndex > other.measureIndex) {
       return 1;
-    } else if (this.MeasureIndex < other.MeasureIndex) {
+    } else if (this.measureIndex < other.measureIndex) {
       return -1;
     }
-    if (this.Alignment === AlignmentType.Begin) {
-      if (other.Alignment === AlignmentType.End) { return -1; }
-      switch (this.Type) {
+    if (this.alignment === AlignmentType.Begin) {
+      if (other.alignment === AlignmentType.End) { return -1; }
+      switch (this.type) {
         case RepetitionInstructionEnum.Ending:
           return 1;
         case RepetitionInstructionEnum.StartLine:
-          if (other.Type === RepetitionInstructionEnum.Ending) {
+          if (other.type === RepetitionInstructionEnum.Ending) {
             return -1;
           }
           return 1;
         case RepetitionInstructionEnum.Coda:
         case RepetitionInstructionEnum.Segno:
-          if (other.Type === RepetitionInstructionEnum.Coda) {
+          if (other.type === RepetitionInstructionEnum.Coda) {
             return 1;
           }
           return -1;
         default:
       }
     } else {
-      if (other.Alignment === AlignmentType.Begin) { return 1; }
-      switch (this.Type) {
+      if (other.alignment === AlignmentType.Begin) { return 1; }
+      switch (this.type) {
         case RepetitionInstructionEnum.Ending:
           return -1;
         case RepetitionInstructionEnum.Fine:
         case RepetitionInstructionEnum.ToCoda:
-          if (other.Type === RepetitionInstructionEnum.Ending) { return 1; }
+          if (other.type === RepetitionInstructionEnum.Ending) { return 1; }
           return -1;
         case RepetitionInstructionEnum.ForwardJump:
-          switch (other.Type) {
+          switch (other.type) {
             case RepetitionInstructionEnum.Ending:
             case RepetitionInstructionEnum.Fine:
             case RepetitionInstructionEnum.ToCoda:
@@ -104,13 +105,13 @@ export class RepetitionInstruction /*implements IComparable*/ {
   }
   public equals(other: RepetitionInstruction): boolean {
     if (
-      this.MeasureIndex !== other.MeasureIndex
-      || this.Type !== other.Type
-      || this.Alignment !== other.Alignment
-      || this.EndingIndices.length !== other.EndingIndices.length
+      this.measureIndex !== other.measureIndex
+      || this.type !== other.type
+      || this.alignment !== other.alignment
+      || this.endingIndices.length !== other.endingIndices.length
     ) { return false; }
-    for (let i: number = 0; i < this.EndingIndices.length; i++) {
-      if (this.EndingIndices[i] !== other.EndingIndices[i]) { return false; }
+    for (let i: number = 0; i < this.endingIndices.length; i++) {
+      if (this.endingIndices[i] !== other.endingIndices[i]) { return false; }
     }
     return true;
   }

+ 2 - 1
src/MusicalScore/VoiceData/Instructions/RhythmInstruction.ts

@@ -13,6 +13,7 @@ export class RhythmInstruction extends AbstractNotationInstruction {
     private denominator: number;
     private rhythm: Fraction;
     private symbolEnum: RhythmSymbolEnum;
+
     public get Rhythm(): Fraction {
         return this.rhythm;
     }
@@ -25,7 +26,7 @@ export class RhythmInstruction extends AbstractNotationInstruction {
     public set SymbolEnum(value: RhythmSymbolEnum) {
         this.symbolEnum = value;
     }
-    public clone() {
+    public clone(): RhythmInstruction {
         return new RhythmInstruction(this.rhythm.clone(), this.numerator, this.denominator, this.symbolEnum);
     }
     public OperatorEquals(rhythm2: RhythmInstruction): boolean {

+ 11 - 11
src/MusicalScore/VoiceData/Lyrics/LyricsEntry.ts

@@ -3,27 +3,27 @@ import {VoiceEntry} from "../VoiceEntry";
 
 export class LyricsEntry {
     constructor(text: string, word: LyricWord, parent: VoiceEntry) {
-        this._text = text;
-        this._word = word;
-        this._parent = parent;
+        this.text = text;
+        this.word = word;
+        this.parent = parent;
     }
-    private _text: string;
-    private _word: LyricWord;
-    private _parent: VoiceEntry;
+    private text: string;
+    private word: LyricWord;
+    private parent: VoiceEntry;
 
     public get Text(): string {
-        return this._text;
+        return this.text;
     }
     public set Text(value: string) {
-        this._text = value;
+        this.text = value;
     }
     public get Word(): LyricWord {
-        return this._word;
+        return this.word;
     }
     public get Parent(): VoiceEntry {
-        return this._parent;
+        return this.parent;
     }
     public set Parent(value: VoiceEntry) {
-        this._parent = value;
+        this.parent = value;
     }
 }

+ 8 - 7
src/MusicalScore/VoiceData/Lyrics/LyricsWord.ts

@@ -2,13 +2,14 @@ import {LyricsEntry} from "./LyricsEntry";
 import {VoiceEntry} from "../VoiceEntry";
 
 export class LyricWord {
-    private _syllabels: LyricsEntry[] = [];
-    public get Syllabels(): LyricsEntry[] {
-        return this._syllabels;
+    private syllables: LyricsEntry[] = [];
+
+    public get Syllables(): LyricsEntry[] {
+        return this.syllables;
     }
     public containsVoiceEntry(voiceEntry: VoiceEntry): boolean {
-        for (let idx: number = 0, len: number = this.Syllabels.length; idx < len; ++idx) {
-            let lyricsEntry: LyricsEntry = this.Syllabels[idx];
+        for (let idx: number = 0, len: number = this.Syllables.length; idx < len; ++idx) {
+            let lyricsEntry: LyricsEntry = this.Syllables[idx];
             if (lyricsEntry.Parent === voiceEntry) {
                 return true;
             }
@@ -16,8 +17,8 @@ export class LyricWord {
         return false;
     }
     public findLyricEntryInVoiceEntry(voiceEntry: VoiceEntry): LyricsEntry {
-        for (let idx: number = 0, len: number = this.Syllabels.length; idx < len; ++idx) {
-            let lyricsEntry: LyricsEntry = this.Syllabels[idx];
+        for (let idx: number = 0, len: number = this.Syllables.length; idx < len; ++idx) {
+            let lyricsEntry: LyricsEntry = this.Syllables[idx];
             if (lyricsEntry.Parent === voiceEntry) {
                 return lyricsEntry;
             }

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

@@ -8,7 +8,7 @@ import {Tie} from "./Tie";
 import {Staff} from "./Staff";
 import {Slur} from "./Expressions/ContinuousExpressions/Slur";
 
-import Vex = require("vexflow");
+// import Vex = require("vexflow");
 
 export class Note {
 
@@ -18,13 +18,13 @@ export class Note {
         this.length = length;
         this.pitch = pitch;
         if (pitch !== undefined) {
-            this.HalfTone = pitch.getHalfTone();
+            this.halfTone = pitch.getHalfTone();
         } else {
-          this.HalfTone = 0;
+          this.halfTone = 0;
         }
     }
 
-    public HalfTone: number;
+    public halfTone: number;
 
     private voiceEntry: VoiceEntry;
     private parentStaffEntry: SourceStaffEntry;
@@ -113,7 +113,7 @@ export class Note {
         }
         if (originalLength.Numerator > 1) {
             let exp: number = Math.floor(Math.log(originalLength.Denominator) / Math.LN2) - this.calculateNumberOfNeededDots(originalLength);
-            originalLength.Denominator = 1 << exp;
+            originalLength.Denominator = Math.pow(2, exp);
             originalLength.Numerator = 1;
         }
         return originalLength;

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

@@ -15,8 +15,8 @@ export class SourceMeasure {
     this.completeNumberOfStaves = completeNumberOfStaves;
     this.initialize();
   }
-  public MeasureListIndex: number;
-  public EndsPiece: boolean;
+  public measureListIndex: number;
+  public endsPiece: boolean;
 
   private measureNumber: number;
   //private parentMusicPart: SourceMusicPart;
@@ -94,14 +94,14 @@ export class SourceMeasure {
     this.staffMeasureErrors[staffIndex] = hasError;
   }
   public getNextMeasure(measures: SourceMeasure[]): SourceMeasure {
-    if (this.MeasureListIndex + 1 < measures.length) {
-      return measures[this.MeasureListIndex + 1];
+    if (this.measureListIndex + 1 < measures.length) {
+      return measures[this.measureListIndex + 1];
     }
     return undefined;
   }
   public getPreviousMeasure(measures: SourceMeasure[]): SourceMeasure {
-    if (this.MeasureListIndex > 1) {
-      return measures[this.MeasureListIndex - 1];
+    if (this.measureListIndex > 1) {
+      return measures[this.measureListIndex - 1];
     }
     return undefined;
   }
@@ -289,7 +289,7 @@ export class SourceMeasure {
     }
     this.implicitMeasure = false;
     this.breakSystemAfter = false;
-    this.EndsPiece = false;
+    this.endsPiece = false;
   }
   private getLastSourceStaffEntryForInstrument(instrumentIndex: number): SourceStaffEntry {
     for (let i: number = this.verticalSourceStaffEntryContainers.length - 1; i >= 0; i--) {

+ 5 - 5
src/MusicalScore/VoiceData/Staff.ts

@@ -5,13 +5,13 @@ export class Staff {
     constructor(parentInstrument: Instrument, instrumentStaffId: number) {
         this.parentInstrument = parentInstrument;
         this.id = instrumentStaffId;
-        this.Audible = true;
-        this.Following = true;
+        this.audible = true;
+        this.following = true;
     }
 
-    public IdInMusicSheet: number;
-    public Audible: boolean;
-    public Following: boolean;
+    public idInMusicSheet: number;
+    public audible: boolean;
+    public following: boolean;
 
     private parentInstrument: Instrument;
     private voices: Voice[] = [];

+ 3 - 2
src/MusicalScore/VoiceData/VoiceEntry.ts

@@ -17,8 +17,9 @@ export class VoiceEntry {
         this.parentVoice = parentVoice;
         this.parentSourceStaffEntry = parentSourceStaffEntry;
     }
-    public GraceVoiceEntriesBefore: VoiceEntry[];
-    public GraceVoiceEntriesAfter: VoiceEntry[];
+    public graceVoiceEntriesBefore: VoiceEntry[];
+    public graceVoiceEntriesAfter: VoiceEntry[];
+
     private parentVoice: Voice;
     private parentSourceStaffEntry: SourceStaffEntry;
     private timestamp: Fraction;

+ 1 - 1
src/Util/fft.ts

@@ -1,6 +1,6 @@
 import FFT = require("FFT");
 
-export class fft {
+export class FFT2 {
 
   public static toRealImag(timeData: number[]): { imag: Float64Array; real: Float64Array; } {
     let n: number = timeData.length;

+ 16 - 16
test/Common/FileIO/Xml.ts

@@ -3,7 +3,7 @@ import { IXmlElement } from "../../../src/Common/FileIO/Xml.ts";
 // Test XML simple document
 let xml_test_data: string = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\
 <!DOCTYPE score-partwise PUBLIC \"-//Recordare//DTD MusicXML 2.0 Partwise//EN\" \"http://www.musicxml.org/dtds/partwise.dtd\">\
-<score-partwise>  <identification>    <encoding>      <software>Example Software Name</software>      \
+<score-partwise>  <identification>    <encoding>      <software>Example Software name</software>      \
 <encoding-date>2016-04-04</encoding-date>      </encoding>    </identification>   <credit page=\"1\"> \
 <credit-words justify=\"center\" valign=\"top\">Example Credit Words</credit-words> </credit>  </score-partwise>";
 
@@ -14,29 +14,29 @@ describe("XML Unit Tests", () => {
   let documentElement: IXmlElement = new IXmlElement(doc.documentElement);
 
   it("IXmlElement Tests", (done: MochaDone) => {
-    // Test Name attribute
-    chai.expect(documentElement.Name).to.equal("score-partwise");
-    // Test Element method
-    chai.should().exist(documentElement.Element("identification"));
-    // Test Value attribute
+    // Test name attribute
+    chai.expect(documentElement.name).to.equal("score-partwise");
+    // Test element method
+    chai.should().exist(documentElement.element("identification"));
+    // Test value attribute
     chai.expect(documentElement
-      .Element("identification")
-      .Element("encoding")
-      .Element("software").Value).to.equal("Example Software Name");
+      .element("identification")
+      .element("encoding")
+      .element("software").value).to.equal("Example Software name");
     done();
   });
   it("IXmlAttribute Tests", (done: MochaDone) => {
-    // Test Attributes method
+    // Test attributes method
     chai.expect(
-      documentElement.Element("credit").Attributes()[0].Name
+      documentElement.element("credit").attributes()[0].name
     ).to.equal("page");
 
     let creditWords: IXmlElement =
-      documentElement.Element("credit").Element("credit-words");
-    // Test Attributes method
-    chai.expect(creditWords.Attributes().length).to.equal(2);
-    // Test Value attribute
-    chai.expect(creditWords.Attribute("justify").Value).to.equal("center");
+      documentElement.element("credit").element("credit-words");
+    // Test attributes method
+    chai.expect(creditWords.attributes().length).to.equal(2);
+    // Test value attribute
+    chai.expect(creditWords.attribute("justify").value).to.equal("center");
     done();
   });
 });

+ 2 - 2
test/Util/fft.ts

@@ -1,9 +1,9 @@
-import { fft } from "../../src/Util/fft";
+import { FFT2 } from "../../src/Util/fft";
 
 describe("Fast Fourier Transform tests:", () => {
     describe("test1?", () => {
       let array: number[] = [0.5, 0.5, 0.5];
-      let res: { imag: Float64Array; real: Float64Array; } = fft.toRealImag(array);
+      let res: { imag: Float64Array; real: Float64Array; } = FFT2.toRealImag(array);
 
         it("will succeed", (done: MochaDone) => {
             console.log(res.imag[0], res.real[0]);