Bläddra i källkod

Documenting classes vi

Andrea Condoluci 8 år sedan
förälder
incheckning
e79aaaaeb9

+ 2 - 0
src/MusicalScore/Instrument.ts

@@ -7,6 +7,7 @@ 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);
         this.id = id;
@@ -238,4 +239,5 @@ export class Instrument extends InstrumentalGroup {
             this.staves.push(new Staff(this, i + 1));
         }
     }
+
 }

+ 3 - 0
src/MusicalScore/InstrumentalGroup.ts

@@ -1,6 +1,7 @@
 import { MusicSheet } from "./MusicSheet";
 
 export class InstrumentalGroup {
+
     constructor(name: string, musicSheet: MusicSheet, parent: InstrumentalGroup) {
         this.name = name;
         this.musicSheet = musicSheet;
@@ -11,6 +12,7 @@ export class InstrumentalGroup {
     private musicSheet: MusicSheet;
     private parent: InstrumentalGroup;
     private instrumentalGroups: InstrumentalGroup[] = [];
+
     public get InstrumentalGroups(): InstrumentalGroup[] {
         return this.instrumentalGroups;
     }
@@ -26,4 +28,5 @@ export class InstrumentalGroup {
     public get GetMusicSheet(): MusicSheet {
         return this.musicSheet;
     }
+
 }

+ 4 - 0
src/MusicalScore/Label.ts

@@ -8,18 +8,22 @@ import {FontStyles} from "../Common/Enums/FontStyles";
  * It is used e.g. for titles, composer names, instrument names and dynamic instructions.
  */
 export class Label {
+
     constructor(text: string = "", alignment: TextAlignment = TextAlignment.LeftBottom, font: Fonts = Fonts.TimesNewRoman) {
         this.text = text;
         this.textAlignment = alignment;
         this.font = font;
     }
+
     public text: string;
     public color: OSMDColor;
     public font: Fonts;
     public fontStyle: FontStyles;
     public fontHeight: number;
     public textAlignment: TextAlignment;
+
     public ToString(): string {
         return this.text;
     }
+
 }

+ 36 - 0
src/MusicalScore/MusicSheet.ts

@@ -74,6 +74,11 @@ export class MusicSheet /*implements ISettableMusicSheet, IComparable<MusicSheet
     private engravingRules: EngravingRules;
     // (*) private musicSheetParameterChangedDelegate: MusicSheetParameterChangedDelegate;
 
+    /**
+     * Get the global index within the music sheet for this staff.
+     * @param staff
+     * @returns {number}
+     */
     public static getIndexFromStaff(staff: Staff): number {
         return staff.idInMusicSheet;
     }
@@ -237,6 +242,12 @@ export class MusicSheet /*implements ISettableMusicSheet, IComparable<MusicSheet
             }
         }
     }
+
+    /**
+     *
+     * @param staffIndexInMusicSheet - The global staff index, iterating through all staves of all instruments.
+     * @returns {Staff}
+     */
     public getStaffFromIndex(staffIndexInMusicSheet: number): Staff {
         return this.staves[staffIndexInMusicSheet];
     }
@@ -266,6 +277,13 @@ export class MusicSheet /*implements ISettableMusicSheet, IComparable<MusicSheet
         }
         return num;
     }
+
+    /**
+     * Return a sourceMeasureList, where the given indices correspond to the whole SourceMeasureList of the MusicSheet.
+     * @param start
+     * @param end
+     * @returns {SourceMeasure[]}
+     */
     public getListOfMeasuresFromIndeces(start: number, end: number): SourceMeasure[] {
         let measures: SourceMeasure[] = [];
         for (let i: number = start; i <= end; i++) {
@@ -310,6 +328,12 @@ export class MusicSheet /*implements ISettableMusicSheet, IComparable<MusicSheet
         }
         return staffLineIndex;
     }
+
+    /**
+     * Set to the index-given Repetition a new (set from user) value.
+     * @param index
+     * @param value
+     */
     public setRepetitionNewUserNumberOfRepetitions(index: number, value: number): void {
         let repIndex: number = 0;
         for (let i: number = 0; i < this.repetitions.length; i++) {
@@ -323,6 +347,12 @@ export class MusicSheet /*implements ISettableMusicSheet, IComparable<MusicSheet
             }
         }
     }
+
+    /**
+     * Return the [[Repetition]] from the given index.
+     * @param index
+     * @returns {any}
+     */
     public getRepetitionByIndex(index: number): Repetition {
         let repIndex: number = 0;
         for (let i: number = 0; i < this.repetitions.length; i++) {
@@ -458,6 +488,12 @@ export class MusicSheet /*implements ISettableMusicSheet, IComparable<MusicSheet
         let lastMeasure: SourceMeasure = this.getLastSourceMeasure();
         return Fraction.plus(lastMeasure.AbsoluteTimestamp, lastMeasure.Duration);
     }
+
+    /**
+     * Works only if the [[SourceMeasure]]s are already filled with VerticalStaffEntryContainers!
+     * @param timeStamp
+     * @returns {SourceMeasure}
+     */
     public getSourceMeasureFromTimeStamp(timeStamp: Fraction): SourceMeasure {
         for (let idx: number = 0, len: number = this.sourceMeasures.length; idx < len; ++idx) {
             let sm: SourceMeasure = this.sourceMeasures[idx];

+ 3 - 0
src/MusicalScore/SubInstrument.ts

@@ -3,6 +3,7 @@ import {MidiInstrument} from "./VoiceData/Instructions/ClefInstruction";
 import {Logging} from "../Common/Logging";
 
 export class SubInstrument {
+
     constructor(parentInstrument: Instrument) {
         this.parentInstrument = parentInstrument;
         this.fixedKey = -1;
@@ -10,6 +11,7 @@ export class SubInstrument {
         this.midiInstrumentID = SubInstrument.midiInstrument[this.name];
         this.volume = 1.0;
     }
+
     private static midiInstrument: { [key: string]: MidiInstrument; } = {
         "cello": MidiInstrument.Cello,
         "violon-c": MidiInstrument.Cello,
@@ -112,4 +114,5 @@ export class SubInstrument {
         }
         return "unnamed";
     }
+
 }

+ 4 - 0
src/MusicalScore/VoiceData/OrnamentContainer.ts

@@ -1,12 +1,15 @@
 import {AccidentalEnum} from "../../Common/DataObjects/Pitch";
 
 export class OrnamentContainer {
+
     constructor(ornament: OrnamentEnum) {
         this.ornament = ornament;
     }
+
     private ornament: OrnamentEnum;
     private accidentalAbove: AccidentalEnum = AccidentalEnum.NONE;
     private accidentalBelow: AccidentalEnum = AccidentalEnum.NONE;
+
     public get GetOrnament(): OrnamentEnum {
         return this.ornament;
     }
@@ -22,6 +25,7 @@ export class OrnamentContainer {
     public set AccidentalBelow(value: AccidentalEnum) {
         this.accidentalBelow = value;
     }
+
 }
 
 export enum OrnamentEnum {

+ 82 - 1
src/MusicalScore/VoiceData/SourceMeasure.ts

@@ -13,7 +13,17 @@ import {AbstractNotationInstruction} from "./Instructions/AbstractNotationInstru
 import {Repetition} from "../MusicSource/Repetition";
 import {BaseIdClass} from "../../Util/BaseIdClass";
 
+/**
+ * The Source Measure represents the source data of a unique measure, including all instruments with their staves.
+ * There exists one source measure per XML measure or per paper sheet measure (e.g. the source measures are not doubled in repetitions)
+ */
 export class SourceMeasure extends BaseIdClass {
+
+    /**
+     * The data entries and data lists will be filled with null values according to the total number of staves,
+     * so that existing objects can be referred to by staff index.
+     * @param completeNumberOfStaves
+     */
     constructor(completeNumberOfStaves: number) {
         super();
         this.completeNumberOfStaves = completeNumberOfStaves;
@@ -137,9 +147,16 @@ export class SourceMeasure extends BaseIdClass {
         return undefined;
     }
 
+    /**
+     * Check at the given timestamp if a VerticalContainer exists, if not creates a new, timestamp-ordered one,
+     * and at the given index, if a [[SourceStaffEntry]] exists, and if not, creates a new one.
+     * @param inMeasureTimestamp
+     * @param inSourceMeasureStaffIndex
+     * @param staff
+     * @returns {{createdNewContainer: boolean, staffEntry: SourceStaffEntry}}
+     */
     public findOrCreateStaffEntry(inMeasureTimestamp: Fraction, inSourceMeasureStaffIndex: number,
                                   staff: Staff): {createdNewContainer: boolean, staffEntry: SourceStaffEntry} {
-        // FIXME Andrea: debug & Test
         let staffEntry: SourceStaffEntry = undefined;
         // Find:
         let existingVerticalSourceStaffEntryContainer: VerticalSourceStaffEntryContainer;
@@ -195,6 +212,13 @@ export class SourceMeasure extends BaseIdClass {
         return {createdNewContainer: true, staffEntry: staffEntry};
     }
 
+    /**
+     * Check if a VerticalContainer, a staffEntry and a voiceEntry exist at the given timestamp.
+     * If not, create the necessary entries.
+     * @param sse
+     * @param voice
+     * @returns {{createdVoiceEntry: boolean, voiceEntry: VoiceEntry}}
+     */
     public findOrCreateVoiceEntry(sse: SourceStaffEntry, voice: Voice): { createdVoiceEntry: boolean, voiceEntry: VoiceEntry } {
         let ve: VoiceEntry = undefined;
         let createdNewVoiceEntry: boolean = false;
@@ -212,6 +236,13 @@ export class SourceMeasure extends BaseIdClass {
         return {createdVoiceEntry: createdNewVoiceEntry, voiceEntry: ve};
     }
 
+    /**
+     * Search for a non-null [[SourceStaffEntry]] at the given verticalIndex,
+     * starting from the given horizontalIndex and moving backwards. If none is found, then return undefined.
+     * @param verticalIndex
+     * @param horizontalIndex
+     * @returns {any}
+     */
     public getPreviousSourceStaffEntryFromIndex(verticalIndex: number, horizontalIndex: number): SourceStaffEntry {
         for (let i: number = horizontalIndex - 1; i >= 0; i--) {
             if (this.verticalSourceStaffEntryContainers[i][verticalIndex] !== undefined) {
@@ -221,6 +252,11 @@ export class SourceMeasure extends BaseIdClass {
         return undefined;
     }
 
+    /**
+     * Return the index of the existing VerticalContainer at the given timestamp.
+     * @param musicTimestamp
+     * @returns {number}
+     */
     public getVerticalContainerIndexByTimestamp(musicTimestamp: Fraction): number {
         for (let idx: number = 0, len: number = this.VerticalSourceStaffEntryContainers.length; idx < len; ++idx) {
             if (this.VerticalSourceStaffEntryContainers[idx].Timestamp.Equals(musicTimestamp)) {
@@ -230,6 +266,11 @@ export class SourceMeasure extends BaseIdClass {
         return -1;
     }
 
+    /**
+     * Return the existing VerticalContainer at the given timestamp.
+     * @param musicTimestamp
+     * @returns {any}
+     */
     public getVerticalContainerByTimestamp(musicTimestamp: Fraction): VerticalSourceStaffEntryContainer {
         for (let idx: number = 0, len: number = this.VerticalSourceStaffEntryContainers.length; idx < len; ++idx) {
             let verticalSourceStaffEntryContainer: VerticalSourceStaffEntryContainer = this.VerticalSourceStaffEntryContainers[idx];
@@ -240,6 +281,11 @@ export class SourceMeasure extends BaseIdClass {
         return undefined;
     }
 
+    /**
+     * Check the [[SourceMeasure]] for a possible VerticalContainer with all of its [[StaffEntry]]s undefined,
+     * and if found, remove the VerticalContainer from the [[SourceMeasure]].
+     * @param index
+     */
     public checkForEmptyVerticalContainer(index: number): void {
         let undefinedCounter: number = 0;
         for (let i: number = 0; i < this.completeNumberOfStaves; i++) {
@@ -252,6 +298,14 @@ export class SourceMeasure extends BaseIdClass {
         }
     }
 
+    /**
+     * This method is used for handling a measure with the following error (in the procedure of finding out the Instrument's Duration):
+     * If the LastStaffEntry is missing (implied restNote or error), then go back the StaffEntries until you find a TiedNote (tie Start),
+     * which gives the correct MeasureDuration.
+     * @param musicSheet
+     * @param maxInstDuration
+     * @returns {Fraction}
+     */
     public reverseCheck(musicSheet: MusicSheet, maxInstDuration: Fraction): Fraction {
         let maxDuration: Fraction = new Fraction(0, 1);
         let instrumentsDurations: Fraction[] = [];
@@ -285,6 +339,12 @@ export class SourceMeasure extends BaseIdClass {
         return Fraction.max(maxDuration, maxInstDuration);
     }
 
+    /**
+     * Calculate all the [[Instrument]]'s NotesDurations for this Measures.
+     * @param musicSheet
+     * @param instrumentMaxTieNoteFractions
+     * @returns {Fraction[]}
+     */
     public calculateInstrumentsDuration(musicSheet: MusicSheet, instrumentMaxTieNoteFractions: Fraction[]): Fraction[] {
         let instrumentsDurations: Fraction[] = [];
         for (let i: number = 0; i < musicSheet.Instruments.length; i++) {
@@ -317,6 +377,10 @@ export class SourceMeasure extends BaseIdClass {
         return sourceStaffEntries;
     }
 
+    /**
+     *
+     * @returns {boolean} true iff some measure begin instructions have been found for at least one staff
+     */
     public hasBeginInstructions(): boolean {
         for (let staffIndex: number = 0, len: number = this.FirstInstructionsStaffEntries.length; staffIndex < len; staffIndex++) {
             let beginInstructionsStaffEntry: SourceStaffEntry = this.FirstInstructionsStaffEntries[staffIndex];
@@ -337,6 +401,10 @@ export class SourceMeasure extends BaseIdClass {
         return false;
     }
 
+    /**
+     * Check if this measure is a Repetition Ending.
+     * @returns {boolean}
+     */
     public endsWithLineRepetition(): boolean {
         for (let idx: number = 0, len: number = this.LastRepetitionInstructions.length; idx < len; ++idx) {
             let instruction: RepetitionInstruction = this.LastRepetitionInstructions[idx];
@@ -357,6 +425,10 @@ export class SourceMeasure extends BaseIdClass {
         return false;
     }
 
+    /**
+     * Check if a Repetition starts at the next Measure.
+     * @returns {boolean}
+     */
     public beginsWithWordRepetition(): boolean {
         for (let idx: number = 0, len: number = this.FirstRepetitionInstructions.length; idx < len; ++idx) {
             let instruction: RepetitionInstruction = this.FirstRepetitionInstructions[idx];
@@ -368,6 +440,10 @@ export class SourceMeasure extends BaseIdClass {
         return false;
     }
 
+    /**
+     * Check if this Measure is a Repetition Ending.
+     * @returns {boolean}
+     */
     public endsWithWordRepetition(): boolean {
         for (let idx: number = 0, len: number = this.LastRepetitionInstructions.length; idx < len; ++idx) {
             let instruction: RepetitionInstruction = this.LastRepetitionInstructions[idx];
@@ -404,6 +480,11 @@ export class SourceMeasure extends BaseIdClass {
         return undefined;
     }
 
+    /**
+     * Return the first non-null [[SourceStaffEntry]] at the given InstrumentIndex.
+     * @param instrumentIndex
+     * @returns {SourceStaffEntry}
+     */
     private getLastSourceStaffEntryForInstrument(instrumentIndex: number): SourceStaffEntry {
         let entry: SourceStaffEntry;
         for (let i: number = this.verticalSourceStaffEntryContainers.length - 1; i >= 0; i--) {

+ 17 - 0
src/MusicalScore/VoiceData/SourceStaffEntry.ts

@@ -10,6 +10,9 @@ import {ClefInstruction} from "./Instructions/ClefInstruction";
 import {KeyInstruction} from "./Instructions/KeyInstruction";
 import {RhythmInstruction} from "./Instructions/RhythmInstruction";
 
+/**
+ * A [[SourceStaffEntry]] is a container spanning all the [[VoiceEntry]]s at one timestamp for one [[StaffLine]].
+ */
 export class SourceStaffEntry {
     constructor(verticalContainerParent: VerticalSourceStaffEntryContainer, parentStaff: Staff) {
         this.verticalContainerParent = verticalContainerParent;
@@ -116,6 +119,11 @@ export class SourceStaffEntry {
         return ret;
     }
 
+    /**
+     * Similar to RemoveAllInstructionsOfType but faster,
+     * because it stops searching when the first instruction of the given type is found.
+     * @returns {boolean}
+     */
     public removeFirstInstructionOfTypeClefInstruction(): boolean {
         for (let i: number = 0; i < this.instructions.length; i++) {
             if (this.instructions[i] instanceof ClefInstruction) {
@@ -140,6 +148,11 @@ export class SourceStaffEntry {
         return ret;
     }
 
+    /**
+     * Similar to RemoveAllInstructionsOfType but faster,
+     * because it stops searching when the first instruction of the given type is found.
+     * @returns {boolean}
+     */
     public removeFirstInstructionOfTypeKeyInstruction(): boolean {
         for (let i: number = 0; i < this.instructions.length; i++) {
             if (this.instructions[i] instanceof KeyInstruction) {
@@ -174,6 +187,10 @@ export class SourceStaffEntry {
         return false;
     }
 
+    /**
+     * Calculate the [[SourceStaffEntry]]'s minimum NoteLength.
+     * @returns {Fraction}
+     */
     public calculateMinNoteLength(): Fraction {
         let duration: Fraction = new Fraction(Number.MAX_VALUE, 1);
         for (let idx: number = 0, len: number = this.VoiceEntries.length; idx < len; ++idx) {

+ 2 - 0
src/MusicalScore/VoiceData/Staff.ts

@@ -2,6 +2,7 @@ import {Voice} from "./Voice";
 import {Instrument} from "../Instrument";
 
 export class Staff {
+
     constructor(parentInstrument: Instrument, instrumentStaffId: number) {
         this.parentInstrument = parentInstrument;
         this.id = instrumentStaffId;
@@ -36,4 +37,5 @@ export class Staff {
     public set Volume(value: number) {
         this.volume = value;
     }
+
 }

+ 6 - 0
src/MusicalScore/VoiceData/StaffEntryLink.ts

@@ -1,12 +1,17 @@
 import {VoiceEntry} from "./VoiceEntry";
 import {SourceStaffEntry} from "./SourceStaffEntry";
 
+/**
+ * Used for linked voices.
+ */
 export class StaffEntryLink {
     constructor(voiceEntry: VoiceEntry) {
         this.voiceEntry = voiceEntry;
     }
+
     private voiceEntry: VoiceEntry;
     private linkStaffEntries: SourceStaffEntry[] = [];
+
     public get GetVoiceEntry(): VoiceEntry {
         return this.voiceEntry;
     }
@@ -16,4 +21,5 @@ export class StaffEntryLink {
     public set LinkStaffEntries(value: SourceStaffEntry[]) {
         this.linkStaffEntries = value;
     }
+
 }

+ 10 - 7
src/MusicalScore/VoiceData/Tie.ts

@@ -4,12 +4,16 @@ import {Fraction} from "../../Common/DataObjects/Fraction";
 import {Tuplet} from "./Tuplet";
 import {BaseIdClass} from "../../Util/BaseIdClass";
 
+/**
+ * A [[Tie]] connects two notes of the same pitch and name, indicating that they have to be played as a single note.
+ */
 export class Tie extends BaseIdClass {
 
     constructor(note: Note) {
         super();
         this.start = note;
     }
+
     private start: Note;
     private tieBeam: Beam;
     private beamStartTimestamp: Fraction;
@@ -61,17 +65,16 @@ export class Tie extends BaseIdClass {
         this.baseNoteYPosition = value;
     }
     public initializeBoolList(): void {
-        this.noteHasBeenCreated = [];
-        for (let idx: number = 0, len: number = this.fractions.length; idx < len; ++idx) {
-            // let fraction: Fraction = this.fractions[idx];
-            this.noteHasBeenCreated.push(false);
-        }
+        this.noteHasBeenCreated = new Array(this.fractions.length);
     }
     public allGraphicalNotesHaveBeenCreated(): boolean {
-        for (let idx: number = 0, len: number = this.noteHasBeenCreated.length; idx < len; ++idx) {
-            if (!this.noteHasBeenCreated[idx]) { return false; }
+        for (let b of this.noteHasBeenCreated) {
+            if (!b) {
+                return false;
+            }
         }
 
         return true;
     }
+
 }

+ 10 - 0
src/MusicalScore/VoiceData/Tuplet.ts

@@ -1,7 +1,11 @@
 import {Note} from "./Note";
 import {Fraction} from "../../Common/DataObjects/Fraction";
 
+/**
+ * Tuplets create irregular rhythms; e.g. triplets, quadruplets, quintuplets, etc.
+ */
 export class Tuplet {
+
     constructor(tupletLabelNumber: number) {
         this.tupletLabelNumber = tupletLabelNumber;
     }
@@ -34,6 +38,11 @@ export class Tuplet {
         this.fractions = value;
     }
 
+    /**
+     * Return the index of the first List (notes[0], notes[1],...).
+     * @param note
+     * @returns {number}
+     */
     public getNoteIndex(note: Note): number {
         for (let i: number = this.notes.length - 1; i >= 0; i--) {
             for (let j: number = 0; j < this.notes[i].length; j++) {
@@ -44,4 +53,5 @@ export class Tuplet {
         }
         return 0;
     }
+
 }

+ 6 - 0
src/MusicalScore/VoiceData/VerticalSourceStaffEntryContainer.ts

@@ -2,13 +2,18 @@ import {SourceMeasure} from "./SourceMeasure";
 import {Fraction} from "../../Common/DataObjects/Fraction";
 import {SourceStaffEntry} from "./SourceStaffEntry";
 
+/**
+ * A [[VerticalSourceStaffEntryContainer]] contains the [[StaffEntry]]s at one timestamp through all the [[StaffLine]]s.
+ */
 export class VerticalSourceStaffEntryContainer {
+
     constructor(parentMeasure: SourceMeasure, timestamp: Fraction, size: number) {
         this.timestamp = timestamp;
         this.size = size;
         this.staffEntries = new Array(size);
         this.parentMeasure = parentMeasure;
     }
+
     private timestamp: Fraction;
     private size: number;
     private staffEntries: SourceStaffEntry[] = [];
@@ -48,4 +53,5 @@ export class VerticalSourceStaffEntryContainer {
     public getAbsoluteTimestamp(): Fraction {
         return Fraction.plus(this.timestamp, this.parentMeasure.AbsoluteTimestamp);
     }
+
 }

+ 8 - 0
src/MusicalScore/VoiceData/Voice.ts

@@ -1,12 +1,19 @@
 import {Instrument} from "../Instrument";
 import {VoiceEntry} from "./VoiceEntry";
 
+/**
+ * A [[Voice]] contains all the [[VoiceEntry]]s in a voice in a [[StaffLine]].
+ */
 export class Voice {
+
     private voiceEntries: VoiceEntry[] = [];
     private parent: Instrument;
     private visible: boolean;
     private audible: boolean;
     private following: boolean;
+    /**
+     * The Id given in the MusicXMl file to distinguish the different voices. It is unique per instrument.
+     */
     private voiceId: number;
     private volume: number = 1;
 
@@ -51,4 +58,5 @@ export class Voice {
     public set Volume(value: number) {
         this.volume = value;
     }
+
 }

+ 13 - 0
src/MusicalScore/VoiceData/VoiceEntry.ts

@@ -11,12 +11,22 @@ import {OrnamentEnum} from "./OrnamentContainer";
 import {AccidentalEnum} from "../../Common/DataObjects/Pitch";
 import Dictionary from "typescript-collections/dist/lib/Dictionary";
 
+/**
+ * A [[VoiceEntry]] contains the notes in a voice at a timestamp.
+ */
 export class VoiceEntry {
+    /**
+     *
+     * @param timestamp - The relative timestamp within the source measure.
+     * @param parentVoice
+     * @param parentSourceStaffEntry
+     */
     constructor(timestamp: Fraction, parentVoice: Voice, parentSourceStaffEntry: SourceStaffEntry) {
         this.timestamp = timestamp;
         this.parentVoice = parentVoice;
         this.parentSourceStaffEntry = parentSourceStaffEntry;
     }
+
     public graceVoiceEntriesBefore: VoiceEntry[];
     public graceVoiceEntriesAfter: VoiceEntry[];
 
@@ -29,6 +39,7 @@ export class VoiceEntry {
     private lyricsEntries: Dictionary<number, LyricsEntry> = new Dictionary<number, LyricsEntry>();
     private arpeggiosNotesIndices: number[] = [];
     private ornamentContainer: OrnamentContainer;
+
     public get ParentSourceStaffEntry(): SourceStaffEntry {
         return this.parentSourceStaffEntry;
     }
@@ -65,6 +76,7 @@ export class VoiceEntry {
     public set OrnamentContainer(value: OrnamentContainer) {
         this.ornamentContainer = value;
     }
+
     public static isSupportedArticulation(articulation: ArticulationEnum): boolean {
         switch (articulation) {
             case ArticulationEnum.accent:
@@ -284,6 +296,7 @@ export class VoiceEntry {
         voiceEntry.Notes.push(note);
         voiceEntries.push(voiceEntry);
     }
+
 }
 
 export enum ArticulationEnum {

+ 4 - 0
src/Util/BaseIdClass.ts

@@ -1,5 +1,8 @@
 import * as shortid from "shortid";
 
+/**
+ * Support for the unique id generator.
+ */
 export abstract class BaseIdClass {
 
     protected instanceId: string;
@@ -11,4 +14,5 @@ export abstract class BaseIdClass {
     public toString(): string {
         return this.instanceId;
     }
+
 }

+ 3 - 0
src/Util/CollectionUtil.ts

@@ -1,5 +1,8 @@
 import Dictionary from "typescript-collections/dist/lib/Dictionary";
 
+/**
+ * This class implements static methods to perform useful operations on lists, dictionaries, ...
+ */
 export class CollectionUtil {
 
     public static contains2(array: any[], object: any): boolean {

+ 4 - 0
src/Util/PSMath.ts

@@ -1,3 +1,6 @@
+/**
+ * Some useful Maths methods.
+ */
 export class PSMath {
 
     public static log(base: number, x: number): number {
@@ -29,6 +32,7 @@ export class PSMath {
         }
         return <number>(sumWeigtedValues / sumWeights);
     }
+
 }