I used VST plugin loading from Python using DawDreamer framework on this track.
In mathematics, fractals are self-similar structures that occur at different levels of iteration or magnification. Sierpinski triangle is obtained from a triangle by applying an infinite series of subdivision operations. This melody is a one from the set of possible melodies which are in some sense close musical equivalents to Sierpinski triangle. The self-similarity will become apparent when some tones are silenced. The remaining sequence will nearly resemble an original one in respect to its rhythm and melody.
The sequence is produced by computing the values of expression t * t, where t is variable taking successive integer values from 0 to infinity. In this version, the obtained number is clamped using logical AND operation to contain lower 31bits. The resulting bits are then concatenated to form a continuous sequence of notes such that all contiguous 1's form notes, and 0's form silence. For each bit, the sequence of notes is then mapped to notes of a selected musical scale.