About

I’m a mathematician, musician and software developer based in Aarhus, Denmark. This website is a journal for communicating my work and thoughts on math and music.

Recent posts

  • Angled walls in Lego
    Introduction Most Lego instructions put bricks aligned with the grid, but a few of them uses bricks at angles, for example the Corner Garage. If we look at a Lego board as a coordinate system, and assume that the brick we want to put at an angle has one end in , then it is… Read more: Angled walls in Lego
  • Dynamically Adaptive Tuning
    Background It has been known since Pythagoras that musical intervals correspond to a whole-number ratio of frequencies between the notes. The ratios for the 12 intervals in a chromatic scale are given below. Interval Ratio Unison Semitone Major second Minor third Major third Fourth Tritone Fifth Minor sixth Major sixth Minor seventh Major seventh Octave… Read more: Dynamically Adaptive Tuning
  • Compute the bit-length of an integer from bitwise shifts
    I recently had to write a simple algorithm that computes the bit-length of an integer (the number of digits in the binary expansion of the integer) given only bitwise shifts and comparison operators. It is simple to compute the bit-length in linear time in the number of digits of the integer by computing the binary… Read more: Compute the bit-length of an integer from bitwise shifts
  • High resolution fractal flames
    Fractal flames are a type of iterated function systems invented by Scott Draves in 1992. The fixed sets of fractal flames may be computed using the chaos game (as described in an earlier post), and the resulting histogram may be visualised as beautiful fractal-like images. If the histogram also has a dimension storing what function… Read more: High resolution fractal flames
  • Using the “Boids” algorithm to compose music
    Simulating flocks of birds The Boids (short for “bird-like-objects”) algorithm was invented by Craig W. Reynolds in 1986 to simulate the movement of flocks of birds. One of the key insights was that a bird in a flock may be simulated using three simple rules: Collision Avoidance: avoid collisions with nearby flockmates Velocity Matching: attempt… Read more: Using the “Boids” algorithm to compose music
  • On the creation of “The Nørgård Palindrome”
    The Nørgård Palindrome is an ambient electronic music track released recently by Morten Bach and me. It is composed algorithmically and recorded live in studio using a lot of synthesizers. It is the second track of the album, the first being “Lorenz-6674089274190705457 (Seltsamer Attraktor)” which was described in another post. The arpeggio-like tracks in The… Read more: On the creation of “The Nørgård Palindrome”
  • On the creation of “Lorenz-6674089274190705457 (Seltsamer Attraktor)”
    Lorenz-6674089274190705457 (Seltsamer Attraktor) is an ambient music track released by Morten Bach and me. It was composed algorithmically and recorded live in studio using a number of synthesizers. This post will describe how the track was composed.
  • Turtle graphics
    Turtle graphics is a method for generating images from integer sequences using very simple rules. The drawing is done by a “turtle” which moves and draws on a plane according to some rules. At any point in time, the turtle has a position and a direction, but no other state. For example, consider the Thue-Morse… Read more: Turtle graphics