Skip to content

WhiteLotusLA/Stratisfaction

Repository files navigation

Stratisfaction

AI-powered guitar practice coach for macOS with built-in amp simulation.

Plug in your electric guitar through a USB audio interface, and Stratisfaction provides real-time pitch detection, 10 structured technique curricula, 82 playable songs, AI coaching, and amp effects — all in one native SwiftUI app.

Download the free demo

A free macOS demo is available at stratisfaction.carrd.co — ships the tuner, metronome, Free Play with 3 amp models (Fender Clean, Fender Tweed, Marshall Plexi), and chord curriculum chapters 1–3. Requires macOS 14+ and a class-compliant USB audio interface. The full version launches via Kickstarter later in 2026.

Open source

The entire codebase is source-available under the PolyForm Noncommercial 1.0.0 license. You are free to read, use, modify, and redistribute it for personal, educational, or non-commercial purposes. If you want to take the code somewhere commercial — or if you want to help take it to v1.0 — see CONTRIBUTING.md for the contribution terms and LICENSE for commercial licensing contact details.

Features

Core Audio

  • Real-Time Pitch Detection — Custom YIN algorithm (~43fps) detects notes as you play, with per-note accuracy feedback (Perfect / Good / Okay / Miss)
  • Chord Detection — FFT-based real-time chord identification (33 chords via Accelerate vDSP)
  • Amp & Effects — Built-in distortion, delay, reverb, and EQ via AVAudioEngine. Five presets: Clean, Crunch, Lead, Fuzz, Auto Wah
  • Tone Recipes — Per-song amp/effects + guitar hardware guidance, auto-applied on song start
  • Guitar Tuner — Needle gauge with auto-string detection, Standard + Drop D tuning presets

Technique Curricula (10 paths, 200+ lessons)

Each curriculum follows a consistent chapter → lesson pattern (Theory → Drill → Challenge) with themed colors, progress tracking, and unique challenge modes:

Curriculum Chapters Lessons Challenge Mode Theme
Chords 8 43 Chapter Jam Teal
Picking 8 24 Speed Challenge Pink
Fingerpicking 8 24 Pattern Challenge Orange
Legato 6 18 Chain Challenge Green
Bending & Vibrato 7 21 Bend Target Red
Music Theory 6 18 Apply Exercise Purple
Slide 6 18 Slide Relay Cyan
Tapping 6 18 Tap Relay Yellow
Harmonics 8 24 Harmonic Chime Indigo
Dynamics 8 24 Accent Sniper Mint

Song Library

  • 82 songs across 9 genres and 7 difficulty levels (26 free, 56 subscription)
  • Public domain classics + original rock compositions with guitar solos
  • Adjustable tempo, star-based mastery, fretboard visualization during playback
  • Song preview engine synthesizes melodies through the effects chain

Exercise System

  • 43 exercises across 7 skill levels (Beginner → Legendary)
  • 14 strum exercises with onset detection and chord-based evaluation
  • 18 rock technique exercises with timing scoring (80% pitch + 20% timing)
  • Advanced scoring: pitch × 0.70 + timing × 0.15 + technique × 0.15

Adventure Mode

  • 8 themed worlds, 124 quests (exercise + chord + curriculum quests)
  • Story-driven progression with boss battles, star requirements, and bonus objectives
  • Cutscene playback (video with text fallback)

Visualization

  • Rhythm Highway — Guitar Hero-style scrolling note visualization with 6 string lanes
  • Fretboard Canvas — Canvas-drawn 6×12 fretboard with target/active note highlighting
  • Strum Highway — Single-lane scrolling strum arrow visualization
  • Technique Canvases — Bend Target arcs, Slide Path arrows, Vibrato waveforms, Heat Meter, Chime Bars, Tap Trails

AI Coaching

  • Post-exercise feedback and personalized exercise generation via LLM (Gemini / Claude / Grok)
  • Audio clip analysis (Gemini multimodal)
  • Weekly progress reports and adaptive lesson recommendations
  • Voice coaching via ElevenLabs TTS (with on-device AVSpeech fallback)
  • Multi-provider LLM routing with automatic fallback chains (configured via Firebase Remote Config)

Gamification

  • XP & Levels — 10 base XP per attempt + bonuses for accuracy, streaks, and passing
  • Daily Streak — Consecutive practice day tracking
  • Daily Riff Challenge — Deterministic daily exercise with streaks and weekly leaderboard
  • Metronome — Built-in with tap tempo, time signatures, and per-exercise BPM suggestions
  • Level-up celebrations and note hit effects

Account & Cloud

  • Auth — Sign In with Apple (primary), Google Sign-In (secondary), guest mode
  • Cloud Sync — Firestore sync for profiles, skill maps, sessions, coaching history, and progress
  • Leaderboards — Daily + all-time Firestore leaderboards with rank badges
  • Security — Firebase App Check (App Attest), server-side prompt templates, per-user rate limiting

Requirements

  • macOS 14.0+ (Sonoma)
  • Audio interface (tested with Universal Audio Volt 176; any class-compliant USB device works)
  • Electric guitar
  • Xcode 15+ / Swift 5.9+ (for building)

Quick Start

# Swift Package (quick build + test, no entitlements)
swift build
swift test

# Full app with signing + entitlements (XcodeGen)
xcodegen generate && open Stratisfaction.xcodeproj
# Set signing team, Cmd+R

# Cloud Functions
cd functions && npm install && npm run build && npm test

Firebase setup requires GoogleService-Info.plist in Stratisfaction/Resources/.

Tech Stack

  • Swift 5.9+ / SwiftUI with Observation framework (@Observable, @Bindable)
  • AVAudioEngine for real-time audio processing, effects chain, and song preview synthesis
  • Core Audio for input device enumeration
  • Custom YIN Algorithm for pitch detection (pure Swift + Accelerate)
  • vDSP / FFT for chord detection and DSP (onset detection, bend tracking, vibrato analysis, spectral flatness)
  • Firebase — Auth, Firestore, App Check, Cloud Functions
  • GoogleSignIn-iOS — Google Sign-In
  • Cloud Functions — Node.js 22 / TypeScript — LLM proxy, TTS proxy, rate limiting

Architecture

Volt 176 → AVAudioInputNode → Distortion → Delay → Reverb → EQ ─┐
                                                                   ├→ MixerNode → OutputNode → Speakers
AVAudioPlayerNode (Backing Track / Song Preview) ────────────────┘

InputNode tap → RingBuffer → PitchDetector (YIN) → Main Thread → UI
             → ChordDetector (FFT, every 4th frame) → chord name display

Threading Model

  1. Audio Thread (real-time) — Renders audio, writes to lock-free SPSC RingBuffer. O(1) only, no heap allocation, no locks.
  2. Pitch Detection Thread (.userInteractive) — Reads RingBuffer, runs YIN + DSP analysis, publishes via DispatchQueue.main.async.
  3. Main Thread — SwiftUI rendering, exercise evaluation, user input.

DSP Detection Pipeline

The PitchDetector runs several specialized detection algorithms alongside pitch tracking:

  • Onset Detection — Energy-based onset classification (picked, hammered, tapped)
  • Bend State Tracking — Pitch history slope analysis (8 samples, >2.0 cents/sample threshold)
  • Vibrato Detection — Oscillation frequency and depth analysis for quality grading
  • Dynamics Detection — Onset-weighted RMS scoring (EMA smoothing, dB threshold classification: pp/p/mf/f/ff)
  • Harmonics Detection — Spectral flatness + peak count + high-frequency ratio analysis
  • Tapping Detection — 7-semitone threshold + soft onset ratio classification
  • Palm Mute Detection — Spectral rolloff + amplitude decay rate (piggybacked on ChordDetector FFT)

Project Structure

Stratisfaction/
├── Package.swift / project.yml         # SPM + XcodeGen configs
├── Stratisfaction/
│   ├── App/                            # StratisfactionApp.swift, AppCoordinator.swift
│   ├── Core/
│   │   ├── Audio/                      # AudioEngine, MetronomeEngine, RingBuffer, EffectsPreset
│   │   ├── PitchDetection/             # YINAlgorithm, PitchDetector, ChordDetector, GuitarCalibration
│   │   ├── Chord/                      # ChordLibrary (33 chords), ChordCurriculum (8ch, 43 lessons)
│   │   ├── Picking/                    # PickingCurriculum (8ch, 24 lessons), SpeedChallengeEngine
│   │   ├── Fingerpicking/              # FingerpickingCurriculum (8ch, 24 lessons), PatternEngine
│   │   ├── Legato/                     # LegatoCurriculum (6ch, 18 lessons), ChainEngine
│   │   ├── Bending/                    # BendingCurriculum (7ch, 21 lessons), TargetEngine
│   │   ├── Theory/                     # TheoryCurriculum (6ch, 18 lessons), QuizEngine
│   │   ├── Slide/                      # SlideCurriculum (6ch, 18 lessons), RelayEngine
│   │   ├── Tapping/                    # TappingCurriculum (6ch, 18 lessons), TapRelayEngine
│   │   ├── Harmonics/                  # HarmonicsCurriculum (8ch, 24 lessons), HarmonicChimeEngine
│   │   ├── Dynamics/                   # DynamicsCurriculum (8ch, 24 lessons), AccentSniperEngine
│   │   ├── Exercise/                   # ExerciseEngine, StrumEngine, ExerciseLibrary (43 exercises)
│   │   ├── Adventure/                  # 8 worlds, 124 quests
│   │   ├── AI/                         # APIProxyClient, GeminiCoachProvider, VoiceProvider
│   │   ├── Song/                       # SongLibrary (82 songs), SongEngine, SongPreviewEngine
│   │   ├── Auth/                       # AuthManager (Apple Sign-In, Google, guest)
│   │   ├── Subscription/              # EntitlementTypes, SubscriptionManager (StoreKit)
│   │   ├── Config/                     # AppConfig (feature flags)
│   │   └── Persistence/               # UserProgress, ProgressStore, CloudSyncManager, Leaderboards
│   ├── UI/                             # 40+ SwiftUI views
│   ├── Tests/                          # 56 test files, 1077 tests across 65 suites
│   └── Utilities/                      # Constants (GuitarNote, PitchClass, FretboardMap, OnsetType, etc.)
├── functions/src/                      # Cloud Functions: LLM proxy, TTS proxy, rate limiting
│   ├── providers/                      # Gemini, Anthropic, xAI provider adapters
│   ├── router.ts                       # Multi-provider LLM routing with fallback chains
│   ├── prompts.ts                      # Server-side prompt templates
│   └── __tests__/                      # 180 tests across 14 suites
└── docs/plans/                         # Design docs and implementation plans

Testing

swift test    # 1077 Swift tests (65 suites)
cd functions && npm test    # 180 Cloud Functions tests (14 suites)

Status

Active development. 223 Swift files, ~71,400 lines, 433 commits. All features compile clean. Full test suite passing.

Sister Project

Synthisfaction — Same architecture adapted for MIDI keyboard/piano with synthesized instrument voices and genre-themed worlds.

Contributing

Pull requests and issues are welcome. Read CONTRIBUTING.md before opening a non-trivial PR — it covers the development setup, coding conventions, test expectations, and the contribution license terms.

License

PolyForm Noncommercial 1.0.0 — source-available for personal, educational, and non-commercial use. Any commercial use (including bundling with paid hardware, lessons, or services) requires a separate commercial license. See LICENSE for terms or contact calvin.devereaux@gmail.com to discuss commercial arrangements.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages