ProgrammaticAudio / README.md
gijs's picture
README: load from laion/ProgrammaticAudio
bb3ab31 verified
|
Raw History Blame Contribute Delete
7.73 kB
metadata
license: cc0-1.0
pretty_name: ProgrammaticAudio
language:
  - en
task_categories:
  - audio-classification
  - text-to-audio
tags:
  - audio
  - synthetic
  - sound-synthesis
  - audio-captioning
  - webdataset
size_categories:
  - 100K<n<1M
configs:
  - config_name: default
    data_files:
      - split: train
        path: train/*.tar

ProgrammaticAudio

ProgrammaticAudio is a synthetic audio-text dataset: 103,038 clips (304.4 hours), each with an English caption. All audio is computed with numpy and scipy. No recordings, samples or learned models produce the audio. The dataset covers 123 signal types in 14 categories, from basic waveforms (sine, square, sawtooth), coloured noise and synthesis techniques to filters, effects, drum sounds, test signals and digital silence. It was built as a training source for contrastive language-audio models, so that they see clean, precisely described synthetic sounds with known parameters (frequency, note, filter, effect).

Clips 103,038
Duration 304.4 h, 2–20 s per clip (mean 10.6 s)
Audio FLAC, 48 kHz, 16-bit, mono
Captions one per clip, English: 94,997 generator templates, 8,041 model rewrites (see below)
Shards 26 WebDataset tars, train/0001.tar … train/0026.tar, 4,096 clips per tar (the last one 638)
License CC0 1.0

Format

Each tar holds pairs prog_NNNNNN.flac + prog_NNNNNN.json. The JSON fields are:

Field Meaning
__key__ sample key, prog_ + the index in the generation plan
__url__ the tar the sample is in
text the caption
original_text only on the 8,041 rewritten captions: the template caption from the generator
generation_method the generator function, e.g. gen_karplus_strong / numpy+scipy
category one of the 14 categories below

Example:

{"__key__": "prog_000011", "__url__": "ProgrammaticAudio/train/0001.tar", "text": "A very loud, pure 2.9 kHz sine wave",
 "generation_method": "gen_sine / numpy+scipy", "category": "basic_waveforms"}

Loading:

from datasets import load_dataset

ds = load_dataset("laion/ProgrammaticAudio", split="train", streaming=True)
sample = next(iter(ds))
print(sample["json"]["text"], sample["flac"]["sampling_rate"])

Categories

Category Clips Generators (gen_<name>)
basic_waveforms 13,000 sine, square, sawtooth, triangle, pulse_pwm, supersaw, wavetable, sample_hold, bit_noise, unison_detune, drone
noise 6,000 white_noise, pink_noise, brown_noise, blue_noise, violet_noise, grey_noise, vinyl_crackle, tape_hiss, filtered_noise
synthesis_techniques 11,500 fm, am, ring_mod, additive, subtractive, granular, karplus_strong, physical_model
musical_constructs 9,438 chord, arpeggio, scale, interval, melody, harmonic_series, dtmf
pitch_tuning 5,000 vibrato, pitch_bend, glide, octaver, harmonizer, detune, formant_shift
filters 8,000 lowpass, highpass, bandpass, notch, peaking_eq, shelf_eq, comb_filter, allpass, formant_vowel, filter_sweep, wah, resonance
dynamics 5,000 compressor, limiter, gate, sidechain_pump, transient_shaper, ducker, amplitude_sweep
distortion 6,100 hard_clip, soft_clip, overdrive, fuzz, tape_saturation, waveshaper, bitcrush, sample_rate_reduce, rectify, wow_flutter, vinyl_lofi
time_effects 6,000 delay, slapback, pingpong, multitap, tape_delay, reverb_room, reverb_hall, reverb_plate, reverb_spring, gated_reverb, shimmer_reverb, reverse_reverb
modulation 5,000 chorus, flanger, phaser, tremolo, autopan, rotary, freq_shifter, lfo_filter
percussive 8,000 kick, snare, hihat, click_pop, clap, drum_pattern
special 4,000 silence, near_silence, dc_offset, clipping_max, nyquist, sub_bass, impulse, test_tone, sweep, beating, chirp
editing 5,000 reverse, stutter_glitch, beat_repeat, freeze, spectral_blur, vocoder, time_stretch, varispeed, chop_gate
combinations 11,000 layered, sequence, with_effects, crossfade, sound_design

The combinations generators layer, sequence, crossfade or process the outputs of the other generators.

How it was generated

The full generator is in generator/ (generate.py, one module per category in generators/, shared helpers in utils.py, caption vocabularies in constants.py). It ran once on a 48-core CPU node: python generate.py --workers 92 --seed 42.

  1. Plan. Each generator is registered with a clip count. The plan lists 103,100 samples; sample i gets the key prog_{i:06d} and its own random generator numpy.random.default_rng(42 + i). All parameters (duration uniform in 2–20 s, frequencies, notes, chord types, filter cutoffs, effect settings, ...) are drawn from it.
  2. Signal. The generator function returns the signal at 48 kHz, a list of descriptor words and a core phrase (e.g. ["resonant"], "Karplus-Strong plucked string at G#4"). Pitched sounds name the frequency or note, filters their cutoff, rhythmic sounds their BPM.
  3. Level. The clip is peak-normalised to a random amplitude, uniform in 0.05–1.0. The amplitude sets a volume word: below 0.15 "very quiet", below 0.35 "quiet" or "soft", below 0.65 none, below 0.85 "loud", otherwise "very loud". A 10 ms linear fade is applied at both ends, the signal is clipped to [-1, 1] and written as 16-bit FLAC.
  4. Caption. The template is A {volume}, {descriptors} {core}, for example "A soft, resonant Karplus-Strong plucked string at G#4" or "A 112 BPM shuffle drum pattern with kick, snare, and hi-hat".
  5. Failures. 62 gen_melody samples raised an error and were dropped, so musical_constructs has 9,438 clips instead of 9,500.

Tars are filled in completion order across worker processes, so keys inside a tar are not contiguous.

Reproducibility. Running the generator again with seed 42 gives bit-identical audio. We regenerated 40 randomly chosen clips and compared the decoded 16-bit PCM: all 40 are identical. The generator reads TAR_DIR (output root) from the environment and needs numpy, scipy, soundfile and python-dotenv.

Caption rewrites

After generation, a caption clean-up pass over our whole audio collection replaced captions that had at most 4 words, more than 40 words, or were not detected as English by langdetect. In this dataset that affected 8,041 clips (7.8 %): 2,339 templates with at most 4 words (e.g. "A pink noise", "A DC offset signal") and 5,702 English templates that langdetect misclassified (e.g. "A quiet, buzzy 815 Hz square wave"). The new caption was written by Qwen3-Omni-30B-A3B-Instruct, which received the audio and the prompt "Write an audio caption for this audio in 1 sentence. For potential context, see original caption: {template caption}". The template caption is kept in original_text. Use original_text when present if you want the exact generator description for every clip.

Known quirks

  • The volume word comes from the random peak amplitude, independent of the generator. Every clip is peak-normalised, so near_silence clips (Gaussian noise floor) play at a normal level, and some captions combine contradicting words, e.g. "A very loud, barely audible, faint ambient noise floor".
  • silence clips are all-zero samples. dc_offset clips are a constant value with 10 ms ramps at both ends.
  • Captions are templates. Many clips of the same generator share the same caption except for the numbers.

License

CC0 1.0. The audio and the template captions are fully synthetic and generated by our own code. The rewritten captions were generated by Qwen3-Omni (Apache 2.0).