Browse Source

remove vibratoStroke(s) again, fix double wavy-line

vibratoStroke(s) seems to now be handled by wavy-line
was erroneously changed in previous commit
sschmidTU 3 years ago
parent
commit
70b6ffd2bc

+ 0 - 8
src/MusicalScore/Graphical/VexFlow/VexFlowConverter.ts

@@ -759,7 +759,6 @@ export class VexFlowConverter {
         const isTuplet: boolean = gve.notes[0].sourceNote.NoteTuplet !== undefined;
         let duration: string = VexFlowConverter.durations(frac, isTuplet)[0];
         let numDots: number = 0;
-        let tabVibrato: boolean = false;
         for (const note of gve.notes) {
             const tabNote: TabNote = note.sourceNote as TabNote;
             const tabPosition: {str: number, fret: number} = {str: tabNote.StringNumberTab, fret: tabNote.FretNumber};
@@ -783,10 +782,6 @@ export class VexFlowConverter {
                 });
             }
 
-            if (tabNote.VibratoStroke) {
-                tabVibrato = true;
-            }
-
             if (numDots < note.numberOfDots) {
                 numDots = note.numberOfDots;
             }
@@ -811,9 +806,6 @@ export class VexFlowConverter {
                 vfnote.addModifier (new VF.Bend(phrase.text, true));
             }
         });
-        if (tabVibrato) {
-            vfnote.addModifier(new VF.Vibrato());
-        }
 
         return vfnote;
     }

+ 2 - 9
src/MusicalScore/ScoreIO/InstrumentReader.ts

@@ -299,7 +299,7 @@ export class InstrumentReader {
 
           // check Tremolo
           let tremoloStrokes: number = 0;
-          let vibratoStrokes: boolean = false;
+          //let vibratoStrokes: boolean = false; // not necessary, handled by wavy-line
           if (notationsNode) {
             const ornamentsNode: IXmlElement = notationsNode.element("ornaments");
             if (ornamentsNode) {
@@ -314,13 +314,6 @@ export class InstrumentReader {
                 }
                 // TODO implement type "start". Vexflow doesn't have tremolo beams yet though (shorter than normal beams)
               }
-              const vibratoNode: IXmlElement = ornamentsNode.element("wavy-line");
-              if (vibratoNode !== undefined) {
-                const vibratoType: Attr = vibratoNode.attribute("type");
-                if (vibratoType && vibratoType.value === "start") {
-                  vibratoStrokes = true;
-                }
-              }
               const wavyLineNodes: IXmlElement[] = ornamentsNode.elements("wavy-line");
               if (wavyLineNodes !== undefined) {
                 /* As mentioned elsewhere, the wavy-line is technically an ornament element, but is specified and behaves
@@ -420,7 +413,7 @@ export class InstrumentReader {
             this.currentStaffEntry, this.currentMeasure,
             measureStartAbsoluteTimestamp,
             this.maxTieNoteFraction, isChord, octavePlusOne,
-            printObject, isCueNote, isGraceNote, stemDirectionXml, tremoloStrokes, stemColorXml, noteheadColorXml, vibratoStrokes,
+            printObject, isCueNote, isGraceNote, stemDirectionXml, tremoloStrokes, stemColorXml, noteheadColorXml,
             dots
           );
 

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

@@ -154,7 +154,7 @@ export class VoiceGenerator {
               parentStaffEntry: SourceStaffEntry, parentMeasure: SourceMeasure,
               measureStartAbsoluteTimestamp: Fraction, maxTieNoteFraction: Fraction, chord: boolean, octavePlusOne: boolean,
               printObject: boolean, isCueNote: boolean, isGraceNote: boolean, stemDirectionXml: StemDirectionType, tremoloStrokes: number,
-              stemColorXml: string, noteheadColorXml: string, vibratoStrokes: boolean,
+              stemColorXml: string, noteheadColorXml: string,
               dotsXml: number): Note {
     this.currentStaffEntry = parentStaffEntry;
     this.currentMeasure = parentMeasure;
@@ -164,7 +164,7 @@ export class VoiceGenerator {
       this.currentNote = restNote
         ? this.addRestNote(noteNode.element("rest"), noteDuration, noteTypeXml, normalNotes, printObject, isCueNote, noteheadColorXml)
         : this.addSingleNote(noteNode, noteDuration, noteTypeXml, typeDuration, normalNotes, chord, octavePlusOne,
-                             printObject, isCueNote, isGraceNote, stemDirectionXml, tremoloStrokes, stemColorXml, noteheadColorXml, vibratoStrokes);
+                             printObject, isCueNote, isGraceNote, stemDirectionXml, tremoloStrokes, stemColorXml, noteheadColorXml);
       this.currentNote.DotsXml = dotsXml;
       // read lyrics
       const lyricElements: IXmlElement[] = noteNode.elements("lyric");
@@ -369,7 +369,7 @@ export class VoiceGenerator {
   private addSingleNote(node: IXmlElement, noteDuration: Fraction, noteTypeXml: NoteType, typeDuration: Fraction,
                         normalNotes: number, chord: boolean, octavePlusOne: boolean,
                         printObject: boolean, isCueNote: boolean, isGraceNote: boolean, stemDirectionXml: StemDirectionType, tremoloStrokes: number,
-                        stemColorXml: string, noteheadColorXml: string, vibratoStrokes: boolean): Note {
+                        stemColorXml: string, noteheadColorXml: string): Note {
     //log.debug("addSingleNote called");
     let noteAlter: number = 0;
     let accidentalValue: string;
@@ -523,7 +523,7 @@ export class VoiceGenerator {
     } else {
       // create TabNote
       note = new TabNote(this.currentVoiceEntry, this.currentStaffEntry, noteLength, pitch, this.currentMeasure,
-                         stringNumber, fretNumber, bends, vibratoStrokes);
+                         stringNumber, fretNumber, bends);
     }
 
     this.addNoteInfo(note, noteTypeXml, printObject, isCueNote, normalNotes,

+ 1 - 8
src/MusicalScore/VoiceData/TabNote.ts

@@ -7,19 +7,16 @@ import { SourceMeasure } from "./SourceMeasure";
 
 export class TabNote extends Note {
     constructor(voiceEntry: VoiceEntry, parentStaffEntry: SourceStaffEntry, length: Fraction, pitch: Pitch, sourceMeasure: SourceMeasure,
-                stringNumber: number, fretNumber: number, bendArray: { bendalter: number, direction: string }[],
-                vibratoStroke: boolean) {
+                stringNumber: number, fretNumber: number, bendArray: { bendalter: number, direction: string }[]) {
         super(voiceEntry, parentStaffEntry, length, pitch, sourceMeasure);
         this.stringNumberTab = stringNumber;
         this.fretNumber = fretNumber;
         this.bendArray = bendArray;
-        this.vibratoStroke = vibratoStroke;
     }
 
     private stringNumberTab: number; // there can also be string numbers for e.g. violin in treble clef.
     private fretNumber: number;
     private bendArray: { bendalter: number, direction: string }[];
-    private vibratoStroke: boolean;
 
     /** Returns the string number the note should be played on. Note there can also be violin string numbers in treble clef. */
     public get StringNumberTab(): number {
@@ -33,8 +30,4 @@ export class TabNote extends Note {
     public get BendArray(): { bendalter: number, direction: string }[] {
         return this.bendArray;
     }
-
-    public get VibratoStroke(): boolean {
-        return this.vibratoStroke;
-    }
 }