|
@@ -385,9 +385,9 @@ export class VexFlowMeasure extends StaffMeasure {
|
|
const gNotesStartTimestamp: Fraction = gNotesPerVoice[0].sourceNote.getAbsoluteTimestamp();
|
|
const gNotesStartTimestamp: Fraction = gNotesPerVoice[0].sourceNote.getAbsoluteTimestamp();
|
|
|
|
|
|
// These 3 lines one render all "regular" notes:
|
|
// These 3 lines one render all "regular" notes:
|
|
- const gnotes: { [voiceID: number]: GraphicalNote[]; } = staffEntry.graphicalNotes;
|
|
|
|
- const vfnote: StaveNote = VexFlowConverter.StaveNote(gnotes[voiceId]);
|
|
|
|
- staffEntry.vfNotes[voiceId] = vfnote;
|
|
|
|
|
|
+ // const gnotes: { [voiceID: number]: GraphicalNote[]; } = staffEntry.graphicalNotes;
|
|
|
|
+ // const vfnote: StaveNote = VexFlowConverter.StaveNote(gnotes[voiceId]);
|
|
|
|
+ // staffEntry.vfNotes[voiceId] = vfnote;
|
|
|
|
|
|
// find the voiceEntry end timestamp:
|
|
// find the voiceEntry end timestamp:
|
|
let gNotesEndTimestamp: Fraction = new Fraction();
|
|
let gNotesEndTimestamp: Fraction = new Fraction();
|
|
@@ -408,9 +408,9 @@ export class VexFlowMeasure extends StaffMeasure {
|
|
// if this voice is new, check for a gap from measure start to the start of the current voice entry:
|
|
// if this voice is new, check for a gap from measure start to the start of the current voice entry:
|
|
const gapFromMeasureStart: Fraction = Fraction.minus(gNotesStartTimestamp, this.parentSourceMeasure.AbsoluteTimestamp);
|
|
const gapFromMeasureStart: Fraction = Fraction.minus(gNotesStartTimestamp, this.parentSourceMeasure.AbsoluteTimestamp);
|
|
if (gapFromMeasureStart.RealValue > 0) {
|
|
if (gapFromMeasureStart.RealValue > 0) {
|
|
- console.log("Ghost Found at start", this)
|
|
|
|
|
|
+ console.log("Ghost Found at start", staffEntry.vfNotes[voiceId]);
|
|
const vfghost: Vex.Flow.GhostNote = VexFlowConverter.GhostNote(gapFromMeasureStart);
|
|
const vfghost: Vex.Flow.GhostNote = VexFlowConverter.GhostNote(gapFromMeasureStart);
|
|
- // staffEntry.vfNotes[voiceId] = (vfghost as any);
|
|
|
|
|
|
+ staffEntry.vfNotes[voiceId] = (vfghost as any);
|
|
// ToDo: fill the gap with a rest ghost note
|
|
// ToDo: fill the gap with a rest ghost note
|
|
// from this.parentSourceMeasure.AbsoluteTimestamp
|
|
// from this.parentSourceMeasure.AbsoluteTimestamp
|
|
// with length gapFromMeasureStart:
|
|
// with length gapFromMeasureStart:
|
|
@@ -422,7 +422,7 @@ export class VexFlowMeasure extends StaffMeasure {
|
|
const restLength: Fraction = Fraction.minus(gNotesStartTimestamp, latestVoiceTimestamp);
|
|
const restLength: Fraction = Fraction.minus(gNotesStartTimestamp, latestVoiceTimestamp);
|
|
|
|
|
|
if (restLength.RealValue > 0) {
|
|
if (restLength.RealValue > 0) {
|
|
- console.log("Ghost Found in between", this)
|
|
|
|
|
|
+ console.log("Ghost Found in between", staffEntry.vfNotes[voiceId]);
|
|
// ToDo: fill the gap with a rest ghost note
|
|
// ToDo: fill the gap with a rest ghost note
|
|
// starting from latestVoiceTimestamp
|
|
// starting from latestVoiceTimestamp
|
|
// with length restLength:
|
|
// with length restLength:
|
|
@@ -446,7 +446,7 @@ export class VexFlowMeasure extends StaffMeasure {
|
|
// fill the gap with a rest ghost note
|
|
// fill the gap with a rest ghost note
|
|
// starting from lastFraction
|
|
// starting from lastFraction
|
|
// with length restLength:
|
|
// with length restLength:
|
|
- console.log("Ghost Found at end", this)
|
|
|
|
|
|
+ console.log("Ghost Found at end", this);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -589,12 +589,13 @@ export class VexFlowMeasure extends StaffMeasure {
|
|
}
|
|
}
|
|
|
|
|
|
public staffMeasureCreatedCalculations(): void {
|
|
public staffMeasureCreatedCalculations(): void {
|
|
- for (const graphicalStaffEntry of this.staffEntries) {
|
|
|
|
|
|
+ for (const graphicalStaffEntry of this.staffEntries as VexFlowStaffEntry[]) {
|
|
// create vex flow Stave Notes:
|
|
// create vex flow Stave Notes:
|
|
for (const gve of graphicalStaffEntry.graphicalVoiceEntries) {
|
|
for (const gve of graphicalStaffEntry.graphicalVoiceEntries) {
|
|
(gve as VexFlowVoiceEntry).vfStaveNote = VexFlowConverter.StaveNote(gve.notes);
|
|
(gve as VexFlowVoiceEntry).vfStaveNote = VexFlowConverter.StaveNote(gve.notes);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ this.fillMissingRests();
|
|
|
|
|
|
this.finalizeBeams();
|
|
this.finalizeBeams();
|
|
this.finalizeTuplets();
|
|
this.finalizeTuplets();
|