Add Lesson 2: Basic Chords with arpeggiated playback#1
Draft
Conversation
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 supportapp/(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 trackingChordLessonSummary: End-of-lesson scoring displayKey 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:Challenge Pool: 40 challenges (10 root notes × 4 chord types), 5 random per lesson
Testing
43 new tests covering:
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/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