Skip to content

Repository files navigation

Ear Trainer

A desktop ear training application built with Electron and TypeScript. Practice identifying notes, chords, scale degrees, and chord inversions across all major keys and modal scales, with built-in audio synthesis and MIDI output support.

Features

Note Exercises

  • Play random notes from diatonic, chromatic, pentatonic, or blues scales
  • Choose any of the 15 major keys
  • Control note count (1–8 notes) and octave range
  • Play notes sequentially or simultaneously
  • Guess the key signature from what you hear

Chord Exercises

  • Generate diatonic chords across all 7 modes (Ionian through Locrian)
  • Practice triads and seventh chords (maj7, min7, dom7, min7b5)
  • All chord inversions: root position, 1st, 2nd, and 3rd inversion
  • Identify chord degree (I–vii°) and full characteristics (key, mode, degree, inversion)

Game Mode

  • Focused guessing screen that hides note names until after your guess
  • Simple mode: pick the key or chord degree from a button grid
  • Detailed mode: identify all characteristics at once (key, mode, degree, inversion)
  • Score tracking with running accuracy percentage

Audio & MIDI

  • Built-in synthesis via Tone.js
  • Web MIDI API integration — route output to any connected MIDI device or virtual port
  • Random velocity on MIDI notes for natural playback feel

Prerequisites

Getting Started

npm install
npm run dev

To build without launching:

npm run build

Usage

  1. Select an exercise type: Notes or Chords
  2. Configure the key, scale/mode, note count, octave, and inversion options
  3. Click Play Notes and listen
  4. Use the guess buttons (or the detailed form) to identify what you heard
  5. Click Start Guessing Game for a focused, distraction-free practice session

MIDI Output

Connect a MIDI device or start a virtual MIDI port (e.g. loopMIDI on Windows, IAC Driver on macOS), then click Refresh MIDI to populate the device list. When a MIDI device is selected, audio synthesis is bypassed and notes are sent as MIDI instead.

Project Structure

src/
  main.ts               # Electron main process
  renderer.ts           # Core EarTrainer class and main UI
  chords.ts             # ChordGenerator — standalone chord generation engine
  types.ts              # Shared TypeScript types
  utils.ts              # Shared utility functions
  note-game.ts          # Note guessing game logic
  note-game-settings.ts # Note game settings screen
  chord-game.ts         # Chord guessing game logic
  chord-game-settings.ts# Chord game settings screen
  settings.ts           # Global settings
  sandbox.ts            # Development sandbox
index.html              # Main application UI
styles.css              # Application styles
docs/
  ui-design.md          # UI/UX design guidelines

Tech Stack

Dependency Purpose
Electron Desktop application shell
TypeScript Type-safe JavaScript
Tone.js Web Audio synthesis
Web MIDI API MIDI device I/O

License

ISC

About

Desktop application using electron for ear training notes, chords and so on

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages