AI, Math and Music
Harken Music: A New Mathematical Framework for 12-Tone Harmony
Introduction
Music and mathematics have long shared a profound connection, with each discipline providing insight into the other's structure and beauty. Harken Music introduces a groundbreaking approach to understanding the complexities of 12-tone equal temperament by using straightforward, high-school-level mathematics. This system calculates all 1,193,556,233 possible harmonic combinations and permutations, making it one of the most exhaustive and detailed explorations of musical structure ever presented.
By blending combinatorics, factorials, reflections, and rotations, Harken Music offers musicians and theorists a tool for both theoretical analysis and auditory exploration. The system is made available via an open-source HTML/JavaScript demo, allowing users to engage interactively with the combinations, permutations and transformations.
Overview of the 12-Tone System
The foundation of Harken Music lies in the 12-tone equal temperament system, a musical tuning in which the octave is divided into 12 equally spaced semitones. Each of these 12 notes—represented mathematically as integers from 0 to 11—can function as a tonic (a fixed point of reference) or as part of a harmonic combination.
In this system, every note is identified by a number relative to a fixed tonic, [0]. This provides a natural framework for describing musical intervals and harmonic relationships. For example, the note [0] is the tonic or unison, while [0, 7] represents the perfect fifth, and [0, 10] represents the minor seventh.
Using combinations, permutations, reflections, and rotations, Harken Music demonstrates how even the most complex harmonic structures can be mapped and analyzed within this framework.
Combinatorics: The Basis of Harmonic Structure
The first step in Harken Music's system is to compute all possible combinations of notes from a pool of 12. A "combination" refers to a selection of notes where the order does not matter. In the Harken Music system, the tonic [0] is fixed, meaning that every combination must include it. This results in 11 remaining notes that can be arranged in various groupings.
The number of combinations is calculated using the binomial coefficient "11 choose n," where n is the number of additional notes selected to accompany the tonic. These combinations range from intervals (two notes, including the tonic) to the complete chromatic scale (12 notes). The sum total of all possible combinations for each tonic across the 12 notes yields 24,576 combinations.
Permutations: Adding Order to Combinations
Once the combinations have been identified, the system expands by considering the order of notes within each combination. This process, known as "permutation," accounts for the fact that musical structures like chords or tone rows are sensitive to the arrangement of their constituent notes.
By applying factorial mathematics (n!), the system calculates the total number of permutations for each combination size. For example, a triad (three notes) can be arranged in 3! or six different ways, while a hexatonic scale (six notes) can be arranged in 720 ways. The sum of these permutations yields the grand total of 1,193,556,233 unique harmonic possibilities in 12-tone music.
Transformations: Reflections and Rotations
Beyond combinations and permutations, Harken Music introduces a system for transforming musical structures through reflections and rotations. These transformations allow musicians to explore different symmetries and variations within harmonic structures, offering a deeper level of insight into how different arrangements of notes can interact.
Reflections, or inversions, use a mathematical formula to flip a sequence of notes around a given axis. For example, the inversion of a triad [0, 4, 7] reflects the intervals across an axis to yield a new structure. The formula to compute these reflections is:
n_reflected = (2a - n + 12) % 12
where n is the note being reflected, and a is the axis of reflection. This provides a method for generating all 12 possible inversions for a given combination, adding yet another dimension to the permutations.
Rotations, or transpositions, shift each note in a combination by a fixed interval while preserving the relative spacing between notes. This transformation uses the formula:
(n + t) % 12
where n is the original note and t is the transposition interval. By applying these rotations, Harken Music demonstrates how a single combination can produce a full cycle of variations, all of which retain the same internal harmonic relationships.
Applications and Implications
Harken Music provides an unprecedented level of detail in analyzing 12-tone music, offering musicians, composers, and theorists an invaluable tool for exploring harmonic structures. The ability to see and hear every possible harmonic arrangement in a 12-tone system opens the door to new musical possibilities, including algorithmic composition, performance analysis, and educational tools.
Moreover, the system's emphasis on symmetry and transformation introduces exciting potential for further exploration in musical forms. Composers may use the system to generate new tone rows or to systematically explore harmonic relationships in ways that are both novel and mathematically sound.
In an educational context, the simplicity of the underlying math makes this system an accessible introduction to the relationship between music and mathematics. Students and educators can use the Harken Music demo to visually and audibly explore concepts like combination, permutation, inversion, and transposition in real-time.
Conclusion
Harken Music presents a revolutionary mathematical solution for understanding the vast harmonic landscape of 12-tone equal-tempered music. By leveraging basic mathematical principles like combinations, permutations, reflections, and rotations, the system makes it possible to calculate all 1,193,556,233 possible harmonic combinations and permutations.
As an open-source project, Harken Music is poised to become an invaluable resource for musicians, composers, theorists, and educators alike, offering a new way to interact with and explore the intricate world of 12-tone harmony.
Sidebar: Calculations and Results
Combinations
Using the formula for combinations, 11 choose n for n = 1 to 11, we calculate:
Tonic (1): 1
Intervals (2): 11
Triads (3): 55
Tetrachords (4): 165
Pentatonics (5): 330
Hexatonics (6): 462
Heptatonics (7): 462
Octatonics (8): 330
Nonatonics (9): 165
Decatonics (10): 55
Hendecatonics (11): 11
Chromatic Scale (12): 1
Total combinations = 2,048
For 12 possible tonic notes: 24,576 combinations
Permutations
Permutations are calculated by factoring in the order of notes using factorials (n!):
1! = 1 tonic
2! = 22 intervals
3! = 330 triads
4! = 3,960 tetrachords
5! = 39,600 pentatonics
6! = 332,640 hexatonics
7! = 2,328,480 heptatonics
8! = 13,305,600 octatonics
9! = 59,875,200 nonatonics
10! = 199,584,000 decatonics
11! = 439,084,800 hendecatonics
12! = 479,001,600 tone rows
Grand total permutations = 1,193,556,233
Reflection (Inversions)
Formula for reflections: n_reflected = (2a − n + 12) % 12
Example for reflecting note n = 4 around axis a = 7:
2 * 7 − 4 = 10
10 % 12 = 10
Result: Reflected note = 10
Rotations (Transpositions)
Formula for rotations: (n + t) % 12
Example transposing combination [0, 4, 7, 10] by t = 7:
(0 + 7) % 12 = 7
Result: [7, 11, 2, 5]
This entire review was composed by ChatGPT 4o after a single prompt and is published here without editing.
***
From a single follow-up prompt, ChatGPT 4o produced the following suggestions for how AI could use the mathematics behind Harken Music.
Applications and Implications
There are several exciting ways an AI, like ChatGPT, could leverage the mathematical principles and the Harken Music system for various applications. Here are a few possibilities:
1. Compositional Assistance
AI could use the Harken system to generate new musical compositions by exploring all the harmonic combinations and permutations possible within the 12-tone system. By applying the formulas for combinations, permutations, reflections, and rotations, AI could create compositions that are mathematically structured yet musically rich. This could be especially useful for composers who want to experiment with serialism or atonal music.
2. Music Theory Education
AI could act as a tutor for students learning music theory by providing real-time demonstrations of harmonic relationships and transformations. For instance, students could input a combination of notes, and the AI could walk them through all its permutations, reflections, and transpositions. This interactive approach could help learners understand abstract music theory concepts more concretely.
3. Interactive Musical Exploration
AI could offer a platform where musicians and hobbyists experiment with different combinations and permutations of notes using the Harken system. Users could input a starting combination of notes, and the AI could guide them through various transformations, including reflection and rotation, to explore musical possibilities in real time.
4. Algorithmic Music Composition
By leveraging the Harken Music system, AI could compose algorithmic or generative music. The AI could take a set of initial conditions, like a tonic note or a combination size, and then algorithmically explore permutations, harmonies, and transformations to generate complex musical pieces. This could be used in ambient music creation, film scoring, or even real-time soundtracks for video games.
5. Music Analysis
AI could analyze existing pieces of 12-tone music or other compositions using the Harken system's structure to break down the relationships between notes. It could uncover hidden patterns or structures in the music that may not be immediately apparent to human listeners, providing deeper insights into compositions from a mathematical perspective.
6. Personalized Music Generation
Based on user preferences or moods, an AI system could select specific harmonic combinations or permutations from the Harken Music system and generate personalized compositions. For example, if a user enjoys music with certain intervals, the AI could focus on generating compositions that feature those intervals prominently.
7. Game Design
The Harken system could be integrated into AI-powered games where users solve musical puzzles or create music by navigating through permutations and transformations. Players might have to identify patterns, predict the next permutation, or create a piece that adheres to specific mathematical rules.
8. Music Transcription and Arrangement
AI could assist in transcribing or arranging music by recognizing a series of notes and determining all the possible harmonic combinations and permutations using the Harken system. For example, AI could take a simple melody and generate various harmonic accompaniments or alternative arrangements based on the system's mathematical framework.
9. AI-Generated Variations for Artists
For musicians or bands who want to experiment with variations of their work, AI could use the Harken Music system to suggest alternate permutations of chord progressions or melodies, offering new perspectives on familiar themes. The AI could present these variations as artistic options for further development.
10. Integration with Digital Audio Workstations (DAWs)
AI could be integrated into DAWs to offer composers and producers mathematical insights into their compositions. For example, using the Harken system, AI could suggest harmonic structures or transformations that fit within the existing musical framework of a track, providing novel suggestions for arrangement and development.
11. Cross-Genre Fusion
AI could use the system to analyze different genres of music, identify common harmonic structures, and suggest ways to blend or fuse them using the Harken system’s 12-tone framework. This could open the door to innovative music that merges elements from disparate musical traditions.
By harnessing the systematic and mathematical structure of the Harken Music system, AI could enhance creativity, education, and analysis within the realm of music in numerous innovative ways.
***
This information, the math, the formulas, and the related software code are available free on Harken Music.com and Github as open-source software under the MIT License set forth below.
License
Copyright 2024 Mitchell Kahle and Holly J. Huber
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
***