A Coordinate Space for Music — How Far the POD Analogy Holds

transition
POD
music
Mapping songs into a ~8-dimensional space. Can the modal decomposition I use for fluids be carried over as-is — and where does it break?
Published

2026-08-04

Re = 1.2×10⁴ — TRANSITIONAL

I have come to feel that we search for music almost entirely through tags: chill, for focus, emotional. Every one of them is somebody else’s word, not a coordinate of the sound itself.

In fluids, I fold fields with hundreds of millions of DOF into a few modes. Could the same be done for songs — could music be spanned by around eight axes with physical and perceptual grounding? That is the question at the moment.

同じ演算である / Literally the same operation

A point of fact first. POD in fluid dynamics and PCA in data analysis are, for discrete data, the same operation: the eigendecomposition of the covariance of a centred matrix \mathbf{X}, or equivalently the SVD of \mathbf{X}. The two names differ only in the field and the history that produced them.

\mathbf{C} = \frac{1}{m-1}\mathbf{X}\mathbf{X}^{\mathsf{T}}, \qquad \mathbf{C}\,\phi_k = \lambda_k \phi_k, \qquad \lambda_k = \frac{\sigma_k^{2}}{m-1}

So “running PCA on a matrix of song features” is, technically, no leap at all. The leap happens the moment one tries to read meaning into the axes.

import numpy as np

rng = np.random.default_rng(7)
n_songs, n_feat, n_latent = 600, 24, 8

# 24 measured descriptors generated from 8 latent factors + noise:
# a deliberately favourable setting for PCA.
W = rng.normal(size=(n_feat, n_latent)) * np.linspace(1.6, 0.4, n_latent)
Z = rng.normal(size=(n_latent, n_songs))
F = W @ Z + 0.35 * rng.normal(size=(n_feat, n_songs))
F -= F.mean(axis=1, keepdims=True)

U, sig, Vt = np.linalg.svd(F, full_matrices=False)
explained = sig ** 2 / np.sum(sig ** 2)
print("explained variance, first 10 axes:")
print(np.round(explained[:10], 3))
print(f"cumulative at 8 axes : {explained[:8].sum():.3f}")
explained variance, first 10 axes:
[0.327 0.25  0.13  0.126 0.072 0.036 0.027 0.019 0.001 0.001]
cumulative at 8 axes : 0.988
import matplotlib.pyplot as plt

fig, ax = plt.subplots(1, 2, figsize=(7.6, 2.7))

k = np.arange(1, 13)
ax[0].plot(k, np.cumsum(explained[:12]), "o-", color=BLUE, ms=3, lw=1)
ax[0].axvline(8, color=DIM, lw=.6, ls=":")
ax[0].set_xlabel("number of axes")
ax[0].set_ylabel("cumulative variance")
ax[0].set_ylim(0, 1.02)

P = (np.diag(sig[:2]) @ Vt[:2]).T          # songs projected on the first two axes
ax[1].scatter(P[:, 0], P[:, 1], s=4, color=DIM, alpha=.45, linewidths=0)
s = 0.9 * np.abs(P).max()
theta = np.deg2rad(37)                      # an arbitrary rotation of the same subspace
for (dx, dy), style, c in [((1, 0), "-", BLUE), ((0, 1), "-", BLUE),
                           ((np.cos(theta), np.sin(theta)), "--", RED),
                           ((-np.sin(theta), np.cos(theta)), "--", RED)]:
    ax[1].plot([-s * dx, s * dx], [-s * dy, s * dy], style, color=c, lw=1)
ax[1].set_xticks([]); ax[1].set_yticks([])
ax[1].set_aspect("equal")
for sp in ax[1].spines.values():
    sp.set_visible(False)

fig.tight_layout()
plt.show()
Figure 1: Left: cumulative explained variance — eight axes are enough. Right: the same 2-D cloud with the PCA axes (solid) and an arbitrary rotation of them (dashed). Both reconstruct the data equally well.

比喩が壊れる三箇所 / Where the analogy breaks

1. The axes are fixed by variance, not by meaning. The right-hand figure is the whole argument. Solid lines are the PCA axes; dashed lines are the same axes rotated by 37°. The reconstruction error is identical. The low-dimensional subspace is unique; the choice of axes within it is not. An interpretation such as “axis 3 = brightness” is not something the mathematics hands you — it appears only once you impose extra constraints (sparsity, non-negativity, independence). Eight dimensions are not discovered; they are designed. That is my current conclusion.

2. The features are not linear. A flow snapshot is the physical quantity. A musical “feature” is already a human-made transform. Tempo and loudness are perceived logarithmically, so a linear combination of them need not mean anything.

3. Distance does not match perception. Two songs close in Euclidean distance are not guaranteed to sound alike. In fluids the L^2 norm is tied to energy, a physical quantity; a music coordinate space has no corresponding conserved quantity. Nothing justifies the norm — to me, that is the difference that bites hardest.

I keep going anyway, because the place where an analogy breaks is exactly where a field’s own problem is exposed. That L^2 was the right norm in fluids was good fortune, not a law of nature — a thing I only started to see by working on music.

健太郎