David H Sells

Professional Portfolio

Music Explorer

A journey of exploring violin études through LLMs and generating music

The Musical Journey

I have taken up playing my violin again and there is a study by Mazas that I particularly enjoy. I thought I'd explore it with LLMs. The journey taught me a depth of theory I had not considered. I took that theory and used it to generate a piece of music that you can play.

The Exploration

The exploration started with an inquiry to Groq about the Mazas violin studies, specifically "The Sweeping Strokes." Groq provided detailed information about the étude, explaining that it's Étude No. 1 from Book 1 of Jacques-Féréol Mazas' "Études Spéciales" (Special Studies), Op. 36.

This particular étude focuses on developing a smooth, even tone and bow control, especially in the lower positions. The "sweeping strokes" refer to the long, flowing bow strokes that are characteristic of this piece.

I then asked for a theoretical breakdown of the piece, which led to a detailed analysis of the key structure, harmonic progressions, chord progressions, and theoretical concepts involved.

Key Structure

  • Measures 1-8: C major (tonic)
  • Measures 9-16: G major (dominant)
  • Measures 17-24: Am (relative minor)
  • Measures 25-32: F major (subdominant)
  • Measures 33-40: C major (return)

Harmonic Progressions

  • Measures 1-8: I-V-vi-IV (C-G-Am-F)
  • Measures 9-16: I-IV-V (G-C-G)
  • Measures 17-24: i-iv-v (Am-Dm-Em)
  • Measures 25-32: I-V-vi-IV (F-C-G-Am)
  • Measures 33-40: I-V-vi-IV (C-G-Am-F)

I was amazed with the response. The very descriptive theory seemed like it would be enough to instruct an LLM to actually generate the music itself.

Generating the Music

To generate the music, I used Claude. I provided the theoretical description and an example output format in JSON. Claude generated a JSON representation of the piece that captured the harmonic structure and melodic movement described in the theory.

With the JSON representation, I wrote a Python script that converts the JSON to a MIDI file using the midiutil library. This allowed me to bring the AI-generated composition to life.