Tuesday, September 17, 2024

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 itself has numerous interpretations and developments, many of which I do not fully subscribe to. This text aims to clarify the broad idea of functional music theory without presenting a definitive version or endorsing any particular school of thought.

Rather than proposing a new theory, the goal here is to introduce and explore some of the foundational ideas that are commonly shared across different music schools. Before we delve into functional music theory, we need to establish some basic concepts in general terms.

The Nature of Music Theory

Music theory inevitable emerges as soon as you ask the question, "What is music?". It’s an abstract concept, it resists absolute definition, but we can extract core ideas from the diverse interpretations. At a basic level, music belongs to the arts and is deeply tied to subjectivity, culture, and human expression.

The Transference of Information Through Sound

Music, in essence, is communication—an abstract form through which ideas, emotions, and concepts are transferred from one mind to another. This transfer occurs through various media: sound, symbol, and thought. Primarily, it is known to humans through the medium of sound, though secondary forms, such as symbols or memory, retain an operational presence.

If we are to delve deeper, we find that sound itself is a carrier of information, operating within the physical realm, yet touching the cognitive. Information exists before sound; sound encodes it. Music, in turn, is a higher-level abstraction, an arrangement of sound—an information matrix, if you will.

Sound and Human Responses

Many abstract sounds provoke responses—biological, emotional, and psychological—without conscious arrangement.
A soft rainfall may invoke tranquility in some, while a thunderstorm might provoke anxiety.
Sounds like laughter can elicit joy, while gagging sounds may trigger a reflex response.
Herein lies a crucial question: Are these sounds, which clearly communicate and evoke response, music? They are not traditionally recognized as such, but they exist within the same structure of information and response that music operates within.

Sound, Order, and the Illusion of Predictability

What, then, of music’s relationship to order? We speak of the "arrangement of sound." To arrange, one must introduce a semblance of order. However, order is a concept which, when examined, fractures into multiple interpretations. To the human mind, order suggests predictability, structure, a system of relationships. Yet, order can also be chaotic—an arrangement need not be symmetrical, nor need it follow a discernible pattern, to be ordered.

Thus, even an arrangement of random, chaotic sounds retains the capacity to provoke emotional responses. Music, while often regarded as the embodiment of order and harmony, can collapse into noise—and yet, it is still perceived as music by some.

This ambiguity is significant. To define music is, therefore, to draw a line in the sand, a line that is ultimately subjective. It is a construct, one that shifts depending on the observer.

Traditional Core Elements of Music: Rhythm, Harmony, and Melody

In the realm of music theory, certain elements have achieved universal recognition—rhythm, harmony, and melody. Though they are typically considered distinct, these elements are, in fact, temporal manifestations of the same underlying phenomenon.

One could posit that rhythm is harmony extended through time, just as harmony is an instantaneous rhythm. In this sense, these elements are malleable, capable of transforming into either noise or structured sound. This convergence of philosophical concepts is common among schools of thought in music theory, revealing the unity between these seemingly distinct categories.

Thus, when we study music theory, we often refer to this phenomenon simply as 'harmony,' a term that encompasses the multidimensional spectrum of sound—including rhythm, melody, and even noise. Harmony becomes a representative of this shared information, a framework that binds these different expressions of sound into a cohesive whole. It is through this lens that we can explore not only music’s more structured elements but also its potential for transformation and abstraction.

The Function of Music

Functional music theory explores the function of sound within music. In well-defined music, broader concepts like song function have been studied, suggesting universal characteristics. For example, research has shown that even people from isolated cultures can recognize common types of songs (like lullabies or dance music) from other cultures.

Functional music theory, as it stands, concerns itself with the relationships between sounds—specifically, the roles that pitches play within sequences, and how they elicit logical emotional responses in the listener.

At the heart of this theory lies the recognition of octaves as chroma equivalent.

Octaves represent the simplest integer ratio, 1:2, a pattern of zero entropy in information terms. This ratio is both mathematically and physically significant, as it is both the second harmonic and the second subharmonic of the fundamental. Its prevalence is no coincidence; it is a natural consequence of how sound is produced and perceived. It is, in effect, the final reduction of integer space, the last refuge of harmony.

From there, functional theory spirals outward, it seeks to understand the pull between tones, the gravity that holds music and emotion together, is a study of relationships. In this framework, cadences—the resolution points in music—are not arbitrary but are structured to evoke a predictable, logical response in the human mind.

Music as a Universal Language

But are these cadences universal? Are they independent of the mind, existing as objective truths in the same way as mathematical laws? The answer is elusive. While most musical traditions acknowledge a hierarchy of pitches—melodies, cadences, and symmetries that revolve around a central note—this hierarchy is as much a reflection of the human mind as it is of the natural world.

Functional music theory presents compelling evidence for the universality of certain musical structures, yet cultural differences beg the question: how much of music is learned, and how much is inherent?

The pentatonic scale—so often cited as a universal structure—presents an intriguing case. Is it a natural construct, born of the universe itself, or is it merely a human invention? Some argue that the scale, like the twelve-tone equal temperament system, is a tool—technology devised by humans to impose order on sound.

From the first person to construct a scale based on the harmonic series, we have continuously reinforced this learning, repeating it in our music, our instruments, our art. Yet, does this repetition prove that it is a natural truth, or merely that we have taught ourselves to hear it that way?

The Nature of Music as Information

Claude Debussy once suggested that music travels through the very fabric of space, with the artist merely acting as an antenna, receiving signals from beyond the veil of consciousness. While poetic, this idea holds a kernel of truth. Music, as information, is remarkably simple in its symbolic and physical structure. It is compressible, reducible to patterns and ratios, even in its most intricate forms. Without delving too deeply into signal processing, music is unique among other forms of information in that it exists already in its optimal format for communication. Music is the wave itself.



Throughout history, music has been used to soothe, inspire, manipulate, and control—its functions as varied as the societies that produce it. The universe, though governed by fixed laws, is far from static. Music, like all things, evolves.

In this discussion of functional music theory, I have aimed to collapse the spectrum of  interpretations without extending the influence of any particular school. I’ve deliberately avoided overemphasizing terms like 'tonic' and 'octave'—I haven’t even mentioned 'dominant.' As we progress through the study of pitch function, schools of thought inevitably diverge. Nevertheless, there is solid ground beneath many theories. For instance, just intonation systems have evolved impressively, retaining backward compatibility with Western tradition. Similarly, the xenharmonic school has extended the study of interval functions in fascinating ways. Yet, I argue that some of these approaches neglect fundamental concepts, such as the use of interval and chroma matrices, revealing a weakness in their grasp of tuning systems and their intervals’ functional roles. (and don't even mention timbre!)

From functional theory, I accept the significance of the tonic (the baptism) and the octave (the crucifixion). As for the rest of the music-bible, it may well be apocryphal. And without exaggeration, musicians can thrive without any theory at all. For some, theory is merely an extra layer of fun.

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/




Thursday, August 8, 2024

Pythagorean Scale ≅ Z/12Z ⊕ Z

There are many different music schools and an infinite number of methods for creating musical tuning systems, but most use a similar process. Known since antiquity, with slight variations and mutations through the years, it is now referred to (in modern Western music theory) as "chaining and reducing/folding" (and similarly in other languages: encadenamiento y cancelación).

From the Pythagorean school, the method is provided by Boethius, the algorithm which involved calculating seven fifths in one direction and five in the other, (Guido d'Arezzo refers to the "chaining" as "connuctio") is identical to the sanfen sunyi (三分損益) method, known in english as up-down generation. There is an older appearance of this method from Mesopotamia that generates notes similarly and arrives to the same system. 

For example, the 3-limit 12-tone Pythagorean scale, also the shí’èr lǜ (十二律) or “twelve-pitch” system, takes twelve consecutive powers of 3 and reduces them by octave 1:2. The scales are then presented as the size-ordered values in the \((1, s_n]\) range and can be seen as its minimal generating set, \(S\). These values are used to compute the rest of the ratios for a given instrument based on a fixed reference frequency \(f\).
\[ \bigcup_{k \in \mathbb{Z}} \{ s_n^k \times s \times f \mid s \in S, f \in \mathbb{R/Z} \} \] This makes the system a group-like structure, no longer abstract. It is not a minimal generating set but a subgroup—a quotient by an equivalence class \(Q/{\sim}\), usually the octave, the free generator.

To keep examples shorter, consider the 3-limit pentatonic scale with 5 notes, the first 5 powers of 3 reduced by octaves:

9/8, 81/64, 3/2, 27/16, 2/1

(usually found in base(9/8): 9/8, 4/3, 3/2, 16/9, 2/1)

Every pitch in the Pythagorean or Pentatonic scale can be expressed as the product of powers of its generators.

Let \( \text{Pentatonic} = \langle 2, 3 \,|\, 3^5 = 1 \rangle \) where each pitch \(p = (2^n \times 3^{m \bmod 5}) \) with \( n, m \in \mathbb{Z} \).

With an identity, inverses, associativity, and closure, this is similar to a finitely generated abelian group \( G = \langle a, b\, |\, b^k = 1 \rangle \), a direct sum of a cyclic group of order k (a modulo-constrained generator) and an infinite cyclic group or free abelian group.

So, \( \langle \text{Pentatonic}\rangle = \mathbb{3_{5}\oplus 2}\) is isomorphic to \( \mathbb{Z/5Z \oplus Z} \).

Its minimal generating set (also called the "basic region" or "fundamental domain") expressed as ratios is:

{ (1, 9/8, 81/64, 3/2, 27/16, 2/1] }

(The 1 is usually omitted in presentations like synthesizer tuning files.)

These correspond to the elements:

1     = (2^0  * 3^(0%5)),
9/8   = (2^-3 * 3^(2%5)),
81/64 = (2^-6 * 3^(4%5)),
3/2   = (2^-1 * 3^(1%5)),
27/16 = (2^-4 * 3^(3%5)),
2/1   = (2^1  * 3^(5%5)),


which correspond to elements of a subgroup of <Pentatonic>, a quotient by an equivalence class, keeping one representative for each.

\( x \sim y \Leftrightarrow x = y \times a^k\) where \(k \in \mathbb{Z}\) and \(a = 2\) (the unconstrained generator).

So, \( P/{\sim} = \{\,\{\, x_{i\bmod 5} \times 2^k\,\vert\,k,i \in \mathbb{Z}\,\}\,|\, x_i \in P\,\}\cong \mathbb{Z/5Z} \subset P \)

while in a group with abstract generators there aren't "consecutive elements", here elements can be ordered by size, and since the system is infinite in both directions indexing uses a reference, for example, to the identity element, in this case: (2^0  * 3^(0%5)) =  \( x_0 = 1 = e = \text{Unison} \)

The interval matrix is constructed from all \( P/{\sim_{x_i}} \) with each \(x_{i_j}\) taken as \(x_{i_j}/{x_{i_0}}\)

\(\langle x_0 \rangle =\) {   9/8, 81/64,    3/2, 27/16, 2/1 }
\(\langle x_1 \rangle =\) {   9/8,   4/3,    3/2, 27/16, 2/1 }
\(\langle x_2 \rangle =\) {   9/8,   4/3,    3/2,  16/9, 2/1 } Natural Mode
\(\langle x_3 \rangle =\) { 32/27,   4/3,    3/2,  16/9, 2/1 }
\(\langle x_4 \rangle =\) { 32/27,   4/3, 128/81,  16/9, 2/1 }

Other tuning systems are generated similarly, with more complex structures incorporating additional generators and relations. For example, a common variation of the diatonic scale uses two generators, calculates 3 fifths and a major third for each except the last one.

So, \( \text{Diatonic} = \langle 2, 3, 5\,|\, 3^4 = 1, 5^2 = 1\rangle \) then

\( D/{\langle 2^n\times 3^3\times 5^1 \,\vert\, n \in \mathbb{Z} \rangle^D}\) remove, traditionally, the major third of the Re; the \([\text{135}]\) harmonic class :

Fa ← Do → Sol → Re
↓    ↓    ↓
La   Mi   Si

The 3-limit subgroup (as in Western music theory) is a closed-infinite example:

\( \text{3-limit}=\langle 2,3\,\vert\rangle \cong\mathbb{Z\oplus Z}\)

General form:
\(G = \langle a_1, a_2, \ldots, a_n\, \vert\, a_{i_1}^{k_1}=e,a_{i_2}^{k_2}=e,\ldots, a_{i_j}^{k_j}=e \rangle \cong \mathop{\LARGE\oplus}_{i=1}^n \langle a_i \rangle \)

While it may seem practical to describe these tunings as groups using Equave/Octave Reduction, \( a \cdot b = \text{Octave Reduction}(a \times b)\) this is not strictly necessary. Standard multiplication can also be employed as the group operation, provided the correct relations are specified.

This perspective is valuable for understanding the structure and nature of pitches, but musical functions such as transposition, retrograde, and inversion can be performed abstractly within specific classes, rather than directly on pitches. Systems with a single generator (isotropic* or equally divided), like the 12-tone equal temperament \( 12{\text{ed}}2 = \langle 2^{n/12} \rangle\) with \( n \in \mathbb{Z},\, \langle12{\text{ed}}2\rangle = \{\ldots, 2^{−1/12}, 1, 2^{1/12}, \ldots\} \), are simpler to describe from a construction standpoint (see chromas). In these systems, equivalence relations lead to shifts (cosets), which are invariant and congruent. Unlike other systems, there is no fundamental region, only the generator itself, which results in a trivial analysis as shown by its simple interval matrix. However, subscales derived from any number of equal divisions can still be considered potential group-like structures.

For example, the pentatonics scales derived from 12EDO are also isomorphic to \(\mathbb{Z/5Z}\).

Each element or step \( g_k = (\, k +(\,(\,p \times (n \bmod 5)) \bmod 12)\) with \(n,k \in \mathbb{Z},\,p \in \{5,7\} \)

\(5\) and \(7\) are the only non-trivial generators of the additive group \(\mathbb{Z/12Z}\), constrained to a 5-cycle:
(the first 5 classes in the "circle of fifths/fourths")

...
k =-1 
{ 11, 1, 3, 6,  8 }, \(\flat\)
k = 0 {  0, 2, 4, 7,  9 },
k = 1 {  1, 3, 5, 8, 10 }, \(\sharp\)
...

Some other systems don't directly fit within this generative process or group paradigm, but all are subsets of  \( \mathbb{R}^{+} \). Nevertheless, many functions can still be applied to generate scales and chord progressions.

Incorporating group theory concepts into tuning theory enhances manageability and categorization, given the vast array of possibilities (Serialism appreciates this).


*While the direct sum Z/nZ × Z might appear trivial from a purely group-theoretic standpoint, it is used as a generalization of the "chain and reduce". Unlike abstract group theory where elements are represented by generators and their powers (e.g., a^-2 * b^1), in tuning we deal with concrete frequency ratios (e.g., 2^-2 * 3^1 = 3/4).

*While most systems are typically presented as either Just Intonation or Equal Divisions, this dichotomy becomes problematic when encountering variations. Just Intonation traditionally involves rational intervals, and Equal Divisions involve irrational ones, but this distinction isn't always clear-cut; there are equal divisions of rational intervals and vice versa. A more descriptive categorization is non-isotropic and isotropic, abstracting away the nature of generators. Determining the exact categories and properties might be subjective, but these terms broaden the definition, reduce ambiguity, and preserve the original meanings of established terms. This approach aligns with the accepted notion that consonance is linked to timbre, pitch, and function.

Monday, August 5, 2024

Chromas: The Most Important and Ignored Property in Music/Tuning Theory

As a perceptual characteristic of sound, chroma has its roots in psychology, modeling human categorization of pitches. A chroma, essentially a pitch class under octave equivalence, stands distinct from the broader concept of a pitch class used in some music schools, which refers to a period within a construction (a potentially arbitrary selection for an equivalence relation).

Humans consider pitches in a 1:2 ratio as being equivalent, having the same "color". This aligns with the observed logarithmic perception of sound, highlighted by the timeless practice of functional music (the function of music refers to the ubiquitous tension/release nature of chord progressions like \(\text{V}_7 \to \text{I}\) ).

Chromas are the fractional part of the logarithm with base 2 of x. However, since we are talking about ratios, chromas are normalized to the octave space to express them as a ratio from 1:

\( \text{chroma}(x)=2^{\log_2(x)\mod 1} \)  or  \( \Xi(x) = x \mod 1:2 \)

So, the chroma of 3, 6, 12, 24, etc., is 1.5 or 3/2, the fifth.

Generalized Reduction (ratio/intervallic remainder) function:

\[ \mathop{ \Xi}_{[a,b]}(x) = x \bmod a:b = \frac xa \bmod \left[1,\frac ba\right] = \left(\frac ba \right)^{\left(log_{b/a}( x/a) \bmod 1\right) }\]


The term is not just convenient but accurate. Its precise definition and utility are often misunderstood due to misconceptions about synesthesia and holistic interpretations.

There is no "red pitch"; rather, by assigning a reference pitch to a color, one can map chromas to different ratios. It’s a relative property but with an exact correspondence. We are blind to an octave above the frequency of red, as the visible light spectrum spans precisely one octave in frequency.

If we select red as unison (1:1), the RGB set is in a 4:5:6 ratio, a major chord:

Red   ~ 400 THz = f(1)
Green ~ 500 THz = f(Red * 5/4)
Blue  ~ 600 THz = f(Red * 3/2)

With violet as root, the 4:5:6 chord wraps chromas, the color wheel is modular.

Violet ~ 700 THz = f(1)
Yellow ~ 466 THz = f(Violet * 5/4 mod Red)
Cyan   ~ 525 THz = f(Violet * 3/2 mod Red)

(Note: The colors and frequencies presented are illustrative approximations. Determining the exact transition point between colors is analogous to a fundamental question in music theory: when does one pitch become the next? Functional music theory addresses this by emphasizing the importance of context over fuzzy interval boundaries. A more radical interpretation suggests that chord progressions, such as the high-entropy V7 to low-entropy I, are inherent musical structures independent of human perception.)

"Optical illusions" demonstrating how context affect chroma interpretation (the additive light synthesis works for far smaller resolutions than screens too), open and zoom!

Both squares are the same color; orange/red with yellow/light green,
which are unidentifiable on the left.

Both squares are the same light green.

Both circles are red.


To analyze any tuning system, it is more useful to understand its chroma content than any other aspect. A simple rule is that for finite generating sets, if the period is not in phase with the octave, the chromas are infinite, making these types of systems less useful for common music practice.

Consider the Bohlen-Pierce tuning, its equalized form named 13ed3 (13 equal divisions of 3, the tritave). Though it "has 13 classes," this is but a mirage, as the chromas are infinite. Also, tunings with uniform step size trivializes any equivalence relation, leaving no "fundamental domain."

With octave equivalence, you can join any jam by just trusting pitch classes with the same chromas. If the chord is an A, you can safely play it in any range. In a non-octave gathering, where every participant plays in a different, for example, tritave, while it may be a fun experiment, any intended functional music will be disrupted.

Non-octave tunings, with their siren call of possibilities, ultimately hinder collaborative music-making.

A set with infinite non repeated chromas are the prime numbers.
A set with infinite repeated chromas are the odd numbers.
A set with infinite identical chromas are the even numbers.

(DRAFT)

Thursday, August 1, 2024

The Average Tuning System: Scala Archive Statistics

This tuning system is a simple descriptive statistical representation of the scala archive, a renowned curated database of global tunings, seeking common ground and practical use among diverse world tunings.

Interval    Traditional Western Name
16/15       minor diatonic semitone
10/9        minor whole tone
7/6         septimal minor third
6/5         minor third
5/4         major third
4/3         perfect fourth
√2
3/2         perfect fifth
8/5         minor sixth
5/3         major sixth
12/7        septimal major sixth
9/5         just minor seventh
15/8        classic major seventh
2/1         octave


Statistics and tuning construction:

Out of the 5,176 files, the range of system sizes extends from 2 to 579. The average system size is 17, with a median of 12. The mode is also 12, appearing 1,546 times, followed by 7-note size tunings with 715 occurrences. This signifies a diverse collection, albeit with a notable concentration of systems hovering around the 12-note mark.

Top 5 Sizes

Size  Occurrences
12    1546
7     715
5     231
19    218
8     206


While some files span multiple octaves or include non-reduced intervals below the unison, these instances are relatively rare. Most are periodic tunings in alignment with the octave, the archive's most common interval. (Note: rather than relatively rare, some are intentionally wrong, since scala file definition specifies the omission of the 1, and conclude with the equave, implementations may totally ignore those values)

In a direct analysis of the files, the first key from each tuning, totaling 87,558 notes, reveals the octave as the most common, appearing with its exact representation in 4,481 total files and with close variations in practically all tunings.

The perfect fifth emerges as the second most popular interval, succeeded by the perfect fourth and major third.

Distribution of intervals. The two graphics depict identical data. The first graphic displays both vertical and horizontal axes on a linear scale, while the second utilizes a logarithmic scale for the vertical axis. This logarithmic scale highlights intervals that occur only once, significantly beyond the octave, as well as those appearing below a value of 1.

Top 5 Intervals

Interval  Name              Occurrences
2/1       octave            4481
3/2       perfect fifth     2001
4/3       perfect fourth    1743
5/4       major third       1290
9/8       major whole tone  1095



Assuming all tunings are periodic, cyclical pitch sets, the octave is identified as the interval of equivalence in 4,379 tuning files. The next most common equave is the twelfth, with only 93 files.

When calculating all added tones, the complete interval matrix only for the octave-ending tunings yields a total of 2,641,310 intervals, and the list of the most frequent remains largely unchanged.


The two graphics present distinct datasets. The first graphic represents the scan of the initial key in each file, while the second illustrates the scan subsequent to computing all matrices. Both graphics showcase the top 17 intervals, which exhibit remarkable similarity. Each graph encompasses a single octave, with both vertical and horizontal axes set to a logarithmic scale.


(Why is it important to calculate the interval matrix and added tones to determine the most common intervals?

Take this periodic tuning, for example: 16/15 6/5 8/5 9/5 2/1.

If you're not very familiar with intervals, simply seeing the initial key doesn't tell you anything. However, upon computing the matrix for this 5-note periodic tuning, it reveals 14 unique intervals. Among these, the most common intervals are the fifth (3/2), the fourth (4/3), the major whole tone (9/8), and the Pythagorean minor seventh (16/9) – all of which aren't explicitly mentioned in the "first" key.)

There are precision issues affecting interval categorization, resulting from the conversion of fractions and cents, the dual languages of scala files, to a common decimal representation. This inherits machine number problems. When calculating the complete matrix of equal division systems, where a size of any given number should imply the same diversity, the precision nuances in floating-point arithmetic may lead to some being counted as different.

Another problem arises in categorizing cent tunings. Some files may refer to the same note, but due to differences in the amount of digits in their definitions, no program will consider them equal. (701.955 != 701.95)

You can attempt to correct this by equally limiting the number of digits, which would effectively reduce the number of individual distinct intervals. However, since truncation occurs in their decimal format, an uneven definition loss of musical notes is observed due to their original distribution, which is nonlinear (without repetitions).

The graph represents the tuning space horizontally and accumulates identical exact repetitions vertically.


Both graphics portray identical data, but the second one illustrates the data after truncation (with a maximum error of approximately 0.2 cents). Both visuals display the top 17 intervals, which remained consistent even after truncation. This reduction resulted in 242,538 unique intervals being compressed to just 9,997. The logarithmic view in the graphic also highlights the uneven definition loss of musical notes post-truncation, which was executed on the decimal data.


Progressively truncating the notes in this way, doesn't significantly alter popularity, even a 2-cent error proved insufficient to dislodge any peak prominence.

Additionally, the graph experiences intrinsic truncation due to its fixed resolution, significantly lower than the data range. Consequently, different notes are depicted on the same pixel, this is used to add a third dimension to the graph, highlighting note concentrations, which are always very close to some of the already favored intervals. For example, the perfect fifth has a concentration of notes next to it, hinting at systems like 12-tone equal temperament, where the fifth is 700 cents. However, without altering the graphical scale, these clusters won't even be apparent.


Both graphics represent the analysis of the initial keys, displaying the same dataset. However, the first graphic features a vertical logarithmic scale, while the second employs a linear scale. Presented as a heat map, red areas denote note concentrations (which are not visible in the linear view), while blue indicates fewer notes.

The generated systems employing the 17 most frequent intervals, are symmetric in both cases, reflecting a mirror image via the square root of 2. They comprise half superparticular intervals and half their reduced inversions, the perfect fourth and fifth, major third and minor sixth, minor third and major sixth, etc.

Nonetheless, some of these intervals are very small in practice, which poses minimal concerns for keyboard or synthesizer configurations but imposes constraints upon the guitar's limited space, among other factors that make it less suitable for very precise tunings; and 17 was just the average system size.

The final generated system consists of 13 notes, or 14 when including the square root of 2. This selection exhibits near-complete coverage of the tuning space. Graphically, their common-tone aggregate resembles the added tones for the entire collection, which is interesting. The intervals that were left out from the average 17 due to their proximity haven't disappeared entirely; they remain popular, even surpassing those included, although the major whole-tone was removed from the main key, it still exists in some of the others.


The first image corresponds to the analysis of the full archive's interval matrix, showcasing the 17 most popular intervals. The second image depicts the same graphic process, computing the interval matrix and accumulating the repetitions vertically, but on the newly generated tuning system. The general contour of both is similar, this type of tuning analysis typically provides the fingerprint for a tuning. This means the 14-note system generates a similar fingerprint to the entire database of 2.5 million notes.

The system does not match any of the existing files.

Analysis using subsets of the archive—half or a third selected randomly—still yielded the same most frequent intervals. However, for a more accurate representation of an average world tuning system, it's essential to curate the data better. This would involve handpicking the most well-known tunings that are or were actually in use, rather than relying on the full Scala archive, which contains numerous modern tunings seldom used.


Composition with the average system

Improvisation with the average system



TODO: Additional statistics:

The first ~500 most frequent intervals comprise just, rational, and integer ratio intervals before cent-defined intervals like the octave at 1200 cents appear.

How to:

The program developed for this analysis is open-source and available at [LINK]. It's designed for straightforward usage—simply load any .scl file or files, and it will promptly conduct and showcase statistics on them. The analysis comes in two modes: 'direct' examines files as they are, focusing on the first key, while 'full' generates interval matrices for all files. Notably, the 'full' analysis uses a fixed equave of 2:1, a setting implemented after discovering that 95% of the database concludes with a 2:1 equave. This equave parameter can be adjusted within the code for further exploration and customization.

Wednesday, July 31, 2024

3D Fractal Xenharmonic Synth, Web App

 Virtual Virtual Instrument?

An experimental program for creating microtonal music.

Sound is generated from a 3D object, a fractal. Clicking on the object's surface produces a set of pitches based on the click point's coordinates (X, Y, Z, and distance to the surface). Each click remaps the keyboard with these new pitches.

The demo video showcases live performance with only drums added afterward.

Play using left and middle clicks, assigning sounds to four keys on two keysets (A, S, D, F and H, J, K, L).

The blinking lights indicate key presses (A, S, D...). The "chord compass" next to it simplifies chord prediction by referencing a 12-tone equal temperament framework.

Built with JavaScript and the browser's Audio API.

Note on microtonality: This program doesn't focus on specific fractal tunings. Musical patterns emerge from the object's geometry, but all fractals potentially contain the same intervals.

Core concept: Generating pitches from arbitrary object coordinates. The code includes primitive 3D shapes for experimentation.

How to play:

  • Left and middle clicks trigger notes based on X, Y, Z, and D coordinates.
  • Use keysets 1 (A, S, D, F) and 2 (H, J, K, L) to assign sounds.

Pitch generation: Pitch is derived from the click point's coordinates. In linear mode, X=1 corresponds to a pitch of 1 Hz.



SFINX - Xenharmonic Guitar Learning App

 

SFINX - Xenharmonic Guitar Learning App

Stringed Fretted Instruments Notes Explorer


This free web-based app is designed to help you explore and experiment with xenharmonic (micro/macro-tonal) guitars.

Key Features:

  • Generate scales and chord diagrams for custom tunings
  • Play and find chord progressions on an interactive virtual guitar
  • Utilize a built-in tuner and fretboard calculator

Basic Concepts:

  • Xenharmonic Tuning: SFINX specializes in exploring tunings beyond the standard 12-tone equal temperament. Users can create custom tunings using decimal ratios or equal division.
  • Virtual Guitar: The app provides an interactive virtual guitar interface to visualize and experiment with different tunings, scales, and chords.
  • Preset Management: Users can save and load instrument and scale presets for quick access and experimentation.

Help:

Default presets include normal 12ed2 guitar and bass.
SFINX saves presets per browser, allowing you to import and export settings. Overwriting existing presets is possible, but remember to save the instrument preset after creating or modifying scales.

Tuning System

  • Strings and Frets: Define the physical parameters of your virtual instrument.
  • Decimal Ratio List: The program accepts intervals in decimal ratio, comma-separated. The last ratio represents the octave equivalent.
  • Equal Division: Divide the octave into a specified number of equal intervals.
  • Tuning Pattern: Determine the open string note of each string relative to the previous one. This allows for various tuning configurations, including drop tunings.
    Each string you add, also adds a control on its left that sets the open string note in relation with its previous string (that is why the lowest string doesn't have one).
    The standard guitar tuning pattern is 5, 5, 5, 4, 5.
    A one step drop tuning pattern is: 7, 5, 5, 4, 5.
  • Lowest Pitch: Set the fundamental frequency of the lowest open string.
    In hertz. Sets the lowest possible pitch, that is the lowest open string, the only control for setting pitch directly.
  • Interval Rulers: Measure intervals and string lengths for in-depth analysis.
    - The pink ruler marks always the equave.(the last number in the interval list, or the interval used for the division in equal-division systems)
    - The fixed green 12ed2 ruler is useful to measure other tunings, since most musicians are familiar with the role of those tempered 12, is easy to relate new tunings using the ruler for quick comparison. (it can be moved)
    For deeper interval analysis and measurement beyond the basic tools provided, explore my other app, 'Interval Rulers.' It visualizes intervals as an 'abstract guitar' or interval matrix, enabling complex calculations like successive reductions and chroma finding. Unlike SFINX, which focuses on a fixed interval matrix inherent to the guitar, 'Interval Rulers' offers a more flexible and comprehensive approach to interval exploration.

Visualization and Interaction

  • Highlights: Select specific notes on the fretboard to focus on particular scales or chords.
    Each interval on the list gets a control, or with the equal-division system, each division gets a control.(Note: with non-integer divisions, this gets truncated, floored. So with 11.66 divisions, it will count 11, this is non-sense, yes).
    Here is where you set the scale to be displayed on the fretboard.
    Each marked note, adds a control for arpeggiate a chord.
  • Chord Pattern: Define the notes for each chord position.
    Each string added, adds a control for selecting a note for the chord-row.
  • Colors: Customize the appearance of notes based on:
    Single: Plain color.
    Class: Notes get a unique color by its class.
    Row: Colorize by chord row, controlled by the chord pattern.
  • Arpeggiator: Play notes sequentially in different patterns (up, down, converge, diverge).
  • Speed: Arpeggio note separation speed in seconds.
  • Synth Sound: Choose from available sounds for the virtual guitar.

Additional Controls

  • Width, Length, Zoom: Adjust the visual representation of the fretboard without affecting the tuning or sound.
  • Note Length: Control the duration of played notes.
  • Volume: Adjust the overall volume of the virtual guitar.
  • Calculator ruler: Displays a ruler (orange) with the relative size of the string when hovering a fret.
  • Size: Sets the nut to bridge length for calculations. In units.

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...