Linear algebra formalism: Difference between revisions

No edit summary
No edit summary
Line 1: Line 1:
Aspects of tuning theory are often described in the language of '''linear algebra.'''  
Aspects of tuning theory are often described in the language of '''linear algebra.''' This is because the space of just intervals (and as it turns out, the space of radical intervals) constitutes a vector space. This can be determined by checking that intervals follow the axioms of linear algebra:


{{Todo|complete intro|inline=1}}
* Because stacking corresponds to multiplication of rational numbers:
** Stacking intervals is associative. For example, (3/2 * 5/4) * 2/1 is the same as 3/2 * (5/4 * 2/1).
** Stacking intervals is commutative. For example, 3/2 * 5/4 is the same as 5/4 * 3/2.
** The unison, 1/1, is the identity for stacking, as for an interval ''v'', 1/1 * ''v'' = ''v'' itself.
** Every interval has a descending counterpart, which when stacked with that interval produces the unison (1/1). For example, 5/4 * 4/5 = 1/1.
* Because exponentiation by integers is well-defined for rational numbers:
** Stacking an interval a number of times ''x'', then stacking the resulting interval a number of times ''y'', is the same as if you did it the other way around. For example, ((3/2)^2)^3 is the same as ((3/2)^3)^2.
** Stacking an interval only once just gives that interval. For example, (3/2)^1 = (3/2).
* More mathematically, since exponentiation distributes over multiplication, for intervals u and v and integer exponents x and y:
** (u * v)^x = (u)^x * (v)^x,
** (v)^(x+y) = v^x * v^y


== Monzos and vectors ==
Note that this is the fundamental definition of what it means for something to be "a vector"; vectors are defined as objects in spaces where these axioms apply.
{{Todo|complete section|inline=1}}A vector is a list of numbers, written like so: <math> \begin{pmatrix}
 
-2\\
Note that what we've described as multiplication is actually vector addition, and what we've described as exponentiation is actually multiplication of a vector (the interval) by a scalar (the exponent). Additionally, the unison is actually a zero vector. This makes sense if we think of intervals logarithmically, where multiplication of ratios becomes addition of cent values, the unison is 0 cents, and exponents become scale factors.  
0\\
1
\end{pmatrix} </math>.


== Vals and covectors ==
Conventionally, vectors are notated as lists of numbers representing coordinates in space. In linear algebra, these coordinates are interpreted as scale factors on several arbitrarily chosen "basis vectors" representing the space, which are scaled and added together to produce the vector in question. The standard and most intuitive way of notating intervals as vectors is to take the entries of that interval's monzo and interpret them as vector coordinates, where each basis vector represents a different generator in the monzo's subgroup (usually a prime number). Because the entries of a monzo represent exponents on a prime, the intuition of stacking as addition carries over. For example, the interval 5/4, which has a monzo of 2.3.5 [-2 0 1], may be interpreted as the vector [-2 0 1⟩, where we use an [[Extended bra-ket notation|angle bracket ⟩]] on the right to indicate that it is a vector. This notation is called the ''generator-count vector'', and may in this case be called the ''prime-count vector'', since the generators are the primes. However, it is also common to call the vector itself a monzo (and hence, terms like "eigenmonzo"). {{Todo|complete intro|inline=1}}
{{Todo|complete section|inline=1}}


== Mappings and matrices ==
== Mappings and matrices ==
{{Todo|complete section|inline=1}}A matrix is a grid of numbers, written like so:
{{Todo|complete section|inline=1}}A temperament mapping, in linear algebra, is represented by a matrix. A matrix is a grid of numbers, written like so:


<math>
<math>
Line 23: Line 29:
</math>
</math>


This matrix can be thought of as a "function" that you apply to a vector to get out another vector. This matrix has 3 columns, meaning the vector it takes as an "input" will have 3 elements, and it has 2 rows, meaning the vector you get out will have 2 elements. So, this is a "function" down from 3-dimensional space to 2-dimensional space.
This matrix can be thought of as a "function" that you apply to a vector (in this case, a generator-count vector) to get out another vector (here, another generator-count vector in the tempered space). This matrix has 3 columns, meaning the vector it takes as an "input" will have 3 elements (representing a rank-3 subgroup of JI), and it has 2 rows, meaning the vector you get out will have 2 elements (representing a rank-2 temperament). So, this is a "function" down from 3-dimensional space to 2-dimensional space. The columns tell us where to find the generators of our original subgroup in the space of tempered intervals. One of the key properties of linear algebra is that knowing that alone allows us to tell where every other interval ends up, and is why regular temperaments are covered so much in xenharmonic theory as opposed to irregular temperaments.
 
What follows is an explanation of several matrix operations in the mathematical language.  


== Matrix operations ==
== Matrix operations ==
Line 123: Line 131:
{{Todo|complete section|inline=1}}
{{Todo|complete section|inline=1}}


=== Practical usage ===
== Vals and tuning maps ==
Let's say we want to determine the tuning of 6/5 in quarter-comma meantone.
{{Todo|complete section|inline=1}}
 
==== Stage 1: JI to temperament ====
<math>
\begin{bmatrix}
1 & 0 & -4\\
0 & 1 & 4
\end{bmatrix}
</math>
 
This matrix I've been using as an example is actually a "function" that converts a 5-limit interval in monzo format (with the entries corresponding to powers of 2, 3, and 5) into a corresponding meantone interval in an analogous format (with the entries representing powers of meantone's tempered 2 and 3) called "tempered monzos" or "tmonzos".
 
So, let's take the monzo for 6/5, [1 1 -1⟩, and apply this matrix to it: <math>
\begin{bmatrix}
1 & 0 & -4\\
0 & 1 & 4
\end{bmatrix}
\begin{bmatrix}
1\\
1\\
-1
\end{bmatrix}
=
\begin{bmatrix}
5\\
-3
\end{bmatrix}</math>.
 
The result is the meantone tmonzo representing a tempered 6/5.
 
==== Stage 2: Temperament to tuning ====
Now, we have the tmonzo. We'll be introducing something called a tval, which gives us a specific tuning of our temperament the same way a regular val gives us a specific tuning of just intonation. The quarter-comma meantone tval for this meantone mapping is ⟨1200 ~1896.5784] in cents. This is where the dot product comes in: <math> \langle 1200, ~1896.5784 \vert 5, -3\rangle </math>.
 
Computing this dot product yields ~310.265, which is exactly the size of the QCM minor third in cents!