|
@@ -105,14 +105,14 @@ export class VoiceGenerator {
|
|
public read(noteNode: IXmlElement, noteDuration: Fraction, restNote: boolean,
|
|
public read(noteNode: IXmlElement, noteDuration: Fraction, restNote: boolean,
|
|
parentStaffEntry: SourceStaffEntry, parentMeasure: SourceMeasure,
|
|
parentStaffEntry: SourceStaffEntry, parentMeasure: SourceMeasure,
|
|
measureStartAbsoluteTimestamp: Fraction, maxTieNoteFraction: Fraction, chord: boolean, guitarPro: boolean,
|
|
measureStartAbsoluteTimestamp: Fraction, maxTieNoteFraction: Fraction, chord: boolean, guitarPro: boolean,
|
|
- printObject: boolean = true): Note {
|
|
|
|
|
|
+ printObject: boolean = true, isCueNote: boolean = false): Note {
|
|
this.currentStaffEntry = parentStaffEntry;
|
|
this.currentStaffEntry = parentStaffEntry;
|
|
this.currentMeasure = parentMeasure;
|
|
this.currentMeasure = parentMeasure;
|
|
//log.debug("read called:", restNote);
|
|
//log.debug("read called:", restNote);
|
|
try {
|
|
try {
|
|
this.currentNote = restNote
|
|
this.currentNote = restNote
|
|
- ? this.addRestNote(noteDuration, printObject)
|
|
|
|
- : this.addSingleNote(noteNode, noteDuration, chord, guitarPro, printObject);
|
|
|
|
|
|
+ ? this.addRestNote(noteDuration, printObject, isCueNote)
|
|
|
|
+ : this.addSingleNote(noteNode, noteDuration, chord, guitarPro, printObject, isCueNote);
|
|
// read lyrics
|
|
// read lyrics
|
|
const lyricElements: IXmlElement[] = noteNode.elements("lyric");
|
|
const lyricElements: IXmlElement[] = noteNode.elements("lyric");
|
|
if (this.lyricsReader !== undefined && lyricElements !== undefined) {
|
|
if (this.lyricsReader !== undefined && lyricElements !== undefined) {
|
|
@@ -297,7 +297,7 @@ export class VoiceGenerator {
|
|
* @returns {Note}
|
|
* @returns {Note}
|
|
*/
|
|
*/
|
|
private addSingleNote(node: IXmlElement, noteDuration: Fraction, chord: boolean, guitarPro: boolean,
|
|
private addSingleNote(node: IXmlElement, noteDuration: Fraction, chord: boolean, guitarPro: boolean,
|
|
- printObject: boolean = true): Note {
|
|
|
|
|
|
+ printObject: boolean = true, isCueNote: boolean = false): Note {
|
|
//log.debug("addSingleNote called");
|
|
//log.debug("addSingleNote called");
|
|
let noteAlter: number = 0;
|
|
let noteAlter: number = 0;
|
|
let noteAccidental: AccidentalEnum = AccidentalEnum.NONE;
|
|
let noteAccidental: AccidentalEnum = AccidentalEnum.NONE;
|
|
@@ -391,10 +391,11 @@ export class VoiceGenerator {
|
|
const noteLength: Fraction = Fraction.createFromFraction(noteDuration);
|
|
const noteLength: Fraction = Fraction.createFromFraction(noteDuration);
|
|
const note: Note = new Note(this.currentVoiceEntry, this.currentStaffEntry, noteLength, pitch);
|
|
const note: Note = new Note(this.currentVoiceEntry, this.currentStaffEntry, noteLength, pitch);
|
|
note.PrintObject = printObject;
|
|
note.PrintObject = printObject;
|
|
|
|
+ note.IsCueNote = isCueNote;
|
|
note.PlaybackInstrumentId = playbackInstrumentId;
|
|
note.PlaybackInstrumentId = playbackInstrumentId;
|
|
if (noteHeadShapeXml !== undefined && noteHeadShapeXml !== "normal") {
|
|
if (noteHeadShapeXml !== undefined && noteHeadShapeXml !== "normal") {
|
|
note.NoteHead = new NoteHead(note, noteHeadShapeXml, noteHeadFilledXml);
|
|
note.NoteHead = new NoteHead(note, noteHeadShapeXml, noteHeadFilledXml);
|
|
- } // if normal, leave note head undefined to save performance
|
|
|
|
|
|
+ } // if normal, leave note head undefined to save processing/runtime
|
|
this.currentVoiceEntry.Notes.push(note);
|
|
this.currentVoiceEntry.Notes.push(note);
|
|
if (node.elements("beam") && !chord) {
|
|
if (node.elements("beam") && !chord) {
|
|
this.createBeam(node, note);
|
|
this.createBeam(node, note);
|
|
@@ -408,10 +409,11 @@ export class VoiceGenerator {
|
|
* @param divisions
|
|
* @param divisions
|
|
* @returns {Note}
|
|
* @returns {Note}
|
|
*/
|
|
*/
|
|
- private addRestNote(noteDuration: Fraction, printObject: boolean = true): Note {
|
|
|
|
|
|
+ private addRestNote(noteDuration: Fraction, printObject: boolean = true, isCueNote: boolean = false): Note {
|
|
const restFraction: Fraction = Fraction.createFromFraction(noteDuration);
|
|
const restFraction: Fraction = Fraction.createFromFraction(noteDuration);
|
|
const restNote: Note = new Note(this.currentVoiceEntry, this.currentStaffEntry, restFraction, undefined);
|
|
const restNote: Note = new Note(this.currentVoiceEntry, this.currentStaffEntry, restFraction, undefined);
|
|
restNote.PrintObject = printObject;
|
|
restNote.PrintObject = printObject;
|
|
|
|
+ restNote.IsCueNote = isCueNote;
|
|
this.currentVoiceEntry.Notes.push(restNote);
|
|
this.currentVoiceEntry.Notes.push(restNote);
|
|
if (this.openBeam !== undefined) {
|
|
if (this.openBeam !== undefined) {
|
|
this.openBeam.ExtendedNoteList.push(restNote);
|
|
this.openBeam.ExtendedNoteList.push(restNote);
|