Forráskód Böngészése

fix note.NoteTie undefined with tie across voices (#51), move openTieDict from VoiceGenerator to Staff

fixes #51
sschmidTU 3 éve
szülő
commit
3b8ed14e4c

+ 1 - 1
src/MusicalScore/ScoreIO/VoiceGenerator.ts

@@ -70,7 +70,7 @@ export class VoiceGenerator {
   // private lastBeamTag: string = "";
   private openBeams: Beam[] = []; // works like a stack, with push and pop
   private beamNumberOffset: number = 0;
-  private openTieDict: { [_: number]: Tie } = {};
+  private get openTieDict(): { [_: number]: Tie } { return this.staff.openTieDict; }
   private currentOctaveShift: number = 0;
   private tupletDict: { [_: number]: Tuplet } = {};
   private openTupletNumber: number = 0;

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

@@ -1,5 +1,6 @@
 import {Voice} from "./Voice";
 import {Instrument} from "../Instrument";
+import { Tie } from "./Tie";
 
 export class Staff {
 
@@ -22,6 +23,7 @@ export class Staff {
     private stafflineCount: number = 5;
     private solo: boolean;
     public hasLyrics: boolean = false;
+    public openTieDict: { [_: number]: Tie } = {};
 
     public get ParentInstrument(): Instrument {
         return this.parentInstrument;