|
@@ -2,7 +2,7 @@ import { Instrument } from "../Instrument";
|
|
|
import { LinkedVoice } from "../VoiceData/LinkedVoice";
|
|
|
import { Voice } from "../VoiceData/Voice";
|
|
|
import { MusicSheet } from "../MusicSheet";
|
|
|
-import { VoiceEntry } from "../VoiceData/VoiceEntry";
|
|
|
+import { VoiceEntry, StemDirectionType } from "../VoiceData/VoiceEntry";
|
|
|
import { Note } from "../VoiceData/Note";
|
|
|
import { SourceMeasure } from "../VoiceData/SourceMeasure";
|
|
|
import { SourceStaffEntry } from "../VoiceData/SourceStaffEntry";
|
|
@@ -106,14 +106,14 @@ export class VoiceGenerator {
|
|
|
public read(noteNode: IXmlElement, noteDuration: Fraction, restNote: boolean,
|
|
|
parentStaffEntry: SourceStaffEntry, parentMeasure: SourceMeasure,
|
|
|
measureStartAbsoluteTimestamp: Fraction, maxTieNoteFraction: Fraction, chord: boolean, guitarPro: boolean,
|
|
|
- printObject: boolean = true, isCueNote: boolean = false): Note {
|
|
|
+ printObject: boolean, isCueNote: boolean, stemDirectionXml: StemDirectionType): Note {
|
|
|
this.currentStaffEntry = parentStaffEntry;
|
|
|
this.currentMeasure = parentMeasure;
|
|
|
//log.debug("read called:", restNote);
|
|
|
try {
|
|
|
this.currentNote = restNote
|
|
|
? this.addRestNote(noteDuration, printObject, isCueNote)
|
|
|
- : this.addSingleNote(noteNode, noteDuration, chord, guitarPro, printObject, isCueNote);
|
|
|
+ : this.addSingleNote(noteNode, noteDuration, chord, guitarPro, printObject, isCueNote, stemDirectionXml);
|
|
|
// read lyrics
|
|
|
const lyricElements: IXmlElement[] = noteNode.elements("lyric");
|
|
|
if (this.lyricsReader !== undefined && lyricElements !== undefined) {
|
|
@@ -321,7 +321,7 @@ export class VoiceGenerator {
|
|
|
* @returns {Note}
|
|
|
*/
|
|
|
private addSingleNote(node: IXmlElement, noteDuration: Fraction, chord: boolean, guitarPro: boolean,
|
|
|
- printObject: boolean = true, isCueNote: boolean = false): Note {
|
|
|
+ printObject: boolean, isCueNote: boolean, stemDirectionXml: StemDirectionType): Note {
|
|
|
//log.debug("addSingleNote called");
|
|
|
let noteAlter: number = 0;
|
|
|
let noteAccidental: AccidentalEnum = AccidentalEnum.NONE;
|
|
@@ -416,11 +416,13 @@ export class VoiceGenerator {
|
|
|
const note: Note = new Note(this.currentVoiceEntry, this.currentStaffEntry, noteLength, pitch);
|
|
|
note.PrintObject = printObject;
|
|
|
note.IsCueNote = isCueNote;
|
|
|
+ note.StemDirectionXml = stemDirectionXml;
|
|
|
note.PlaybackInstrumentId = playbackInstrumentId;
|
|
|
if (noteHeadShapeXml !== undefined && noteHeadShapeXml !== "normal") {
|
|
|
note.NoteHead = new NoteHead(note, noteHeadShapeXml, noteHeadFilledXml);
|
|
|
} // if normal, leave note head undefined to save processing/runtime
|
|
|
this.currentVoiceEntry.Notes.push(note);
|
|
|
+ this.currentVoiceEntry.WantedStemDirectionXml = stemDirectionXml;
|
|
|
if (node.elements("beam") && !chord) {
|
|
|
this.createBeam(node, note);
|
|
|
}
|