Wednesday, July 31, 2024

Interval Space Randomness

This article investigates the nature of "randomness" in music, specifically concerning pitch and tuning systems. I argue that true randomness is rarely achieved, even when using seemingly arbitrary number sources. Through examples and compositional analysis, I will demonstrate how traditional musical concepts continue to influence even the most unconventional pitch choices. The exploration includes the construction of diverse "random" scales, their integration within established music theory, and the impact of measurement challenges on our perception of randomness.

Defining Randomness?

Common responses to inquiries about randomness or aleatority include:

-"Unpredictability of future events."
-"Absence of discernible patterns or order."
-"Reliance on chance and luck."
-"Equal probability of all outcomes."
-"Chaos, lacking apparent causality."
-"Statistical independence of events."
-"Manifestation in natural phenomena (e.g., weather, genetic mutations, dice rolls)."
-"Fundamental aspect of quantum mechanics (e.g., particle behavior)."

These diverse responses reflect varying perspectives and levels of understanding.  Individuals draw upon their experiences, education, and the specific context in which they encounter randomness.  For example, a statistician might emphasize probability, while a physicist might invoke quantum mechanics.

In essence, randomness is a multifaceted concept intersecting diverse fields of knowledge and human experience.  It challenges our notions of predictability and order, serving as both a source of complexity and a catalyst for creativity.

Defining Musical Tuning Systems

Just as the concept of music defies singular definition, so too do tuning systems.  A traditional definition might be: a predefined set of pitches available for musical creation and performance.

Tuning systems are often defined by their generation process: a set of rules or algorithms that produce a finite set of pitches.  For example, the Pythagorean scale, which yields 12 notes, involves one algorithm for note generation and another for application, the latter often constrained by the instrument's range.  This application typically involves a period of repetition, most commonly the octave, also known as the interval of equivalence or "equave."  The equave represents the most "informative" interval within the set.  For instance, 12-tone equal temperament (12-EDO) offers multiple intervals of repetition, but the octave division is the most intuitive.

Some systems, like the harmonic series, may lack a defined period, as each successive "period" introduces additional notes (e.g., 1, 2, 3, 4, 5, 6, 7...).

Numerous generation processes exist, accompanied by a variety of justifications for their "validity."  The standard 12-tone equal temperament, for example, has multiple origins and rationales.  The Pythagorean concept of rational number metaphysics persists as a common explanation, despite the inherent "comma" (the misalignment of exponential sequences of 2 and 3).  Modern theories often attribute the perceived "goodness" of the 12-tone scale to its approximation of rational intervals involving small prime numbers (3 and 5), though this is a fragile concept.  A more robust explanation involves modern consonance models, which consider the complex timbre of sounds like the human voice or plucked strings.  These sounds, rich in harmonics (integer multiples of the fundamental frequency), are analyzed through perceptual consonance models based on the beat effect, resulting in a dissonance curve.  Applied to harmonic timbres, the minima of this curve align with the pitches of the 12-tone system. 

This level of abstraction is crucial for isolating the principle and context of "randomness."  By focusing on the "object" as a source of numbers or proportions, we can analyze it more effectively.  While numbers may be sourced from various mediums and interpreted as random (even if they are not), the impact of precision and error becomes a key consideration.  Furthermore, the extent to which a set of values can be "randomized" by a single defined rule warrants investigation.

Representing a set of numbers as proportions offers the advantage of base-independence.  For example, when constructing a set based on the sizes of solar system objects, the specific unit of measurement (meters, inches, etc.) is irrelevant.  The proportional relationship between objects, such as the moon's approximate quarter-size relative to Earth, remains constant. By normalizing to one value within the set, and because we will be creating periodic systems, any value as base renders the same set. (We will also create other types, non-periodic).

Examples of "Random" Scale Generation

The following examples illustrate the creation of musical scales using "random" numbers derived from various sources. These examples demonstrate how even seemingly arbitrary number sources can generate musically coherent results, further supporting the argument that true randomness is elusive in this context.

Planetary Data and the "Music of the Spheres"

The concept of the "music of the spheres," associating celestial bodies with musical harmony, has resonated across cultures, from ancient Greece to pre-Columbian America. While some specific examples of simple harmonic ratios exist in celestial mechanics (e.g., orbital resonances), many planetary properties do not readily translate into easily recognizable musical intervals. This section explores the creation of musical systems based on planetary data, examining whether these seemingly arbitrary values can generate musically meaningful results.

Scales were constructed using data from NASA (2018), specifically:

- Average surface temperature
- Orbital period
- Planet size (including the Sun)

Pitch generation employed octave equivalence. For example, in the planet size (diameter) scale, values were normalized relative to Earth (Earth = 1). The Sun's diameter, for instance, is approximately 109 times Earth's. These normalized values were then octave-folded into the range of 1 to 2 (representing Earth to "2 Earths") and then duplicated to cover the audible or instrumental range. This process was repeated for the other planetary properties.

The resulting music reveals that these seemingly arbitrary values can generate surprisingly stable chords and progressions, sometimes even exhibiting a clear tonal center. Most remarkably, the scale derived from planetary sizes contains a fully functional pentatonic blues scale, inspiring the track title "The Astrocaster Blues." This suggests a deeper, perhaps unexpected, connection between planetary proportions and familiar musical structures.

---

Video.01 Description: "Astrocaster Blues"

 

This video showcases the planetary diameter data used to calculate the pitches for "Astrocaster Blues." It displays the numerical values and visualizes the scale construction process.

A prominent feature of the video is a pitch dial, displaying a single octave for each instrument (piano, guitar, and bass). This allows viewers to clearly see the interactions of chords and the intervallic relationships within the scale as the music is played.

The most striking aspect of this scale is the presence of a fully functional pentatonic blues scale. This led to the lighthearted observation that the search for extraterrestrial life might be best focused on solar systems with a high potential for blues musicians. The irony is that, within this planetary-diameter-derived blues scale, Earth itself is assigned the "bluesy" microtonal inflections. While the pitches are normalized relative to Earth's diameter, the tonal center of the music gravitates towards Saturn.

-----

Video.02 Description: "The Dance of Entropy"

"The Dance of Entropy," based on planetary temperatures, is a waltz-like composition with a distinctly 18th-century European neoclassical orchestral vibe. The addition of a bandoneon, however, infuses the piece with a touch of tango, creating a unique blend of styles.

This video provides a visual representation of the scale constructed using planetary temperatures and the resulting musical composition, "The Dance of Entropy." It clearly displays the planetary temperature values used in the scale's construction, along with a step-by-step visualization of the process itself.

A key feature of the video is a "planet grid-keyboard" that illuminates the notes as they are played. This allows the viewer to directly observe the consonant relationships within the scale and identify the tonal center of the music.

It's important to note that the order of the planets on the grid-keyboard does not correspond to their spectral order within the solar system. The octave folding process used to create the scale results in a different arrangement of pitches. As with other planet-based scales in this work, Earth is used as the base for normalization. However, because these systems are periodic, the choice of base is inconsequential; the resulting musical relationships remain consistent regardless of which planet is used as the reference point. The scales are not geocentric in any meaningful sense.

-----

"Soles Mortem," using orbital periods, produced the least consonant of the three scales. While it still contains numerous usable chords (as demonstrated in the audio example), identifying a stable tonal center within traditional musical frameworks proved challenging.

-----

Order or Chance?

The question arises: is it even possible to encounter a scale derived from planetary data that is truly unusable? The consistent emergence of musical coherence from these seemingly "random" sources suggests that, even within the vastness of space and the complexity of celestial mechanics, underlying order and harmonic potential may be far more prevalent than one might initially assume.

Clearly, these planetary data do not conform to the strict definition of randomness—"all outcomes have equal chance"—as the number and sizes of planets within a solar system are inherently constrained. The question remains: is it randomness, or simply a form of order we have yet to fully comprehend?

Furthermore, the near-uniform distribution of these values within the octave raises another crucial point. Why is it so difficult to find a set of "random" numbers that, after octave folding, reveals only near-octave values or a cluster of notes that lack any tonal meaning? Is this simply a matter of chance?

It's unlikely. The consistent emergence of usable musical scales from diverse "random" sources, including planetary data, suggests that there's more at play than mere coincidence. The constraints of human hearing, the inherent properties of number relationships within a bounded space (like the octave), and perhaps even deeper, undiscovered principles of harmonic organization seem to guide the formation of musical structures, even when starting from seemingly arbitrary data. The "randomness" we perceive may be, in fact, a manifestation of underlying order that we are only beginning to understand. The universe, it seems, may be inherently musical.

-----

The Riemann Zeta Function

The Riemann Zeta function, a complex-valued function with deep connections to number theory, was used to generate a set of pitches for musical composition. The imaginary parts of the Zeta function's zeros, while not truly random, exhibit statistical properties that make them a suitable source of seemingly random numbers. Unlike previous examples that focused on selecting a small set of values and applying a fixed interval of equivalence (like the octave), this approach directly utilized 28 consecutive imaginary parts of the Zeta function's zeros. These values were interpreted as cents and directly applied to control synthesizer pitches.

Octaves, in traditional periodic tuning systems, provide confinement for the total pitch availability. Knowing that any interval present in one period is found in the next (up or down, depending on the instrument's range) allows for predictability, manageability, and perceptual substitution of pitches. The scale constructed with Riemann Zeta function values doesn't inherently contain octaves. Any octaves, or approximations thereof, that appear, do so by chance, as do other consonant intervals. This absence of a pre-defined octave is a key element of the experiment, challenging conventional notions of consonance and scale construction.

The deliberate omission of a defined equave or period of repetition makes the results particularly intriguing. As demonstrated in the audio example below, the resulting music, while using an unconventional scale, sounds surprisingly "normal." It rarely registers as overtly microtonal. Instead, it possesses a rock-folk-like quality, suggesting the use of unusual but not entirely foreign scales. It certainly does not sound atonal or xenharmonic. Clear, recognizable chord progressions emerge readily, and consonance is not compromised across a wide range of timbr


(Zeta function 28 notes music)

The timbres, all synthesized, contribute to a rich sonic spectrum. The distinct harmonic characteristics of the synthesized guitar and strings create clear timbral differentiation. Some instruments handle otherwise dissonant intervals more gracefully than others. The guitar, with its inherently harmonic timbre, serves as a kind of consonance "stress test." If an interval sounds good on the guitar, it generally passes a basic consonance check, even if that consonance is subjective. Essentially, if it sounds good on the guitar, it's likely to be perceived as consonant.

The resulting musical texture underscores the central point: these values, derived from a complex mathematical function, do not sound as "random" as one might initially expect. The emergence of familiar musical elements, even without a pre-defined tonal framework, suggests an underlying order and reinforces the idea that true randomness is elusive in musical contexts.

Interval Matrix for the Riemann 28 note Scale

-----

The Question of Randomness

The observation that simple octave folding of seemingly random values consistently leads to relatively uniform interval distributions, often guaranteeing a degree of tonality, raises fundamental questions about the nature of randomness itself. It forces us to reconsider not only the "randomness" of our chosen values but also the "randomness" of our conventionally accepted methods for scale construction.

A previous study [link] analyzing the Scala Archive (a vast library of over 5000 world tunings) revealed a striking phenomenon. Generating random pitch sequences using even simple pseudo-random number generators (like those built into web browsers) often resulted in scales that closely approximated (within ±10 cents) or even perfectly matched existing scales in the archive. These archived scales, of course, have established origins, structures, and "mathematical justifications."

This finding is significant. It suggests that what we perceive as "random" in the context of pitch spacing may be less random than we think. The inherent properties of number relationships, coupled with the constraints of human hearing, appear to guide the formation of musical scales, even when starting from seemingly arbitrary data. This raises a profound question: what, then, is true randomness, at least within the realm of musical pitch and human perception?

The Challenges of Measurement and Their Impact on "Randomness"

As previously discussed, some "random" number sources, such as the output of random functions, were used directly without imposing a specific period or equave.  For instance, one scale was derived directly from the zeros of the zeta function, with values interpreted as cents.

Other sources, like planetary properties (e.g., sizes interpreted as Hertz values), required a different approach.  Scales were constructed from a fixed set of values (e.g., ten planetary sizes).  However, to expand these sets to a wider pitch range, a rule for extending the values was necessary.  While the planetary sizes themselves might be considered a source of "randomness," the choice of how to extend their range (e.g., by octave transposition) could introduce additional bias.  Simply using octaves based on Earth's values, while seemingly logical, doesn't constitute a purely "random" approach.  Compositions were created based on various planetary properties, like size, temperature, and rotation, including their octave transpositions.

A more complex challenge arose with data from sources like mountain heights.  Using the "fourteeners" (the tallest Himalayan mountains), the very definition of height became problematic.  The influence of sea level, for example, significantly affects perceived height.  The same mountain, measured from different baselines, will have different proportional heights relative to other mountains, even though the absolute difference in height remains constant.  This necessitated the introduction of both an equave and a sea-level reference point.  Music based on these mountain heights has also been composed.

(Himalayan 14 periodic notes music)



Images Description:

This image visually represents the process of constructing the Himalayan tuning scale. The fourteen highest peaks in the Himalayas (the "fourteeners"), a list derived from mountaineering tradition and historical convention rather than strict geological definition, are depicted as individual rectangles, arranged horizontally to illustrate their relative heights above the 8000-meter mark (indicated by the red baseline). It's important to note that these peaks are geographically dispersed across the Himalayan range; their proximity in the image serves only to convey their height relationships. The inherent ambiguity in defining a "peak" (as opposed to a sub-peak or shoulder of a larger mountain mass) is also acknowledged, highlighting the challenges in establishing a definitive list.

Below the height representation, the image demonstrates the octave duplication process used to extend the scale. While the typical method involves octave folding the initial set of mountain heights into a single octave and then duplicating that octave, the image illustrates an alternative, but mathematically equivalent, approach: multiplying and dividing the original heights by powers of 2 to generate octaves, and then selecting the results that fall within the audible range. The duplicated heights are marked on the image, and some may visually align with other mountain silhouettes in the background. These background mountains are purely illustrative; the fourteeners (shown in white) are the primary focus of the scale construction.

The resulting music evokes the epic and adventurous spirit often associated with the Himalayas, reflecting the grandeur and challenge of these mountains.

The choice of sea level appeared to be a more significant factor in altering the proportional relationships within the scale than the choice of octave.  Small changes in sea level resulted in drastically different proportions between mountain heights (whether analyzed in octave space or any other proportional space).  While all combinations of the 14 mountain heights were theoretically possible, certain proportions became more probable than others due to the influence of the chosen sea level.

Illustrative Examples: Normalization and Equivalence

To illustrate the impact of these measurement choices, consider a simplified example.  Let's start with a set S = {2, 800, 1040}.  We can normalize this set by choosing a base value (e.g., 2) and dividing all elements by that base: S(base:2) = {2/2, 800/2, 1040/2} = {1, 400, 520}.

Next, we can create a new, reduced set by applying an equivalence relation, such as the 1:2 octave relationship.  We find representatives of 400 and 520 within the octave range (1 to 2).

400 / 2^8 = 400 / 256 = 25/16

520 / 2^9 = 520 / 512 = 65/64

The minimal generating set in octave space becomes {1, 65/64, 25/16, 2}.  This set preserves the original proportions of S within the octave.

With unambiguous measurements (like planetary sizes), this process works well.  However, with context-dependent measurements (like mountain heights), changing the sea level alters the proportions, rendering the normalized set no longer representative of the original relationships.  For example, adding a constant delta of 150 to each element of S results in a completely different generating set.


The Challenge of Precise Proportional Calculations

Calculating precise proportions within a given musical space presents a significant challenge, particularly when dealing with numbers spanning vastly different orders of magnitude or when measurement precision is limited.

Let's first illustrate a scenario where this problem is less pronounced.  Consider creating a scale based on the sizes of two planets.  Assume their sizes are A = 200 and B = 1200 (in some arbitrary unit).  The first step is to normalize the values by choosing a base.  Using A as the base, we get {A = 200/200, B = 1200/200} = {A = 1, B = 6}.  Next, we define our musical space, in this case, the octave (a 1:2 ratio).  A remains at 1 (the unison).  B must be scaled to fit within the octave (1 to 2].  We divide B by 2^2 (4) to get 6/4 = 3/2 = 1.5, representing a perfect fifth.  Our generating set is {1, 1.5}.  We can extend this scale by repeatedly multiplying by 2 (within the instrument's range).

In this scenario, small variations in the initial measurements have minimal impact on the final proportions.  For example, if the measurements were slightly off (e.g., {201, 1205} or {199.32142, 1200.0000001}), the resulting proportions within the octave remain practically the same.  The generating set might become {1, 1.50003}, but this tiny difference is negligible in musical terms.  Planet B is still perceived as roughly a fifth above planet A.

The Problem of Scale and Precision

The problem becomes much more acute when dealing with values that span a vast range, such as particle energies, which can range from giga-electronvolts (GeV) to electronvolts (eV).  Measurements at these scales often have varying degrees of precision.  Consider a simplified example (not a real-world physics case) to illustrate the issue.  Suppose we have two particle energies: A = 1000 and B = 0.09155...  Normalizing to A gives us {1, 0.0009155...}.  Scaling B to fit within the octave (1 to 2] requires multiplying by a power of 2.  In this specific example, B * 2^x happens to equal 1.5, a perfect fifth.

So far, so good.  But what if the measurement of B was slightly different due to limitations in precision?  Let's say B = 0.0781 (a seemingly small difference).  Now, when we scale B to fit within the octave, we get a different result: B * 2^n = 1.25, a major fourth.  A tiny change in the initial value of B has resulted in a significant change in the musical interval.

Therefore, unless we have extremely precise values for particle energies (which span an even wider range than our simplified example), we cannot reliably claim consistent proportional relationships within a musical space.  While we can say that "planet B is a fifth of planet A" with reasonable certainty, saying that "an electron is a major fourth of a muon" based on imprecise energy values would be misleading.  The inherent uncertainty in the measurements prevents us from establishing such precise musical relationships.

Nature of Musical Structure

This exploration, while seemingly trivializing historical efforts in scale creation, is not intended to diminish their significance. Rather, it builds upon the observation that the Scala Archive contains over 5000 documented tuning systems, raising the question: does everything sound good? My approach of constructing scales from random sources is primarily for inspiration. The resulting scales often either already exist within the archive or possess inherent musicality that can be further enhanced with appropriate timbral choices.

This leads to a fundamental question: what are the underlying principles that govern musical structure? Octave equivalence, periodicity (though not always present, as seen in the Riemann scale example), and a tendency towards uniformity across the hearing range, with a bias toward octave-based relationships (even when the octave is not pure), appear to be recurring themes.

But what about the diatonic and pentatonic scales? The major chord itself? Are these truly foundational elements of music, or are they primarily learned constructs shaped by cultural context and familiarity? Is there anything objectively special about the function of tonal modes or chord inversions? Or are they simply products of neurological evolution favoring harmonic timbral preferences, coupled with cultural development?

The fact that the diatonic scale appears in diverse and geographically separated cultures suggests that it may not be purely a learned construct. It likely has a deeper connection to timbre perception, as recognized by modern music theory.

The Role of Human Intervention

While the selection of pitches in the scales described above was often based on "random" sources, it's crucial to emphasize that the composition of the music was not. A human mind, with its inherent perceptual biases and musical understanding, ultimately shaped the final musical output. The composer, working within the constraints and possibilities presented by the "random" scale, makes choices about melody, harmony, rhythm, and form. This human element is essential for transforming a set of pitches into a meaningful musical experience.

This distinction is important. I've also explored algorithmic and generative music for years, both by studying the work of other artists and by developing my own algorithms. For example, this app [link] allows users to create music based on cellular automata (like Conway's Game of Life), translating cell states and coordinates into musical parameters.

While these explorations have yielded fascinating results, I've yet to discover a simple or complex algorithm that consistently generates music that sounds convincingly human. Many algorithms can create interesting sonic textures and patterns, but they often lack the expressive nuances, the sense of narrative, and the subtle irregularities that characterize human-created music. The only algorithms that seem to approach this level of "human-likeness" are those based on artificial intelligence and machine learning. These AI systems, however, operate on a fundamentally different principle than simple, rule-based algorithms. They learn patterns from vast datasets of existing music and then generate new music based on these learned patterns, rather than following a pre-defined set of instructions.

Therefore, while randomness can play a role in pitch selection, its impact on musical composition is less direct and less compelling. Human intervention, with all its subjective biases and creative insights, remains a crucial ingredient in the creation of music that resonates with human listeners. The "randomness" of the initial pitch set, in a sense, becomes a canvas upon which human musicality is expressed.

Fitting "Random" Scales within Established Frameworks

Earlier, I mentioned that these "random" scales could be understood within the context of established music theory. While the preceding examples demonstrated this through the creation of musically coherent pieces, the underlying framework deserves further explanation. The sheer existence of the Scala Archive, with its thousands of diverse tuning systems, provides compelling evidence that, in a broad sense, "anything works" musically. However, we can be more specific about how these "random" scales relate to established theoretical frameworks.

Modern music theorists have explored dividing the octave into an increasingly large number of intervals, often with the goal of cataloging and analyzing scales that more closely approximate specific intervals of interest, such as perfect fifths. However, the limits of human pitch perception must be considered. The just noticeable difference (JND) for pitch, averaging around 10 cents in the central hearing range, means that many of these highly refined scales contain distinctions that are imperceptible to the human ear. What, then, is the practical purpose of constructing scales with hundreds or even thousands of divisions per octave if these microtonal nuances are not perceivable? Such explorations are, of course, valuable from a theoretical standpoint, but their direct relevance to musical practice is less clear.

This framework of highly granular octave divisions, however, provides a context for understanding how our "random" scales can be "fitted" into established musical thinking. Any of these randomly generated tuning systems can be considered a subset of a highly divided equal temperament (e.g., 100-EDO or even less). For example, analysis of the Riemann Zeta function scale using an interval matrix reveals that numerous 12-EDO approximations (within ±15 cents) are present at various transpositions. This demonstrates that even seemingly arbitrary number sources can generate scales that, upon closer examination, relate to familiar tonal structures.

This brings us back to the central question: what constitutes "random numbers" in this context? If even "random" data can be mapped onto existing musical frameworks, are we truly dealing with randomness, or simply exploring different facets of a deeper, underlying order?

The Chroma Theory: Connecting Music and Color

This work on "random" scales and the exploration of musical universals led to the development of the Chroma Theory, an in-depth study of the relationship between color and musical notes—another seemingly universal association. The first version of this ongoing study is available here: [link].

The study, which delves into afterimages, color constancy, and stereoscopic color mixing, concludes that color perception and categorization are indeed related to musical chroma and pitch categorization, revealing shared perceptual limits and ambiguities. Just as we might ask, "Is this interval a sub-minor third or a super-major second?", and resolve the ambiguity through musical context, we also ask, "Is this a yellowish-orange or an orangish-yellow?", with the context of visual perception providing the answer.

The construction of musical scales using data from hue-wavelength matchings yielded stable musical structures, as one might expect given the "randomness" argument. However, a key difference emerges: visual chroma is a "stand-alone" property, while musical chroma is inherently a two-note (interval) relationship. I propose that our tonal and harmonic preferences are fundamentally shaped by a shared perceptual mechanism involving color perception and its categorization. The fact that we use the same words (chroma, tone, brightness, color/timbre) across languages to describe both auditory and visual experiences suggests that our intuitive understanding of these phenomena is not far off.

The Chroma Theory study, which develops a color model to predict various perceptual phenomena, provides numerous examples supporting this connection. Newton wasn't wrong: the rainbow is an harp.

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.

Photoshop Scripting +

kMaps - 32bit HDR 360 Sky Creator PS Plug-In

 kMaps - HDR 32bit Procedural 360° Sky Maps Latitude/Longitude Cylindrical Mapping


Important: This plug-in is free and open-source. It was created and tested with Photoshop 2020 (21.2.1) (with CEP 9) in English on Windows 10. Compatibility with other versions is unknown.

Update: I've confirmed compatibility with the latest Photoshop (24.3.0 with CEP 11), but it still requires the English version. Importantly, CEP is being deprecated, which may limit this plug-in's usefulness in the future due to advancements in AI image synthesis.

kMaps offers simple, perlin, and fractal noise-based clouds in a classic style.

As an unsigned plug-in, manual installation and enabling Photoshop's debug mode is required (see video for instructions).

Please note that the plug-in contains some bugs, primarily in the user interface.


Information:

  • Groundless Images: Generated images lack a ground plane, allowing for versatile use. Each image can effectively serve two purposes.
  • Resolution: Generating 16K images depends on GPU and driver capabilities. 8K is consistently reliable, and 4K is generally suitable.
  • 32-bit Depth: The 32-bit output is computationally intensive. The plugin initially creates a 16-bit PSD, simulating different exposures, and then combines them into a 32-bit image.
  • Preset Compatibility: Presets are optimized for default cloud settings. Modifying advanced noise options might require adjustments to other parameters. Experiment with Seed and Noise Evolution values before applying presets.
  • Aspect Ratio: Images are generated in a 1:1 aspect ratio to accommodate engines like Unity, which often resize and pack textures in this format.

Installation (Windows 10):

  1. Extract the /com.k.maps folder from the .rar file and place it in C:/Users/***/AppData/Roaming/Adobe/CEP/extensions/.
  2. Install the included Actions as usual.
  3. Enable Debug Mode in Photoshop (follow the video guide).

Simple Guide:

  • Close all other files.
  • Click "Render .PSD".
  • Select a preset and click "Run".
  • Optionally, click "Convert to HDR".
  • Save the image.

Tips:

  • The preview is a style guide, not a definitive representation.
  • Ignore potential banding when zooming out. Gradients are accurate.
  • To disable a layer or option without affecting presets, set its opacity to 0 instead of hiding it.
  • The sun and moon may appear distorted depending on their position.
  • The animation feature is experimental and prone to crashes. Use with caution.

Color Coding:

  • Red: Do not modify these elements as they are controlled by the plugin.
  • Blue and Green: These elements are editable.

Downloads:

kMaps-v2 Download < 184Kb
kMaps-v2n Download Photoshop 2023 < 184Kb
HDR examples Download < 476Mb
PNG examples Download < 3.5Gb

Tuesday, July 30, 2024

AE 3D Audio Spectrum (no plugins) +free templates

 

3D Wave Spectrum Audio Visualizer

After Effects CC Template Guide









Basic Usage:

  1. Choose a template from the downloaded .rar file and open the Project (some may take longer to load). Locate the replaceMe.mp3 file in the project panel, right-click > Replace Footage, and select your audio file. Trim the composition length to match your audio; it is set to 10 minutes by default.
  2. Render the project or customize the included camera and lights to your preference.

Modifying the Template:

The first layer, from top to bottom, called 3DSpectrumControls, contains all the controls to change and animate the aspect of the wave spectrum. The first option called 3DLayersPadding allows you to change the distance, in pixels, between the spectrum layers to create depth. A value of 0px makes it flat; it should be at least 1px. (Note: Each layer is flat on its own. If you place the camera from an absolute side view, the spectrum will not be visible.)

All other options are from the AE Wave Spectrum regular effect. Refer to the AE Manual for detailed explanations of each control.

  • Start Point/EndPoint: The 2D coordinates (X, Y) in pixels defining the starting and ending points of the audio wave.
  • Start Frequency/End Frequency: The frequency range (in Hertz) to be visualized, from 0 to 22050 for 44100Hz files.
  • Frequency Bands: The number of subdivisions within the specified frequency range.
  • Maximum Height: The spectrum's height relative to the audio amplitude.
  • Audio Duration: The length of the audio sample used for spectrum analysis (in milliseconds). The default is 300ms. Higher values increase render time, lower values reduce animation smoothness. Keep this value between 200-500ms.
  • Audio Offset: The time offset (in milliseconds) between spectrum layers. The default is 20ms. Controls the sampling time difference for each layer.

An Expression script (see below) automatically applies the audio offset to all spectrum layers. You only need to modify the Audio Offset value in the 3DSpectrumControls layer.

audioOffset = thisComp.layer("3DSpectrumControls").effect("AudioOffset")("Slider");
thisComp.layer(thisLayer, 1).effect("Audio Spectrum")(11) + audioOffset


The same happens with the 3DLayersPadding control.

padding = thisComp.layer("3DSpectrumControls").effect("3DLayersPadding")("Slider");
[ thisComp.layer(thisLayer, 1).transform.position[0], [ thisComp.layer(thisLayer, 1).transform.position[1] ], thisComp.layer(thisLayer, 1).transform.position[2]-padding ]

Both Audio Offset and Audio Duration affect the spectrum's refresh rate. The default values for each template typically work well for most audio files.

  • Thickness: The thickness of the line (in pixels) that forms the audio wave.
  • Softness: The softness of the line that forms the audio wave.
  • Inside Color/Outside Color: The color of the line and its outline.
  • Hue Interpolation: Interpolates the selected color based on the hue wheel (in degrees). A value of 360° displays the entire color wheel starting from the chosen color. The default is 35°, which interpolates from blue to cyan/green.
  • Dynamic Hue Phase: Uses audio phase information to randomly change colors.
  • Color Symmetry: Mirrors colors along the line, useful for hiding seams in round spectrum shapes (like template 04).
  • Display (Digital/Lines/Dots): Changes the wave's appearance between these three options.
  • Side (A/B/A&B): Displays the positive, negative, or both sides of the amplitude wave.
To use a custom shape for the spectrum, open the "3dWaveSpectrum_shape.aet" project. In the 3DspectrumLayer_1, you'll find the original AE Wave Spectrum effect, which allows you to use a mask or path to trace the wave. Duplicate this layer (Ctrl+D/Cmd+D) as many times as needed to create the desired spectrum depth.

About the Audio File

The AE Wave Spectrum effect used in this template represents the spectrum linearly in both frequency and amplitude, unlike most spectrum visualizers. This means that when displaying the entire spectrum (0 to 22,000 Hz), you'll see more activity on the left side (low frequencies) with higher peaks, and less activity on the right side (high frequencies), even with maximum height settings.

While selecting a smaller frequency range (e.g., 20 to 2000 Hz) can help, it might not be ideal as it eliminates higher frequencies and may not accurately represent the audio.

You can use After Effects' native audio effects, like the parametric equalizer, to adjust frequency levels. Create a pre-composition for better performance.

For more precise control, using an external audio editor like Audition is recommended. You can apply an equalizer to reduce frequencies below 800 Hz, use a multi-band compressor to target lower frequencies, and then a tube-modeled compressor, hard limiter, and declipper to even out volume levels. While this process might distort the audio, it's intended for spectrum visualization only. Use the original audio for the final sequence. Refer to the Audition documentation for detailed instructions on these effects.

About Performance

This template is computationally intensive, potentially taking up to 100 hours to render on an average PC. Performance decreases with more layers. To improve editing speed:

  • Set preview resolution to "1/4" instead of "Full."
  • Disable the three default lights during editing (re-enable for rendering).
  • Avoid effects like Glow, Blur, background images, and footage during editing. Add these later in a new project.
  • Use the Classic 3D Renderer with the lowest Shadow Resolution.
  • Employ compressed audio formats like MP3 instead of uncompressed formats like WAV.
  • Disable Depth of Field and Motion Blur.
  • Reduce the frame rate from 24fps to 18fps and use frame blending after rendering for smoothness.

Rendering

Render the composition as a PNG sequence to preserve the alpha channel for adding background images or footage later in a new project.

To accelerate render times, consider using the After Effects command-line renderer (aerender.exe) to run multiple instances of the program simultaneously.

Exampe code:

aerender -project X:\examplePath\exampleProject.aep -comp "exampleComp" -RStemplate "Multi-Machine Settings" -OMtemplate "PNG Sequence" -output X:\examplePath\exampleSubPath\exampleOutput_[#####].png

Ensure the selected Render Settings template (-RStemplate) has the "Skip File if Already Exists" option enabled within After Effects. The pre-included "Multi-Machine Settings" template can be used.

Create an Output Module template (-OMtemplate) with your desired PNG settings or other sequence format.

This command-line rendering approach can be used on multiple computers with After Effects installed to accelerate the process.

For more details on multi-machine rendering, consult the After Effects manual.

This Plug-in is free and provided as-is without any support beyond this documentation.

Copyright laws apply. You can create unlimited commercial projects using it, but selling or distributing any of the templates is prohibited.

Tested exclusively in After Effects CC 2017.2 (Version 14.2.1.34).

DOWNLOAD

Project on Behance


The Spiral Harp

6-sided spiral harp, concept art
A spiral tuning system is a layout for string instruments based on any of the diverse configurations of a spiral polygonal chain, known as a spirangle, utilizing the segment's length as source for pitch, either as string length or frequency.

These systems are aperiodic (with exceptions) and possess an infinite range of possibilities. Among these configurations defined by their sides and segments, many prove musically practical, with potential for some to manifest as tangible instruments, such as spiral harps. (An instrument with a single wound string where pitch is linked solely to string length, and tension becomes relative.)

Each unique configuration unveils distinct chords and progressions, often showcasing geometric patterns.



This audio clip features a short melody played on a digitally modeled harp-like instrument tuned according to a six-sided spiral polygonal chain (as depicted in the concept art). The final, highest note corresponds to the shortest 'string' of the spiral.

Theory:

Each tuning can be mainly defined by the amount of sides and the margin, and can be named:

S6m1 - "S" for spiral, followed by the number of sides, "m" for margin; if its value is 1, it can be omitted (e.g., S6m1 = S6). [This tuning is of main interest.]

S5.5 - Five-and-a-half-sided spiral with margin 1 (omitted).

S1m1.05946 - One-sided spiral with a margin of the twelfth root of 2.

S7r2c1 - Seven-sided spiral with a margin of 1 (omitted), with an initial radius of 2, and constant increment c = 1. When omitted, spirals initial radius is 0, c = 1.

iS6m1 - Inverted six-sided spiral with a margin of 1.

The parameters affecting the resulting relative segment length progression are:

Amount of sides: from 0 to infinity.

Margin: usually 1 (to mimic spider-webs). This property can be (unnecessarily) employed to generate equal-division systems. For example, the angle is calculated with \( \frac {2\pi}{sides}\), so when sides are \(1\), \( \frac{1}{2}\), or \( \frac{1}{4}\), etc., it leaves the margin as the sole control for segment length increase. For instance, a one-sided spiral with a radius of approximately \( 1.05946 = \sqrt[12]{2} \) generates a 12 equal division system. From this perspective, equal-division systems can be seen as a subset of spirals.

Initial radius: usually 0 Using a different initial radius opens another dimension of progression; however, it seems to mostly affect the initial segments, and the rest of the spiral converges quickly with its version with radius 0.

Inversion: This parameter doesn't affect the progression but rather how the progression is treated, as string length or as frequency.

Spiral polygonal chains with different margins,

Spiral polygonal chains with different sides.

Construction:

Starting from the center, and considering the segment's length as string length, the first being the shortest, becomes the highest pitch so the tunings are defined inversely.
Since, in most cases, they are aperiodic, the system sizes are infinite, it will depend on how many notes one wants to calculate.
Most spiral settings cover the audible range with less than 300 segments.
For instance, a six-sided spiral harp with margin 1, comprised of 120 segments spans approximately five octaves.
The spiral can be of any size, a diameter, or scale property, while changing the length of the segments, won't alter their relative length.(if started at 0,0)
We assign a frequency to the first segment, e.g. 8000hz, and the rest of the notes are calculated from it.

Unwound spirals next to each other, firsts 10 segments. With margin 1. From 0.5 to 2 sides (150 spirals, in 0.01 step) First segment from each spiral is normalized to the same length. Segments are colored by octave, this means, every red is the same chroma. The 1-sided spiral has all its segments of the same length in this configuration with margin 1.


Algorithms for Segment Length Generation:

1- Euclidean distance between consecutive points on a spiral:

Given:

Radius: \(r= (z \times m)\times (m^n)\) where \(z\) is the constant size increment, \(m\) is margin and \(n\) is the point's index, starting at \(0\).

Angle \(a = \frac{2\pi}{s}\) where \(s\) is the amount of sides of the spiral

The x-coordinate and y-coordinate of a point on the spiral are calculated using:

\(x = r \times \cos(a)\)

\(y = r \times \sin(a)\)

The distance between two consecutive points on a spiral in Cartesian coordinates \((x_1,y_1)\) and \((x_2,y_2)\) is calculated using the Euclidean distance formula:

\(d = \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2} \)

2- Direct Polar Calculation: Instead of converting to Cartesian coordinates, we can calculate the distance directly in polar coordinates. Let \(r_n\) and \(r_{n+1}\) be the radii of two consecutive points, and \(a\) be the constant angle between them. The distance \(d\) can be calculated using the law of cosines:

\(d = \sqrt{r_n^2 + r_{n+1}^2 - 2r_n r_{n+1}\cos(a)}\)

Since \(r_n = (z \times m) \times m^n\) and \(r_{n+1} = (z \times m) \times m^{n+1}\), we can simplify this to:

\(d = (z \times m) \times m^n \sqrt{1 + m^2 - 2m\cos(a)}\)


Properties:

One significant characteristic that differs from most tunings is that each successive lower octave has more notes. At first sight, the different progressions don't seem to say much. It helps to analyze each tuning by looking at its full interval matrix, revealing that some strings have many more types of minor thirds, while others have more fifths. Some completely dodge certain harmonics, regardless of how many "strings" you add; some combinations just never happen.

The crucial factor is the number of sides in the spiral, as this directly determines the chords exposed in each row. Some configurations naturally lend themselves to more intuitive chord progressions. The initial segments of the progression are the most susceptible to alteration due to the inherent truncation of the spiral at its beginning. However, even with these truncated beginnings, distinct patterns still emerge. The remainder of the progression exhibits a high degree of similarity across most configurations. From a string length perspective (moving away from the center, where truncation errors diminish), the progression approximates an arithmetic series, seemingly increasing at a constant rate. However, a closer examination reveals a subtle, gradually increasing ratio.

Considerations for spiral tunings and possible harps:

For a real spiral, a logical number of sides starts at 3 (greater than 2, avoiding string overlap) and ends at some point depending on the expected range (e.g., 12 sides). However, a real harp beyond this will have too many or too short strings to be practical. Regarding the margin, the value is usually 1; going too far away from this eliminates the possibility of the spiral as an instrument, and so does this tuning inversion, the progression as frequency.



An open-source, virtual playable version is accessible link.

The new version is available as a interface in MIND.

-----

The concept art is a 3d model post processed with AI.

The app has one pending update....


draft




Interval Reduction

This page is dedicated to the interval reduction operation, a foundational concept in music theory that I’ve explained briefly in other arti...