Tuesday, August 20, 2024

The Interval Matrix


DRAFT
This article introduces the concept of the interval matrix from a traditional music theory perspective, alongside a software tool designed to create and visualize these matrices. In this context, intervals refer to proportions or ratios between numbers.

The interval matrix is built from all possible representations of a set's values under an equivalence relation, using each element as a base, resulting in a numerical or geometrical table—a matrix—that represents this expansion.

These matrices are not initially intended for conventional matrix operations; the focus lies in the geometric structure that emerges from different sets and their elements' relationships.

Interval Matrix software. Prime numbers up to 19(set to periodic), with equivalence 1:2 (octave-space)
\(\mathbf{Ä}_{1:2}(P_{19})\)


For an infinite set, the matrix cannot be fully generated. However, if the set has a repeating pattern (period), a minimal generating set can be identified. The matrix is then built and completed using this minimal set, (n-by-n) as seen in a common musical tuning system (a set of pitches or rhythms used to create or perform music).

This period typically becomes the primary equivalence relation (equave) parameter in the set's function for constructing the matrix and analyzing the intervals within.

The matrix can be constructed for a finite set that isn't meant to repeat. For example, in music, this approach can be used to analyze notes on an instrument where there's no indication to continue calculating additional pitches. This method applies to any finite set. In a finite matrix, each row contains one element less than the previous row.

Set and matrix construction:

For analyzing a set \(S\) that is already normalized and within the desired range—such as in any pre-calculated musical tuning system—the set remains unaltered, and the matrix is built directly \(\mathbf{A}(S)\). The only required parameter is its periodicity: Is the given set a minimal generating set of an infinite set, or does it represent a fixed, finite number of elements?

Most examples here will use periodic matrices. To denote matrix periodicity or non-periodicity, we might use different notation, such as \(\mathbf{Ä}\) for periodic matrices and \(\mathbf{A}\) for non-periodic ones.

The generalization of the interval matrix construction allows us to relate different sets and reductions, enabling us to find congruences between systems. The reduction function (which corresponds to the chroma function when the space is the octave, 1:2) for a real matrix, where the set consists of any real numbers, operates as follows:

The absolute value of each element is taken, and the function then returns this value, reduced or remapped (if necessary) by an equivalence relation:

For a value \(s_x\) larger or smaller than the chosen equivalence relation \(r\), it is reduced to a new element \(\tilde{s}_x\) by applying the operation:

\(\tilde{s}_x = |s_x| \bmod 1:r\)

(This uses the mod symbol because it effectively returns the intervallic remainder. This process involves repeatedly multiplying or dividing \(s_x\) by \(r\) until \(s_x\) falls into \((1, r]\) space.)

Since the matrix is defined by reinterpreting the set values with each element as the base, all rows inherently start with 1. Consequently, the reduction, or normalization, is consistently performed as \(\bmod 1:r\)

Optional: A constant \(\delta\) may be applied to each element of the set before performing the base change.(this in relevant for other uses explained in other article)

The reduction can be notated and performed for sets \(S_{1:r}\) without considering any matrix. It can also be used in constructing the matrix, \(\mathbf{A}_{1:r}(S)\), which implies both reduction and base shifting.

Example: If \(S\) = {1, 2, 3, 5}, then \(S_{1:2}\) ​= {1, 3/2, 5/4, 2}, and \(\mathbf{Ä}_{1:2}(S)\) would yield [{...},{...},{...},{...}]. (reduced and periodic)

Interval Matrix Definitions:

  • Full Interval Matrix: \(\mathbf{A} = \mathbf{A}_{s_n}^{\delta}\)
    This matrix uses the last or largest element of its generating set as the equivalence relation.
  • Local Interval Matrix: \(\mathbf{A}_{s_i}^{\delta}\)
    This matrix uses any element within the generating set as the equivalence relation, except for the largest one.
  • External Interval Matrix: \(\mathbf{A}_{x}^{\delta}\)
    This matrix uses a value outside the generating set as the equivalence relation. 


A full interval matrix built from a periodic set is inherently a symmetric matrix.

A full or local interval matrix is not "useful" for isotropic sets (where the chosen period or relation is a member of the set). This leads to identical and overlapping shifts of the elements.

Musical Interpretation:
For example, the 12-tone equal temperament \(\text{12ed2}\) guitar is an interval matrix (incomplete) representing the infinite set generated by the constant \(2^{1/12}\). Each row is shifted by five elements from the previous row (except between \(\text{G}\) and \(\text{B}\), where the shift is four). The matrix is trivial for this set's intervallic analysis, as columns (frets) are always aligned regardless of the shift or element taken as base.

Interval matrices are tipically shifted by one element until they are complete.

Consider this group: \(\langle 2, 3 \mid 3^2 = 1 \rangle \). This represents a set of infinite fifths and octaves. One of its minimal generating sets is \(S\) = (1, 3/2, 2]. The resulting matrix \(\mathbf{Ä}_{1:2}(S)\) has only two rows:

(1,  3/2,  2]
(1,  4/3,  2]

Interval Matrix Accumulation: \(\text{Acc}(\mathbf{A}(S))\)

This is a new set with all the representations of the elements under the set equivalence relation, which unfiltered, might repeat values, helping to find prevalent proportions. Isotropic sets always have an accumulation identical to any of their matrix rows. (The accumulation is a vectorization or flattening of the matrix)

In this case, the infinite set generated by \(\langle 2, 3 \mid 3^2 = 1\rangle\) = { ..., 1/2, 2/3, 1, 3/2, 2, ...} has an interval accumulation (under the equivalence 1:2):  (1, 4/3, 3/2, 2].

The distinction between full, local and external interval accumulations reflects the matrix type.

For example, consider a local matrix \(\mathbf{A}_{1:2}(S)\) constructed from the set {1, 2, 3, 4} in octave space (with an equivalence relation of 1:2). The local accumulation would be:

\(\text{Acc}(\mathbf{A}_{1:2}(S))\) = {1, 4/3, 3/2, 2} (filtered, with non-repeated values)

To obtain the global or full accumulation, the space is set to the largest element in the set. Thus, the matrix built from the set {1, 2, 3, 4} under the equivalence relation 1:4 would yield:

\(\text{Acc}(\mathbf{A}(S))\) = {1, 4/3, 3/2, 2, 3, 8/3, 4} (filtered)

For larger and more complex sets, the accumulation also provides a method for finding a possible natural mode of the set, if any.

Let’s take the pentatonic \(\langle 2, 3 \mid 3^5 = 1 \rangle\)
a minimal generating set is { (1, 9/8, 81/64, 3/2, 27/16, 2/1] }, its full matrix (omitting 1):

{9/8,  81/64, 3/2,    27/16, 2/1}
{9/8,    4/3, 3/2,    27/16, 2/1}
{9/8,    4/3, 3/2,    16/9,  2/1} Natural Mode
{32/27,  4/3, 3/2,    16/9,  2/1}
{32/27,  4/3, 128/81, 16/9,  2/1}

The natural mode of any set is the particular representation that includes the most frequent values appearing after shifts; it is the most faithful or weighted representation of the set.


How the Interval Matrix App Works

It accepts a list of numbers, treating them always as a minimal generating set(for now).

If the list/set is an already a reduced tuning system, the matrix is full and the equave(period, interval of equivalence) parameter should initially be set to match that of the set, typically the last and largest value. It does not adjust it automatically.

The matrix displays for each element in each row: the original value inserted, the reduced value(if it was reduced), a delta value(if it was displaced), and a rational approximation of the value.

The delta value comes from the delta parameter, usually 0. This value is added to every element in the original set before the rest of the calculations. This is useful for understanding how a minimal set, while maintaining its original absolute difference between members, shapes through this change.

For example, you can start with period/equave 1:2, and this set {1,2,3} reduces to {1, 3/2, 2}, but with delta = 3, it becomes {4, 5, 6}, and reduced, {1, 5/4, 3/2, (2)}.

Prime numbers up to 19. Delta = -1, octave-space.
\(\mathbf{Ä}_{1:2}^{-1}(P_{19})\)

The rational approximation has an adjustable tolerance value.

On top of the interval matrix, there is a configurable equal division ruler that helps with intervallic/ratio measures.

The chroma matrix has a fixed equivalence relation of an octave and, by default, starts at red. You can select whether the chromas displayed are absolute or relative to each row. When selecting relative, the full spectrum located in the bottom UI expands to display all the possible chroma shifts. (The full spectrum isn’t really "full"—you set a maximum space to occupy, with a logical maximum of the human hearing range.)

This last part is the most important when dealing with musical tuning systems; practical tuning systems have a simpler chroma matrix.

Unlike Scala files, the 1 must be inserted (remove it to understand what happens). You can, if you want, omit the equave in this list; it will be added (invisibly) from the equave parameter. However, it’s useful to keep it too, for example, when analyzing a non-octave tuning using an equave 3 (tritave). You can omit it, but if you want to inspect these intervals reduced to an octave, you might want to keep it and track it. So if when the set has an element equal to the equave, you will find two identical rows in the matrix.

Future Development

If you paid close attention to the code of this app and the SFINX app, you may have noticed that they use the same engine. That’s because, as I have pointed out, a guitar is essentially an interval matrix by string length.

My goal is to finally reunite both apps—SFINX was developed to aid in the graphic and diagram generation of scales for microtonal guitars, while the Interval Matrix was developed ideally for geometric analysis of sets and chromas.

(DRAFT)

Link to the apps:

jbcristian.github.io/xeneize/




No comments:

Post a Comment

Clarifying Functional Music Theory

I’ve mentioned functional music theory in various articles on this blog, often without specific references. This is because the concept itse...