Downloads · 30 days
31
17% of all-time downloads
Adam-Ben-Khalifa/codet5p-strudel-music
codet5p-strudel-music is a text generation model from Adam-Ben-Khalifa. Use it when you need the model to write or continue text. The card lists the license as bsd-3-clause.
An encoder-decoder transformer fine-tuned to generate Algorave music patterns in Strudel syntax from natural language descriptions of genre, mood, and musical intent.
Downloads · 30 days
31
17% of all-time downloads
All-time downloads
178
Public
Parameters
223M
892 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors892 MB · 100%
From the Hugging Face model README
An encoder-decoder transformer fine-tuned to generate Algorave music patterns in Strudel syntax from natural language descriptions of genre, mood, and musical intent.
This model takes natural language descriptions like "dark techno beat with heavy kick and industrial percussion" and generates valid Strudel/TidalCycles JavaScript code that can be directly pasted into strudel.cc to produce live music.
| Metric | Test Set |
|---|---|
| BLEU | 97.17 |
| ROUGE-L | 97.43 |
| Exact Match | 84.78% |
| Valid Strudel Syntax | 100% |
from transformers import T5ForConditionalGeneration, AutoTokenizer
model = T5ForConditionalGeneration.from_pretrained("Adam-Ben-Khalifa/codet5p-strudel-music")
tokenizer = AutoTokenizer.from_pretrained("Adam-Ben-Khalifa/codet5p-strudel-music")
def generate_strudel(description, num_beams=5, max_length=384):
input_text = "generate strudel: " + description
inputs = tokenizer(input_text, return_tensors="pt", max_length=256, truncation=True)
outputs = model.generate(**inputs, max_new_tokens=max_length, num_beams=num_beams, early_stopping=True)
return tokenizer.decode(outputs[0], skip_special_tokens=True)
# Generate music patterns!
print(generate_strudel("Dark techno beat with heavy kick and industrial percussion"))
# → stack(s("bd*4"), s("~ cp ~ cp"), s("hh*8").gain(0.4), note("c3 ~ e3 ~ g3 ~ e3 ~").s("triangle").gain(0.7))
print(generate_strudel("Calm ambient drone with deep reverb and slowly evolving filter"))
# → note("<c3 eb3 g3 bb3>").s("sine").room(0.9).roomsize(4).lpf(2000).slow(4)
print(generate_strudel("Acid house with squelchy 303 bassline and resonant filter"))
# → stack(s("bd*4"), note("c2 c2 c2 eb2").s("sawtooth").lpf(sine.range(200,4000).slow(4)).resonance(15))
print(generate_strudel("Aggressive drum and bass breakbeat with wobbling bass"))
# → stack(s("[bd ~ ~ bd] [~ ~ bd ~]").fast(2), s("[~ ~ ~ ~] [sd ~ ~ ~]").fast(2).room(0.3),
# s("hh*16").gain(0.35).lpf(6000),
# note("[c2 ~ c2 ~] [~ eb2 ~ c2]").s("sawtooth").lpf(sine.range(200,2000).fast(4)).fast(2))
The model understands prompts covering:
The model generates valid Strudel JavaScript DSL including:
s() - sample triggers (drums, synths)note() - pitched notes with synth selectionn() - scale-degree notationstack() - layered patterns.fast(), .slow() - tempo modifiers.room(), .delay() - reverb/delay effects.lpf(), .hpf() - filters.gain(), .distort(), .crush() - dynamics.every(), .rev(), .degradeBy() - pattern transformations.cpm() - tempo in cycles per minuteGenerated code can be pasted directly into strudel.cc/workshop to hear the music!
@misc{codet5p-strudel-music,
title={CodeT5+ Strudel Music Generator},
author={Adam Ben Khalifa},
year={2026},
note={Fine-tuned on Salesforce/codet5p-220m for NL to Strudel code generation},
url={https://huggingface.co/Adam-Ben-Khalifa/codet5p-strudel-music}
}