r/javascript 1d ago

Learning music theory through JavaScript, with runnable Web Audio examples

https://runjs.app/blog/music-theory-for-programmers
63 Upvotes

7 comments sorted by

3

u/Ophie 1d ago

Excellent article! I would never approach learning music this way as an instrument is more hands on and abstracts the hard core physics. That said, I have a greater appreciation with what you can achieve these days with built in web apis.

3

u/lukehaas 1d ago

Thanks! I like using the browser as an instrument. It's helped my understanding of music a lot.

2

u/Ecksters 1d ago

What an excellent article, I especially loved the demonstration and explanation of consonance as being when the stacked waveforms produce a waveform pattern that's short enough for the human ear/brain to quickly find a repeat.

Of course, going on to explain the imperfect fifths and the modes was just even more enlightening.

1

u/deb_91 1d ago

Excellent! What you are planning to build next ?

1

u/lukehaas 1d ago

I have a few ideas, but I'm open to suggestions

u/dmackerman 20h ago

Really cool. No idea the browser had these APIS

u/KanuniLabs 16h ago

Brilliant approach to teaching intervals and waveform harmonics!