diff --git a/guitar-teacher.jsx b/guitar-teacher.jsx
index e474272..d4862aa 100644
--- a/guitar-teacher.jsx
+++ b/guitar-teacher.jsx
@@ -35,11 +35,11 @@ function autoCorrelate(buf, sr) {
}
const CHORDS = {
- Em:{ dots:[{s:4,f:2,n:"2"},{s:3,f:2,n:"3"}], open:[0,1,2,5], muted:[], label:"x x 0 2 2 0" },
- Am:{ dots:[{s:1,f:2,n:"1"},{s:2,f:2,n:"2"},{s:3,f:2,n:"3"}], open:[0,1], muted:[5], label:"x 0 2 2 1 0" },
- G: { dots:[{s:5,f:3,n:"2"},{s:0,f:3,n:"4"},{s:4,f:2,n:"1"},{s:1,f:2,n:"3"}], open:[2,3], muted:[], label:"3 2 0 0 3 3" },
- C: { dots:[{s:4,f:3,n:"3"},{s:3,f:2,n:"2"},{s:1,f:1,n:"1"}], open:[0,2], muted:[5], label:"x 3 2 0 1 0" },
- D: { dots:[{s:2,f:2,n:"1"},{s:1,f:3,n:"3"},{s:0,f:2,n:"2"}], open:[3], muted:[4,5], label:"x x 0 2 3 2" },
+ Em:{ dots:[{s:1,f:2,n:"2"},{s:2,f:2,n:"3"}], open:[3,4,5], muted:[], label:"x x 0 2 2 0" },
+ Am:{ dots:[{s:4,f:2,n:"1"},{s:3,f:2,n:"2"},{s:2,f:2,n:"3"}], open:[4,5], muted:[0], label:"x 0 2 2 1 0" },
+ G: { dots:[{s:0,f:3,n:"2"},{s:5,f:3,n:"4"},{s:1,f:2,n:"1"},{s:4,f:2,n:"3"}], open:[2,3], muted:[], label:"3 2 0 0 3 3" },
+ C: { dots:[{s:1,f:3,n:"3"},{s:2,f:2,n:"2"},{s:4,f:1,n:"1"}], open:[3,5], muted:[0], label:"x 3 2 0 1 0" },
+ D: { dots:[{s:3,f:2,n:"1"},{s:4,f:3,n:"3"},{s:5,f:2,n:"2"}], open:[2], muted:[0,1], label:"x x 0 2 3 2" },
};
const SONG_LIBRARY = [
@@ -129,59 +129,84 @@ const SONG_LIBRARY = [
function ChordDiagram({ name }) {
const sh = CHORDS[name];
if (!sh) return null;
- const NX=8, NG=14, NS=6, NF=4, NY=18, FH=16;
- const W = NX*2 + NG*(NS-1), H = NY + FH*NF + 8;
+
+ const NUM_FRETS=5, NS=6, W=320, H=200;
+ const TOP=44, BOT=H-24, LEFT=44, RIGHT=W-12;
+ const strGap=(BOT-TOP)/(NS-1);
+ const fretGap=(RIGHT-LEFT)/NUM_FRETS;
+ const STRING_LABELS=["E","A","D","G","B","e"];
+
+ // Build note list from chord shape: open strings + fretted dots
+ const notes = [];
+ sh.open.forEach(s=>{ notes.push({str:s, fret:0, label:"o", muted:false}); });
+ sh.muted.forEach(s=>{ notes.push({str:s, fret:-1, label:"x", muted:true}); });
+ sh.dots.forEach(({s,f,n})=>{ notes.push({str:s, fret:f, label:n, muted:false, finger:true}); });
+
return (
-
-
{name}
-