Skip to content

Commit 551ac92

Browse files
committed
remove some dead code
1 parent 8a5a654 commit 551ac92

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

src/lib/ScaleChords.svelte

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,35 +18,32 @@
1818
const chordName = event.currentTarget.dataset.chord;
1919
2020
// Use the first position's MIDI notes from chord-db
21-
const fingerings = getChordFingerings(chordName);
21+
const result = getChordFingerings(chordName);
2222
23-
if (!fingerings || fingerings.length === 0) {
23+
if (!result || !result.positions || result.positions.length === 0) {
2424
console.warn(`No fingerings found for ${chordName}`);
2525
return;
2626
}
2727
28-
const firstPosition = fingerings[0];
28+
const firstPosition = result.positions[0];
2929
const midi = firstPosition.midi;
3030
3131
player.play(midi, 15);
32-
33-
// Get chord info for callback
34-
const chord = Chord.get(chordName);
3532
}
3633
3734
function renderChord(element, chord) {
3835
if (!element) return;
3936
4037
// Standard chord rendering
41-
const variations = getChordVariations(chord);
38+
const { positions } = getChordVariations(chord);
4239
43-
if (!variations || variations.length === 0) {
40+
if (!positions || positions.length === 0) {
4441
console.warn(`No fingerings found for ${chord}`);
4542
return;
4643
}
4744
4845
// Use the first variation
49-
const chordData = variations[0];
46+
const chordData = positions[0];
5047
// Create the SVGuitar instance
5148
const chart = new SVGuitarChord(element);
5249
chart
@@ -81,7 +78,9 @@
8178
});
8279
8380
$effect(() => {
84-
const triads = Mode.triads(scale.type, scale.tonic);
81+
const triads = Mode.triads(scale.type, scale.tonic).map((chord) =>
82+
chord.replace("E#", "F").replace("B#", "C"),
83+
);
8584
8685
// Sort chords so diminished chords appear last
8786
chords = triads.sort((a, b) => {

0 commit comments

Comments
 (0)