# Herman Haverkort

### Site Tools

proximity_mapping

# The sound of space-filling curves by proximity mapping

I am exploring different approaches to make sonifications or music of space-filling curves. This page contains a number of sound tracks of space-filling curves, mapped to sound using proximity mapping. For an introduction into space-filling curves mapped to sound using proximity mapping or other techniques, please check out the main page first. Below, I provide more details of the mapping, and some additional examples that may be interesting.

### Details of the mapping

For ease of description, consider a d-dimensional self-similar space-filling curve f: [0,1] → [0,1]d (however, the approach below can also be applied, mutatis mutandis, to non-continuous traversals). We traverse the curve, that is, the values f(t), from t=0 to t=1, sampling it at a set T⊂[0,1] of n uniformly spaced values of t. When we are at a specific value of t, we generate a tone for each other point f(t′) with t′T, generating louder tones for points that, together with f(t), define pairs for which the space-filling curve does not preserve locality well. So in total, we generate roughly |T|² tones: there are |T| time steps t, and in each step, we superimpose |T|−1 tones, one for each pair (t,t′) with tt′.

Frequency: the generated tone for the pair (t,t′) is 24·sin(½π(tt′)) semitones above C♯4 (so it will be between C♯2 and C♯6). For some sound tracks, I round the frequencies to discrete values.

Amplitude: let r be the Euclidean distance between f(t) and f(t′), and let V be the volume of a d-dimensional sphere with radius r. One could argue that in a hypothetical ideal locality-preserving space-filling curve, all points of that sphere would be covered by the curve section from f(t−½V) to f(tV). Therefore, we can say that f(t′) is “too far away” along the curve by a factor |tt′| ⁄ (½V); we denote this factor by s. We now map this factor to an amplitude of, in principle, 0.01·caps²), where α is a parameter that controls the sensitivity of the mapping (in practice, I used α=0.005 or α=0.05), and cap(x) = x ⁄ (1+x) is a function that dampens higher values so that the amplitude stays below 0.01. However, within distance r, there will be a number of points proportional to rd that generate waves of similar frequency and amplitude, and, unless they are somehow in phase, they will add up to a sound with an effective amplitude that is a sublinear but still rising function of rd. If we would not compensate for that, points farther away would completely dominate the sound track due to their sheer number. Therefore, for each point f(t′), we divide the amplitude by rβd; so far I got best results with β=1/2 if frequencies are rounded to discrete pitch values1), and with β=1/3 if they are not2). Finally, a correction is applied to compensate for the fact that our ears are less sensitive to lower frequencies: for frequency x we multiply the amplitude by (4 ⁄ log2(x ⁄ C0))1.2, where C0=16.35 Hz is considered unhearable, theoretically requiring an infinite multiplication of amplitude.

Phase: to prevent unintended interferences, a random phase shift is applied to each tone.

Timbre: for the six- and seven-dimensional curves, I used a somewhat richer timbre than for the three- and four-dimensional curves, where the timbre seems to be naturally richer, possibly due to the higher affordable spatial resolution and depth of recursion in the sampling of lower-dimensional curves.

Note that this mapping has two important consequences that can easily be recognized in the sound tracks.

1. Each subcube traversed by the self-similar space-filling curve generates exactly the same “base melody” based on pairs of points f(t) and f(t′) that both lie within that subcube. This is because both frequency and amplitude depend only on the distances between t and t′ and between f(t) and f(t′), not on their location within the curve and within the unit cube as a whole. Differences in sound between different subcubes come only from the relations between pairs of points that do not lie in the same subcube.
2. The overall sound generally rises in pitch, since, for each point f(t′), the frequency goes up as t increases. In fact, at the beginning, all tones are between C♯2 and C♯4, while at the end, all tones are between C♯4 and C♯6. This effect is not really intentional but the first effect is, and I do not see how to get one without the other.

### Examples

Below are two sets of examples. The first set is just a showcase of nice tracks. Most of these seem to be atonal, with pitch mapping as described above, without rounding. However, for the three-dimensional Z-order traversal, I found that the track was dominated by tones around a limited number of pitch classes, and that these sounded better by rounding them to equal-temperament pitch classes, so that is what I did. The second set consists of five six-dimensional traversals, roughly ordered from smoothly (and quite boring) rising sound at the top to less-smoothly rising and melodically more interesting sound at the bottom. Does this correspond to an ordering by locality-preserving properties? All space-filling curves and traversals are described in my manuscript on higher-dimensional curves.

mp3 traversal recursion depth points points/second sensitivity α comments
Meurthe, 3D 3 19,683 36 0.05 long melodic phrases
Z-order, 3D 5 32,768 60 0.005 melodic and tonal
Peano, 4D 2 6,561 40 0.05 rolling waves
Z-order, 7D 2 16,384 60 0.005 steady train
Beta Hilbert, 7D 2 16,384 60 0.005 rising beats over an ostinato
mp3 traversal recursion depth points points/second sensitivity α
Beta Hilbert, 6D 2 4,096 60 0.005
Butz-Hilbert, 6D
Base-camp Hilbert, 6D
Inside-out traversal, 6D
Z-order traversal, 6D
1)
This makes sense theoretically, since the standard deviation of rd independent signals with standard deviation 1 is equal to rd/2.
2)
This is a value that seems to work in practice, and which I cannot fully explain; I believe it might have something to do with how we perceive the loudness of mixtures of different frequencies. 