Skip to content

Add Lesson 2: Basic Chords with arpeggiated playback#1

Draft
Claude wants to merge 2 commits intomainfrom
claude/add-basic-chords-lesson
Draft

Add Lesson 2: Basic Chords with arpeggiated playback#1
Claude wants to merge 2 commits intomainfrom
claude/add-basic-chords-lesson

Conversation

@Claude
Copy link
Copy Markdown

@Claude Claude AI commented Feb 5, 2026

Implements a second lesson following the intervals lesson pattern, teaching basic chord recognition through arpeggiated playback (major, minor, diminished, augmented triads).

Core Implementation

  • app/types/chords.ts: Chord type system with 4 triad types, utility functions for calculating chord notes and validating user input (order-agnostic matching)
  • app/hooks/useChordLesson.ts: Lesson state management with progressive hints (name reveal at 3 attempts, visual hints at 4)
  • app/hooks/useChordPlayback.ts: Sequential note playback (400ms/note, 100ms gap) with abort support
  • app/(modes)/learn/lesson-2-chords/page.tsx: Main lesson page following LessonMode pattern (input/output state machine)

UI Components

  • ChordChallengePrompt: Challenge instructions with note count tracking
  • ChordLessonSummary: End-of-lesson scoring display

Key Design Decisions

Arpeggiated vs Simultaneous: Chords play sequentially to aid learning and reduce audio complexity

Order-Agnostic Matching: checkChordMatch() validates correct notes regardless of play order:

checkChordMatch([67, 60, 64], [60, 64, 67]) // true - C major in any order

Challenge Pool: 40 challenges (10 root notes × 4 chord types), 5 random per lesson

Testing

43 new tests covering:

  • Chord calculation and matching logic (20 tests)
  • Lesson state management and scoring (16 tests)
  • Arpeggiated playback timing and sequence (7 tests)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • fonts.googleapis.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/cortina/cortina/node_modules/.bin/next build base64 -d (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Create a second lesson, which follows the same pattern as the first one, but for basic chords (arpeggiated) rather than intervals

- Add types/chords.ts with chord definitions (major, minor, dim, aug)
- Add chord utility functions (calculateChordNotes, checkChordMatch, etc.)
- Create useChordLesson hook for state management
- Create useChordPlayback hook for arpeggiated playback
- Add lesson-2-chords page following intervals lesson pattern
- Add ChordChallengePrompt and ChordLessonSummary components
- Add comprehensive unit tests (44 tests, all passing)
- Update learn page to include chords lesson
- Export FeedbackState type from ChallengePrompt

Co-authored-by: witalewski <783419+witalewski@users.noreply.github.com>
@Claude Claude AI changed the title [WIP] Add second lesson for basic arpeggiated chords Add Lesson 2: Basic Chords with arpeggiated playback Feb 5, 2026
@Claude Claude AI requested a review from witalewski February 5, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants