Music 270c: assignment 4

ASSIGNMENT 4. (due Tuesday, May 27): The object of this assignment is to search for rhythmic canons, using either exhaustive search or combinatorial optimization. The canons of interest have three parts fitting into either 16 or 32 beats, with either one or two holes. For example, this is a perfect canon in 16 beats:

  0  #  2  1  1  0  0  2  2  1  0  0  2  2  1  1
To see the canonic structure, write the sequence twice on end and compare:
  0  #  2  1  1  0  0  2  2  1  0  0  2  2  1  1  0  #  2  1  1  0  0  2  2  1  0  0  2  2  1  1
  0              0  0           0  0
                             1              1  1           1  1
        2              2  2           2  2
The onsets of the sub-rhythms are (0, 5, 6, 10, 11) and the starts are at 0, 9, and 2 for 0, 1, and 2, respectively.

There are two other essentially inequivalent solutions; the problem space is small enough to allow for an exhaustive search.

For a harder problem, do the same thing in 32 beats, with the second and ninth beats empty. For instance:

0 # 2 0 1 0 1 2 0 # 2 1 0 1 2 0 1 2 1 2 0 2 0 1 1 0 2 0 1 2 2 1
Here, I haven't been able to find an exact one. The one above has a "badness" of 12, calculated as follows. First, the onsets are, respectively,
0  3  5  8 12 15 20 22 25 27  for '0', starting at location 0;
0  1  5  8 13 15 20 22 25 27  for '1', starting at location 23;
0  3  4  8 13 16 20 23 25 27  for '2', starting at location 26.
We propose a simple distance measure between these sub-rhythms, simply reporting the total absolute value distance; so from the first to the second we get a distance of 3 (2 from the second column, 3 vs. 1; and 1 for the fifth, 12 vs. 13). The sum of the three distances in pairs is 3+5+4 (distances from row 1 to 2, 2 to 3, and 1 to 3) for 12. In an hour or so of searching I was able to find four sequences with a 'badness' of 2, of which one was degenerate. I got a few others with badnesses of 4.