audio => harmony

harmonypartition can harmonically analyze audio files by dynamically seeking and organizing tonal continuities.

In a great many musical cases, these continuities take the form of familiar keys and chords.

example: vi-ii-V-I

Here, for example, is a vi-ii-V-I progression in C major, generated from fourier analysis of a .wav file:

C Major vi-ii-V-I in sine waves, derived from synthesized audio

Here is the same progression, analyzed from my own lightly out-of-tune piano, with a different voicing:

C Major vi-ii-V-I on piano, live audio

Although the underpinnings and overtones (shown below and atop the central graphs) are shaken by the realities of live sound, the central analysis holds equally.

generating graphs

We can generate graphs with the following python code from the harmonypartition modules:

audio_kpdve_graph.graph_audio_file("C_6251_live.wav", chroma_threshold=0.3)

A firm, unchanging mathematical system undergirds the analysis, working within the idea of number, group, and ternary rather than with statistical operations. In the course of this method, the harmonic system functions as a hybrid, highly efficient form of neural network, using a miniature backpropagation to find meaningful (and maximally lazy) tonal centers.

It is possible in this manner to analyze any audio file for music-harmonic content, exposing large-scale structures in the musical works. Examples of this type of analysis can be seen in the “Audio and Insights” pages at the Charlottesville Chamber Music Festival.

Beethoven: Sonata No. 1 for Violin and Piano in D Major, Op. 12, No. 1, Mvt. 3 with Jennifer Frautschi, violin, and Max Levinson, piano

Schubert: Fantasie for Violin and Piano, D934, excerpts with James Ehnes, violin, and Inon Barnatan, piano

Beethoven: Sonata No. 10 for Violin and Piano in G Major, Op. 96, mvt. 4, with Timothy Summers, violin, and Benjamin Hochman, piano

The same process can be applied to MIDI and to live-streamed audio. The next post will address the process in MIDI.

Please send along any files for analysis — I would be happy to experiment with them in the course of further development, and discuss results.

The fourier analyses use the librosa package for pitch detection.

Leave a comment