How to create minimal music with code in any programming language
A random suggestion to make for nicer, more interesting music: the article takes pitches from a table of equal tempered note frequencies relative to A440:> For example, here’s a familiar riff “E B D E D B A B”. It uses only 4 notes - D and E from one octave and A + B from the other, lower octave. If we look at the note frequency table, the pitches of those notes in octaves 5 and 4 would be 659.2Hz (E), 587.3Hz (D), 440Hz (A) and 493.8Hz (B).Instead of equal tempered pitches (which are generated by repeatedly multiplying by the 12th root of 2), use pitches that form whole number ratios with respect to the root of your key.A decent 12-note chromatic scale would be something like 1:1, 16:15, 9:8, 6:5, 5:4, 4:3, 45:32, 3:2, 8:5, 5:3, 15:8, and 2:1.  So, for instance if your root is C=256 hz, you'd have 256 hz for C, (25616)/15 for C#, (2569)/8 for D, and so on.  This is a just intonation (JI) scale.  An advantage of JI is that the musical intervals blend with each other better, whereas the advantage of equal temperament (ET) is that you can use any note as the root and change keys on the fly without causing problems.  If you're doing electronic music, though, there's a lot less reason to stick with ET: you can always just multiply your whole tuning table by a constant if you want to switch key.JI scales can be made with any ratios: the above maps well to most conventional music, but there's no rule that you have to limit yourself to 12 steps per octave.  Using the harmonic series is another option, or adding in ratios that have a 7 in them.