A touch-friendly web application for mastering piano scales through intelligent spaced repetition. Build muscle memory and consistency by practicing scales with a proven streak-based system.
Each scale requires a configurable number of first-try successes (default: 2) to complete:
- ✅ Success: Moves you closer to completing the scale (reduces goals by 1)
- ❌ Failure: Resets the scale back to the starting number of goals
- 🎯 Goal: Achieve the required successes in a row for each scale to build consistency
- Start: Click "Show Next Scale" or press
Space - Play: Practice the scale shown on your piano
- Record: Mark your attempt as "Nailed It!" (
Y) or "Missed" (N) - Progress: The app intelligently selects your next scale
- Complete: Finish when all scales reach their goal!
The app uses a weighted random selection system that creates natural, engaging practice sessions:
How it works:
- Scales you're practicing (already attempted) are 2x more likely to appear than new scales
- Scales needing more work get a slight bonus (based on remaining streak goals)
- Older scales get a small boost to prevent any scale from being ignored too long
- Never shows the same scale twice in a row (unless it's the last one)
The result: Instead of forcing you through all 20+ scales sequentially, you'll see the scales you're working on more frequently while still getting exposed to new ones. This creates a more natural practice flow that's neither too repetitive nor too scattered.
Example weights:
- Never attempted scale: base weight 1.0
- Recently practiced scale: base weight 2.0
- Scale needing 3 more successes: +0.3 bonus
- Scale not seen in a while: up to +0.5 recency bonus
- 🎯 Streak-based progression: Build consistency with consecutive successes
- 🧠 Intelligent scheduling: Optimized spaced repetition for better retention
- 📱 Touch-friendly: Works perfectly on tablets and phones
- ⌨️ Keyboard shortcuts:
Spaceto advance,Yfor success,Nfor failure - 📊 Live statistics: Track attempts, successes, and progress in real-time
- 🏆 Celebration animations: Rewarding completion screen with confetti
- 👥 Multi-user support: Each browser session gets its own isolated data
- ⚙️ Customizable settings: Adjust success requirements and scale library
The app comes preloaded with a comprehensive practice set:
- All 12 major scales (C, G, D, A, E, B, F, B♭, E♭, A♭, D♭, G♭)
- C# Minor (Harmonic & Melodic)
- E Minor (Harmonic & Melodic)
- G Minor (Harmonic & Melodic)
- B♭ Minor (Harmonic & Melodic)
Practice scales in thirds for advanced finger independence:
- Major scales: D♭, E, G, B♭
- Minor harmonic scales: C#, E, G, B♭
You can add or remove scales through the Settings page to customize your practice routine.
- PHP 8.2+ with PDO SQLite extension
- Composer
- Install dependencies:
composer install- Run database migrations:
php bin/migrate.php- Start local server:
php -S 0.0.0.0:8081 -t public- Open http://localhost:8081 in your browser
- Fly CLI installed (
curl -L https://fly.io/install.sh | sh) - Fly.io account
- Authenticate with Fly:
flyctl auth login- Deploy the app (first time):
# Since fly.toml already exists, just deploy directly
flyctl deploy- Create persistent volume for SQLite (if not already created):
flyctl volumes create sqlite_data --size 1 --region lhr- Set app secret (optional but recommended):
flyctl secrets set APP_KEY=$(openssl rand -hex 16)- Open deployed app:
flyctl openIf you want to use a different app name or the above doesn't work:
# Remove existing fly.toml
rm fly.toml
# Launch with your preferred name
flyctl launch --name your-app-name --region lhr
# Then follow steps 3-5 above/public/ # Web root
index.php # Entry point
/assets/ # CSS and JS files
/app/ # Application code
/Controllers/ # Request handlers
/Domain/ # Business logic
/Storage/ # Database layer
/Models/ # Data models
/views/ # HTML templates
/fragments/ # HTMX partials
/bin/ # CLI scripts
/data/ # SQLite database (git-ignored)
Settings can be adjusted in the web UI:
- Required Successes (X): 1-10 tokens per scale
- Allow Repeat: When only one scale remains
- Manage Scales: Add/remove practice scales
- Each scale starts with X tokens (default: 2)
- Success decrements token by 1
- Failure resets tokens to X
- Scale is complete when tokens reach 0
- Session ends when all scales are complete
- Space: Show next scale / advance
- Y: Mark as success
- N: Mark as failure
scales: Library of practice scalessessions: Daily practice sessionssession_scale_state: Per-scale progress trackingattempts: Individual attempt historyconfig: Global settings
composer testdocker build -t piano-scale-reps .
docker run -p 8081:8081 piano-scale-repsflyctl logsflyctl ssh console- CSRF protection on all POST requests
- SameSite cookies
- Prepared statements for SQL queries
- No user authentication (single-user app)
MIT