Skip to content

Commit

Permalink
Update key.c
Browse files Browse the repository at this point in the history
  • Loading branch information
thelowsunoverthemoon authored Dec 9, 2023
1 parent 0e703fa commit dad63c0
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/key/key.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,14 @@ returnKeySig(int alter, enum MahlerKeyType const type)

struct Note key = {0};
if (alter >= 0) {
key = (struct Note) {
.note = tblKey[(alter + KEY_SHARP_ADJ) % KEYSIG_MAX],
.acci = (alter + KEY_SHARP_ADJ) / KEYSIG_MAX,
};
key.note = tblKey[(alter + KEY_SHARP_ADJ) % KEYSIG_MAX];
key.acci = (alter + KEY_SHARP_ADJ) / KEYSIG_MAX;
} else {
if (alter == -1) { // special case for F+
key = (struct Note) {
.note = MAHLER_F
};
key.note = MAHLER_F;
} else {
key = (struct Note) {
.note = tblKey[(KEY_FLAT_ROOT + ((alter + KEY_FLAT_ADJ) % KEYSIG_MAX))],
.acci = ((alter + KEY_FLAT_ADJ) / KEYSIG_MAX) - 1
};
key.note = tblKey[(KEY_FLAT_ROOT + ((alter + KEY_FLAT_ADJ) % KEYSIG_MAX))];
key.acci = ((alter + KEY_FLAT_ADJ) / KEYSIG_MAX) - 1;
}
}

Expand Down Expand Up @@ -142,4 +136,4 @@ makeKeySig(struct Note key, int alter, enum MahlerKeyType type)
}

return new;
}
}

0 comments on commit dad63c0

Please sign in to comment.