Skip to content

Commit

Permalink
fix(Layout): Fix 12/8 rhythm with rest measures overflowing notes, ot…
Browse files Browse the repository at this point in the history
…her rest measure issues (#1187, merge #1188)

merge fix/12-8-layout

* fix layout for 12/8 rhythm overflowing into next measure (#1187)

this happens when there are whole rest measures along other measures
(see test_12-8-rhythm-overflow.musicxml, Dichterliebe)

* try vexflowpatch for formatter for tabs error
  • Loading branch information
sschmidTU committed Jul 18, 2022
1 parent 11f8b83 commit b524d77
Show file tree
Hide file tree
Showing 4 changed files with 1,065 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/MusicalScore/Graphical/VexFlow/VexFlowMeasure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1224,8 +1224,8 @@ export class VexFlowMeasure extends GraphicalMeasure {

// add a vexFlow voice for this voice:
this.vfVoices[voice.VoiceId] = new VF.Voice({
beat_value: this.parentSourceMeasure.Duration.Denominator,
num_beats: this.parentSourceMeasure.Duration.Numerator,
beat_value: this.parentSourceMeasure.ActiveTimeSignature.Denominator,
num_beats: this.parentSourceMeasure.ActiveTimeSignature.Numerator,
resolution: VF.RESOLUTION,
}).setMode(VF.Voice.Mode.SOFT);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,12 @@ export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
const voices: VF.Voice[] = [];
for (const voiceID in mvoices) {
if (mvoices.hasOwnProperty(voiceID)) {
voices.push(mvoices[voiceID]);
allVoices.push(mvoices[voiceID]);
const mvoice: any = mvoices[voiceID];
if (measure.hasOnlyRests && !mvoice.ticksUsed.equals(mvoice.totalTicks)) {
mvoice.ticksUsed = mvoice.totalTicks;
}
voices.push(mvoice);
allVoices.push(mvoice);
}
}

Expand Down

0 comments on commit b524d77

Please sign in to comment.