musicimprov · projects

projects · live

musicimprov

few notes = your scale, web audio api, web

built by · musicimprov.noseydewdrop.com

what it is

A program to identify musical scales based on a few notes you play or hear. It helps you improvise fluently on piano, guitar, or any melodic instrument by quickly suggesting compatible scales and chords.

One of my biggest joys is listening through my playlists and harmonizing together with random songs. This program helps you to identify the key when you are playing with a random song. For instance, Sails of Charon by Scorpions starts with:

  1. C D E F# G A B C
  2. C# D E F# G A B C#

Then it continues with C, confirming option (1): B Phrygian. Now you can play it really fast without trying to guess the notes and the scale while listening, and you know all the triad chords.

features

  • scale detector: pick notes from piano or guitar, find matching scales instantly
  • 7 modes: ionian, dorian, phrygian, lydian, mixolydian, aeolian, locrian
  • diatonic chords: triads, 7th chords, sus chords for each scale degree
  • chord progression planner: build, save and load progressions
  • common progressions: pop classic, jazz ii-V-I, blues, andalusian and more
  • interactive piano: 1, 2 or 3 octaves, correct frequencies per octave, QWERTY keyboard shortcuts
  • interactive guitar fretboard: 6 strings, 12 frets, correct octave per string
  • song suggestions: songs per key with a Spotify embed, played right in the page
  • ear trainer: it plays three notes from a random key, the root first, and you name the key

how it works

  1. pick some notes you hear from the piano or guitar
  2. the algorithm finds all 12 major scales that contain your notes (pitch-based comparison, so enharmonics like D# and Eb match)
  3. pick a key, explore modes, see diatonic chords
  4. build chord progressions, save them, try common ones
  5. see song suggestions for that key and play them with Spotify right there

stack

vanilla HTML, CSS and JavaScript, no frameworks, no dependencies · Web Audio API (OscillatorNode, GainNode): sine wave for piano, triangle plus harmonics for guitar · Spotify oEmbed iframe API · localStorage

links