Music theory for programmers

A code-first walk from air pressure to scales, chords and tuning.

Author
Luke Haas, RunJS
Published
17 August 2026
Kind
Company blog post, with runnable code
Original
runjs.app/blog/music-theory-for-programmers
Subject
Consonance and tuning
Themes
Getting good, What the senses do

What it is

Luke Haas explains music theory from first principles, using runnable JavaScript. It starts with sound as numbers, then builds up to chords and progressions. It appears on the blog of RunJS, a JavaScript playground.

What it says

What evidence it gives

The mathematics is checkable, and readers can run every example. Its claims about why things sound good are explanations, not experiments.

Interests and limits

It is a tutorial from a company selling a JavaScript tool. Musicians in the discussion dispute it as music theory. See the Hacker News thread for that pushback.

Connections

These links are this wiki's own reading, not claims the sources make.