User:Frostburn/Theory From First Principles: Difference between revisions

Frostburn (talk | contribs)
Fix superscripts. Do more geometric algebra non-sense.
Frostburn (talk | contribs)
Various tweaks, define the JIP and make a bad pun.
Line 1: Line 1:
Just using Xen Wiki as a notepad, don't mind me.
Just using Xen Wiki as a notepad, don't mind me.


I'm currently working on the grammar for Scale Workshop 3. It will naturally include monzos and I'm debating if I want to include vals so I'm writing stuff down as a thinking aid.
I'm currently working on the grammar for Scale Workshop 3. It will naturally include monzos so I'm writing stuff down as a thinking aid. I already implemented vals because of these notes.


== Time Domain ==
== Time Domain ==
Line 10: Line 10:


== Scalar Domain ==
== Scalar Domain ==
Frequencies are scalar multiples of each other and especially the positive rational scalars are of particular interest in music.
Frequencies are scalar multiples of each other and especially the positive rational scalars are of particular interest in music such as the interval between 300Hz and 200Hz, the [[3/2|just perfect fifth]].


== Pitch Domain ==
== Pitch Domain ==
Line 16: Line 16:


== Adding Geometry ==
== Adding Geometry ==
By the [[Wikipedia:Fundamental theorem of arithmetic|fundamental theorem of arithmetic]] logarithms of primes are linearly independent over <math>\mathbb{Q}</math>, so we can interprete <math>\log(2), \log(3), \ldots</math> as basis vectors. We write <math>e_p</math> in place of <math>\log(p)</math>.
By the [[Wikipedia:Fundamental theorem of arithmetic|fundamental theorem of arithmetic]] logarithms of primes are linearly independent over <math>\mathbb{Q}</math>, so we can interprete <math>\log(2), \log(3), \ldots</math> as orthogonal basis vectors. We write <math>e_p</math> in place of <math>\log(p)</math> and enforce orthogonality
 
<math>e_p \cdot e_q = 0, p \ne q, p, q \in \mathbb{P}</math>


To make things slightly more formal we define the right-facing arrow function
To make things slightly more formal we define the right-facing arrow function
Line 34: Line 36:
In combination with implicit scalar multiplication the similarity with Scale Workshop's N-of-EDO notation is unmistakable e.g. <math>7 \backslash 12 = 700 ¢</math> .
In combination with implicit scalar multiplication the similarity with Scale Workshop's N-of-EDO notation is unmistakable e.g. <math>7 \backslash 12 = 700 ¢</math> .
== Expanding geometry ==
== Expanding geometry ==
Equal temperaments can be represented by [[Val|vals]] which we define as
It's instructive to construct <math>\mathrm{ratio}</math> more explicitly by considering the inverses of the basis vectors
 
<math>
\begin{align}
e^p :&= e_p ^ {-1},\\
e_p \cdot e^p &= 1
\end{align}
</math>
 
Note that we're leaving the metric unspecified i.e. what <math>e_p \cdot e_p</math> equals. For the structure of the space we're constructing a positive metric suffices i.e. <math>e_p \cdot e_p = w_p^2 > 0, w_p \in \mathbb{R}</math>. We now have:
 
<math>\mathrm{ratio}(x) = \prod_{p \in \mathbb{P}} p^{x \cdot e^p}</math>
 
i.e. the superscript vectors act as measuring sticks telling us how much of each prime there is in a vector.
 
Let's ''coin'' a new unit called ''jorp'' (think ''Europe'') <math>€ = ¢^{-1} = 1200 \cdot \overrightarrow{2}^{-1}</math> which measures intervals with a resolution of 1200 ticks per octave.
 
One conceptually important measuring stick is the one constructed from the logarithms of the primes:
 
<math>\mathsf{JIP} = \sum_{p \in \mathbb{P}} e^p \log p</math>
 
I say ''conceptually'' because this [[Just_intonation_point|just intonation point]] violates linear independence over <math>\mathbb{Q}</math> and doesn't strictly belong in the space we're constructing. Anyway:
 
<math>
\begin{align}
\mathsf{JIP} \cdot x &= \log(\mathrm{ratio}(x))\\
\mathrm{ratio}(x) &= \exp(\mathsf{JIP} \cdot x).
\end{align}
</math>
 
However rational approximations to the <math>\mathsf{JIP}</math> do belong in our space. Equal temperaments can be represented by such approximations called [[Val|vals]] which we define as


<math>\mathrm{val}(n; a, b, \ldots, z) := n \overrightarrow{a}^{-1} + \lfloor n \log_a(b) + \frac{1}{2}\rfloor \overrightarrow{b}^{-1} + \ldots + \lfloor n \log_a(z) + \frac{1}{2}\rfloor \overrightarrow{z}^{-1}</math> ,
<math>\mathrm{val}(n; a, b, \ldots, z) := n \overrightarrow{a}^{-1} + \lfloor n \log_a(b) + \frac{1}{2}\rfloor \overrightarrow{b}^{-1} + \ldots + \lfloor n \log_a(z) + \frac{1}{2}\rfloor \overrightarrow{z}^{-1}</math> ,
where the negative superscripts are geometric inverses i.e. <math>\overrightarrow{v}^{-1} \cdot \overrightarrow{v} = 1</math>.


Usually the basis is obvious from context e.g. <math>a = 2, b = 3, c = 5</math>. In these cases we use a left-facing arrow e.g.
Usually the basis is obvious from context e.g. <math>a = 2, b = 3, c = 5</math>. In these cases we use a left-facing arrow e.g.


<math>\overleftarrow{12} := \mathrm{val}(12; 2, 3, 5) = 12 e^2 + 19 e^3 + 28 e^5 =: \langle 12, 19, 28 \rbrack</math>
<math>\overleftarrow{12} := \mathrm{val}(12; 2, 3, 5) = 12 e^2 + 19 e^3 + 28 e^5 =: \langle 12, 19, 28 \rbrack</math>
The superscripts are simply the geometric reciprocals of our basis. See unit considerations below.


We can use these new objects to calculate how many steps of 12edo a tempered interval spans e.g.
We can use these new objects to calculate how many steps of 12edo a tempered interval spans e.g.
Line 61: Line 89:


<math>\overleftarrow{5} \cdot \overrightarrow{676/675} = \langle 5, 8, -\frac{7}{2}, 0, 0, \frac{7}{2} \vert 2, -3, -2, 0, 0, 2 \rangle = 0</math>
<math>\overleftarrow{5} \cdot \overrightarrow{676/675} = \langle 5, 8, -\frac{7}{2}, 0, 0, \frac{7}{2} \vert 2, -3, -2, 0, 0, 2 \rangle = 0</math>
Note that above I've implicitly used a convenient metric to carry out the calculations which is fine due to the new basis still being orhogonal. Explicitly we'd have
<math>\overrightarrow{13/5}^{-1} = (w_{13} \hat{m} - w_5 \hat{k}) / (w_5^2 + w_{13}^2)</math>, where the weights decide how much 13/5 "leans" toward 5/1 or 13/1.


== On units ==
== On units ==
Scalars do not have units. That's what makes them scalars. Do pitches have units? Maybe they are like radians, unitless but it makes no sense to add them to other kinds of objects. Whatever the case may be, prime count vectors (i.e. monzos) have inverse units to vals. This should be enough to distinguish them during SW3 runtime and prevent vals from being interpreted as pitch or turned into frequencies.
Scalars do not have units. That's what makes them scalars. Do pitches have units? Maybe they are like radians, unitless but it makes no sense to add them to other kinds of objects. Whatever the case may be, prime count vectors (i.e. monzos) have inverse units to vals. This should be enough to distinguish them during SW3 runtime and prevent vals from being interpreted as pitch or turned into frequencies.


Line 70: Line 100:
A reciprocal cent satisfies <math>¢^{-1} \cdot ¢ = 1</math> so as per the usual definition of the geometric inverse of a vector we have <math>¢^{-1} = ¢ / (¢ \cdot ¢) = \frac{1}{1200}e_2 / (\frac{1}{1200}^2 e_2 \cdot e_2) = 1200 w_2 \hat{i} / (w_2^2 \hat{i} \cdot \hat{i}) = \frac{1200}{w_2}\hat{i}</math>.
A reciprocal cent satisfies <math>¢^{-1} \cdot ¢ = 1</math> so as per the usual definition of the geometric inverse of a vector we have <math>¢^{-1} = ¢ / (¢ \cdot ¢) = \frac{1}{1200}e_2 / (\frac{1}{1200}^2 e_2 \cdot e_2) = 1200 w_2 \hat{i} / (w_2^2 \hat{i} \cdot \hat{i}) = \frac{1200}{w_2}\hat{i}</math>.


Let's define superscript basis vectors as
Now we have <math>e^2 = e_2 / w_2^2 = \hat{i} / w_2</math>. A reciprocal cent can now be expressed as <math>¢^{-1} = 1200 e^2 = 100 d^{-1} \hat{i}</math> or 100 reciprocal demitones in the <math>\hat{i}</math> direction.
 
<math>e^p := e_p ^ {-1}</math>
 
i.e. we have <math>e^2 = e_2 / w_2^2 = \hat{i} / w_2</math>. A reciprocal cent can now be expressed as <math>¢^{-1} = 1200 e^2 = 100 d^{-1} \hat{i}</math> or 100 reciprocal demitones in the <math>\hat{i}</math> direction.


== Clifford algebra nonsense ==
== Clifford algebra nonsense ==
Line 119: Line 145:


Exterior algebras do have a sense of lying-in-the-plane-of but we need a metric to do projection and tuning which we already touched upon in the units section. As far as data structures go, full Clifford algebras are memory-hungry. Not worth the complication in a general purpose tool like Scale Workshop.
Exterior algebras do have a sense of lying-in-the-plane-of but we need a metric to do projection and tuning which we already touched upon in the units section. As far as data structures go, full Clifford algebras are memory-hungry. Not worth the complication in a general purpose tool like Scale Workshop.
To explore our space a bit longer we can consider <math>e_2</math> as an interval class consiting of all multiples of the octave. After all we have <math>\overrightarrow{8} = 3 \cdot \overrightarrow{2} = 3 e_2</math>. Wedging gives us larger classes. <math>e_2 \wedge e_3</math> can be seen as representing Pythagorean just intonation. Unfortunately the wedges are not powerful enough to distinguish subflavors <math>\overrightarrow{2} \wedge \overrightarrow{9} = 2 \cdot \overrightarrow{2} \wedge \overrightarrow{3} = \overrightarrow{4} \wedge \overrightarrow{3}</math> but at least the "orientation" is correct. Previously we used the term "just intonation" to refer to lack of tempering but it's also used to refer to an interval class such as 5-limit just intonation representable by <math>e_2 \wedge e_3 \wedge e_5</math>.
One interesting pseudo-object in our space (let's call it <math>\mathbb{S}</math>) is the unison plane:
<math>\{\mathsf{JIP} \cdot x = 0, x \in \mathbb{S}\} = \{\overrightarrow{1}\}</math>
which strictly speaking consists of only a single element, namely the unison 1/1. However all commas lie close to this plane so it's informative to look at 3D subspaces of <math>\mathbb{S}</math> facing the unison plane to get a 2D view of all commas of interest. The null-space of all reasonable temperaments are also closely aligned with this plane.