Browse Source

refactor: some formatting fixes for PR #933. add m7b5 chord name to EngravingRules.

sschmid 4 năm trước cách đây
mục cha
commit
f5d2f936ce

+ 1 - 0
src/MusicalScore/Graphical/EngravingRules.ts

@@ -639,6 +639,7 @@ export class EngravingRules {
         this.addChordName("13sus4", "suspendedfourth", ["13"], [], []);
         this.addChordName("7sus2", "dominant", ["2"], [], ["3"]);
         this.addChordName("7sus2", "suspendedsecond", ["7"], [], []);
+        this.addChordName("m7b5", "minorseventh", [], ["b5"], []);
         this.addChordName("9sus2", "dominantninth", ["2"], [], ["3"]);
         this.addChordName("9sus2", "suspendedsecond", ["9"], [], []);
         this.addChordName("11sus2", "dominant11th", ["2"], [], ["3"]);

+ 1 - 5
src/MusicalScore/VoiceData/ChordSymbolContainer.ts

@@ -91,19 +91,15 @@ export class ChordSymbolContainer {
         }
 
         // chord kind text
-        // I'm going to store this in a variable for now so I can evaluate it with the degrees
         let chordKind: string = chordSymbol.getTextFromChordKindEnum(chordSymbol.ChordKind);
         const degreeTypeAry: string[] = ["adds", "alts", "subs"];
-
         const customChords: CustomChord[] = chordSymbol.rules.CustomChords;
-
         for (const customChord of customChords) {
             if (customChord.chordKind !== chordSymbol.chordKind) {
                 continue;
             }
 
             let hasCustomChordDegrees: boolean = true;
-
             for (const degType of degreeTypeAry) {
                 for (const deg of (customChord.degrees[degType] || [])) {
                     if (degrees[degType].indexOf(deg) < 0) {
@@ -228,7 +224,7 @@ export class CustomChord {
     ): void {
         for (const customChord of customChords) {
             if (customChord.alternateName === altName) {
-            customChord.alternateName = newAltName;
+                customChord.alternateName = newAltName;
             }
         }
     }