I have been experimenting in mathematically analysing and combining two melodies based on the twelfth root of two. Here is a mix of two known melodies: https://drive.google.com/file/d/14RQvL2Ukr_lrwbeEfHpg7pzFkF8bDCw7/view
with score: https://drive.google.com/file/d/16IzPlnxVP3EWaCYNYpeAyEadNBEp6Xdx/view I am asking if there is anything musically new in this approach, as I can not judge this.
Here is the code: (Sagemath + Midiutil + music21 + jupyter) https://github.com/githubuser1983/twelfth_root_of_two/blob/main/twelfth_root_of_two.ipynb
The mathematical approach is based on analysing the 88 keys of piano using the twelfth root of two:
Let $\alpha = 2^{1/12}, k(a,b) = \gcd(a,b)^2/(ab), q(r) \equiv a/b$ where $r$ is a real number and $a/b$ is a rational approximation. Each of the 88 keys on piano can be numbered from 0 to 87. A voice in a piece can be (without rests) given as a sequence of numbers $n_1,\cdots,n_r$ each $0 \le n_i \le 87$.
Let $H(a/b) := k(a,b)$ for a,b natural numbers. This is well defined, since $k(ac,bc) = k(a,b)$. Consider the positive definite matrix:
$$K = (H(q(\alpha^{n_2-n_1})))_{0\le n_1,n_2 \le 87}$$
and let the Cholesky decomposition be:
$$K = C C^t$$
where $C = (\phi(0),\cdots,\phi(87))$
We can interpret each vector $\phi(i)$ (with $|\phi(i)|=1$) as a piano key $i$, $0 \le i \le 87$.
A voice $n_1,\cdots,n_r$ without rests in a piece and $4$-th Durations $d_1,\cdots,d_r$ can be interpreted as the matrix:
$$M = (d_1 \cdot \phi(n_1), \cdots, d_r \phi(n_r) ) $$
Having two melocidy-matrices $M_0,M_1$ I will try to "combine" them:
$$M_{01} = (M_0,M_1), M_{10} = (M_1,M_0)$$
with the following code:
def mixMatrix(M0,M1):
M01 = np.vstack((M0,M1))
M10 = np.vstack((M1,M0))
U01,S01,V01 = sc.linalg.svd(M01,full_matrices=True)
U10,S10,V10 = sc.linalg.svd(M10,full_matrices=True)
sigma = np.zeros((U01.shape[0],V01.shape[0]))
for i in range(min(U01.shape[0],V01.shape[0])):
sigma[i, i] = np.sqrt(S01[i]*S10[i])
V = geometricMeanMatrix(V01,V10)
U = geometricMeanMatrix(U01,U10)
return np.dot(np.dot(U,sigma),V)
My mathematical question is, if there is a musically better way to combine these melody-matrices?
Thanks for your help.