Download README.md from tensorfiend/code2music: direct link, hf CLI and curl.
- Browser
- Download file 7.25 kB
-
https://huggingface.co/datasets/tensorfiend/code2music/resolve/main/README.md
- Command line
-
hf download hf://datasets/tensorfiend/code2music/README.md
-
curl -L -o README.md https://huggingface.co/datasets/tensorfiend/code2music/resolve/main/README.md
pretty_name: code2music
language:
- en
license: other
license_name: agpl-3.0-or-later-with-third-party-licenses
license_link: LICENSE
task_categories:
- text-generation
size_categories:
- 1K<n<10K
tags:
- music
- strudel
- javascript
- synthetic
- supervised-fine-tuning
- reinforcement-learning
- grpo
configs:
- config_name: sft
default: true
data_files:
- split: train
path: sft/train.jsonl
- split: val
path: sft/val.jsonl
- split: benchmark
path: sft/benchmark.jsonl
- config_name: rl
data_files:
- split: train
path: rl/train.jsonl
- split: val
path: rl/val.jsonl
- split: benchmark
path: rl/benchmark.jsonl
code2music
code2music pairs music descriptions with executable Strudel programs and provides separate prompts for reinforcement learning. It was built for TuneLM, a language model that writes musical code. Strudel runs the generated JavaScript to produce audio, which lets users inspect, edit, and play individual musical parts.
Try TuneLM · Source code · TuneLM checkpoint
Dataset structure
| Configuration | train |
val |
benchmark |
|---|---|---|---|
sft |
2,526 | 250 | 150 |
rl |
1,764 | 148 | 134 |
The SFT training and validation splits contain a listener request, teacher-written composition notes, and verified Strudel code. The SFT benchmark contains prompts for generation and evaluation. Every RL split contains prompts and machine-checkable request contracts. The benchmark and RL records have no reference completion.
from datasets import load_dataset
sft = load_dataset("tensorfiend/code2music", "sft")
rl = load_dataset("tensorfiend/code2music", "rl")
example = sft["train"][0]
print(example["prompt"])
print(example["summary"])
print(example["code"])
request = rl["benchmark"][0]
print(request["prompt"])
print(request["contract"])
Each configuration has exactly three JSONL files, directly under sft/ or rl/. The val and benchmark split names are preserved in the Hub configuration.
How the data was created
The initial SFT set contains 2,016 training examples and 200 validation examples. Independently authored listener requests were answered by Gemini teachers. The saved training answers include Gemini 4 Argon, Gemini 4 Carbon, and Gemini 3.8 Flash. The initial benchmark contains 100 separate prompts.
An additional SFT set uses human-written captions from the Song Describer Dataset. The imported source has 1,106 captions for 706 recordings. Gemini 4 Argon, Carbon, and Hydrogen generated new Strudel answers. This release includes 510 accepted training examples and 50 validation examples from that stream. Its 50 benchmark prompts also come from Song Describer and have no reference completion. The release merges these records with the initial SFT set while keeping their original IDs and split assignments. See the Song Describer release and paper.
Teachers received optional reference material from a library of verified Strudel stems, along with API and sound references. The memory used 384-dimensional MiniLM embeddings and indexed training stems only. The student prompt used by TuneLM contains the listener's request and any explicitly supplied starting code. The saved context field is teacher reference material. See the TuneLM pipeline.
The verifier parses and executes each candidate program, checks sound IDs, and records musical events. Failed candidates can be retried with diagnostic feedback. Passing these checks establishes execution compatibility within TuneLM's supported Strudel runtime. Musical quality still requires listening.
RL requests were authored separately from SFT requests. Their contracts record checkable preferences such as named instruments, forbidden sounds, tempo, key, part count, density, and arrangement changes. Quotes in each contract link its requirements to the listener's words. See the GRPO reward design.
Record fields
| Field | Contents |
|---|---|
id, prompt_id, split |
Stable record identity, originating request identity, and split |
prompt |
Listener's music description |
summary, code |
Composition notes and executable program, present in SFT train and validation |
plan |
Composition metadata, evaluation cycles, and supplied code for co-creation |
contract |
Checkable listener requirements in RL records |
teacher, teacher_id |
Recorded answer provider and model profile in supervised records |
context, retrieved_ids, source_families |
Teacher reference packet and its source lineage |
verification, verifier_version |
Execution telemetry and runtime version for supervised answers |
A model completion follows this format.
<think>
Composition notes describing tempo, instruments, rhythm, and arrangement.
</think>
```strudel
setcpm(120/4);
stack(s("bd*4").gain(0.4), note("c2 g2").s("sawtooth").gain(0.3))
```
License and attribution
TuneLM's original contributions to this release use AGPL-3.0-or-later, consistent with the project's code license. Song Describer captions retain CC BY-SA 4.0. Embedded reference material retains the license identified by its source, including MIT, GPL-3.0-only, AGPL-3.0-only, and AGPL-3.0-or-later. The repository declares a mixed license because these terms apply to different components.
Strudel's software uses AGPL-3.0. Its contributed examples and tracks have separate licensing terms. This release preserves the notices and provenance for the selected references. See LICENSE, THIRD_PARTY_NOTICES.md, attribution/, and Strudel's licensing guidance.
Limitations
The dataset focuses on instrumental music expressed through a supported subset of Strudel JavaScript. Teachers can produce generic arrangements, imperfect instrument choices, or inaccurate composition notes. Symbolic tempo, key, and event checks capture only part of a listener's intent. Generated code should be validated before execution. The release contains music descriptions and code, with runtime sound assets supplied separately by the playback environment.
Exact record IDs, request IDs, and normalized prompt text were checked for duplicates across the six release files. This check does not establish that different wordings describe different musical ideas. The released Song Describer subset has four shared artists between training and validation, and five between training and benchmark. Its saved source provenance describes an earlier artist grouping that differs from the exported split assignments. Record-level prompt disjointness does not establish artist-level separation. The reference library is rhythm-heavy, which can influence teacher outputs.