Ask HN: Tools or frameworks to build music theory games

134 points · pil0u · 9 days ago

My music theory teacher has built from scratch, without much coding knowledge, an Electron app with games. Example of games are: guess the 2-3 notes randomly played by the piano, find the intervals etc. Those are multiple choice games mostly.

He is now on a journey to build games that interact with notes on scores, like colorize all the Cs, click on the notes that are wrong vs what you hear etc.

He is building everything from scratch, with the scores, the notes, and I'm wondering if there are some tools or libraries out there that provide much flexibility to build stuff for music theory.


37 comments
ssttoo · 8 days ago
Ah, I know the feeling. I also had a teacher who built his own things with very limited coding skills. Then I started making quick flashcard-style exercises and he was a lot of help testing and helping refine these. So now I have this site with various tools I built over the years: https://www.onlinemusictools.com/

Libs that helped:

- https://github.com/saebekassebil/teoria for scales, chords etc

- https://github.com/0xfe/vexflow for notation

- https://github.com/goldfire/howler.js for playing piano samples. I used to DIY (because I love DIY), not even using WebAudio but recently tried howler and it's abstracting a few things I don't need to worry about

- https://github.com/omnibrain/svguitar/ draw guitar fretboard. I recently did my first guitar-specific exercise and this was good. I even filed a feature request and the dev did it

I'd be happy to help you and your prof if you need anything, lmk

Show replies

tomduncalf · 9 days ago
https://github.com/tonaljs/tonal does a bunch of theory stuff. I think there’s another JS library I’ve used too but I can’t think of the name.

If he wants to generate audio, Tone.js can be a useful higher level abstraction for WebAudio.

Show replies

burningion · 5 days ago
retooth · 9 days ago
I am not sure if it is only JS libraries you are looking for (since it is an Electron app), but I released a fairly comprehensive python music theory library that not only supports Western tunings, but all sorts of equal temperaments. It even has some support for post-tonal music theory.

https://xenharmlib.readthedocs.io/en/latest/

bambax · 4 days ago
I made a webapp for learning sight reading:

https://www.babeloop.com/

It's built mostly from scratch except for the disply of notes that uses VexFlow and the playing of notes, that uses Tone.js

VexFlow is pretty cool.

There are js libraries for dealing with music theory; I can look into that again if you need.

Show replies