AI music composer
Turns a text description and mood into melody, harmony and rhythm, then synthesises it to WAV.
What it does
Chained Groq Llama 3.1 prompts generate space-separated melody notes, harmony chords, rhythm durations and a style summary. music21 converts note names to frequencies and a sine-wave synthesizer renders them into a WAV file played in Streamlit. GitLab CI builds the image in Docker-in-Docker, pushes it to Google Artifact Registry and applies the Kubernetes manifest on GKE.
What was built
- 01
Separate prompts produce melody notes, chord progressions and beat durations, then adapt them to the chosen style.
- 02
music21 parses note names such as C4 into pitch frequencies; unparseable notes are skipped.
- 03
Sine-wave synthesizer renders 0.5-second tones at 44.1 kHz into an in-memory WAV for playback.
- 04
GitLab pipeline has checkout, build and deploy stages, authenticating to GCP with a service-account key variable.
The pipeline, layer by layer
Five layers, one pipeline.
L1UI
- Streamlit prompt and style
L2Composition
- Chained Groq prompts
- Melody, harmony, rhythm
L3Audio
- music21 note parsing
- Sine synthesizer to WAV
L4CI/CD
- GitLab CI
- Artifact Registry
L5Runtime
- GKE deployment