agentleFS
flooooooooooowflooooooooooow/flow-skills/skills/flow-audio/SKILL.md

flow-audio

Skill1 starsChanged 3 months agoMITView on GitHub

Write synthesis and DSP in Flow, render to WAV, and keep real-time code safe. Use for oscillators, filters, envelopes, delays, reverb, drum machines, music, or any audio or signal processing task.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read a complete one before writing your own:

    line 57
  2. Distinctive:

    no sample is NaN or infinite.

    line 89
  3. Distinctive:

    no sample exceeds full scale, unless clipping is the point.

    line 90

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Audio and DSP

Flow has a real audio stack: typed sample rates, frames, buffers, oscillators, filters, envelopes, delay lines, a graph scheduler, and real-time safety checks.

Requires FLOW_HOST=python.

Run it

FLOW_HOST=python flow audio program.flow           # compile and run with the audio backend
FLOW_HOST=python flow compile-audio program.flow   # compile only

The modules

ls lib/stdlib/audio/
cat lib/stdlib/audio/README.md
ModuleHolds
audio.flowSampleRate, Samples, Seconds, Frame, Buffer, conversions
audio/oscillators.flowSine, saw, square, noise
audio/filters.flowBiquads and friends
audio/envelopes.flowADSR and shaping
audio/delay_line.flow, audio/delay.flowDelays
audio/effects.flowEffects
audio/lattice_allpass.flowAllpass structures
audio/graph.flow, graph_bus.flow, graph_scheduler.flowSignal graph
audio/wav.flow, audio/io.flow, audio/sink.flowFile and device output
audio/notation.flow, audio/scales.flow, audio/clock.flowMusical structure
audio/safety.flow, audio/verify.flowReal-time safety and checks
audio/simd.flow, audio/gpu.flowVectorised and GPU paths
stdlib/dsp.flowGeneral signal processing

Units are typed on purpose. Build a sample rate with sample_rate_48000() rather than passing a bare number, and convert with ms_to_samples, samples_to_seconds, and seconds_to_samples. That is the whole point of those wrappers.

Shape of a voice

import "stdlib/audio.flow"
import "stdlib/audio/oscillators.flow"
import "stdlib/audio/envelopes.flow"
import "stdlib/audio/filters.flow"

Read a complete one before writing your own:

cat examples/audio/fm_voice.flow
cat examples/audio/karplus_strong.flow
cat examples/audio/drum_machine.flow
cat examples/audio/adsr_vs_click.flow      # why envelopes exist

Real-time rules

Inside an audio callback: no allocation, no locks, no file or console I/O, no unbounded loops. Allocate buffers up front and hand them in.

audio/safety.flow and docs/language/ cover the real-time profile. Use the delay feedback guard pattern from examples/audio/delay_feedback_guard.flow for any feedback path, because an unguarded feedback gain above one produces a signal that grows until it clips or becomes NaN.

Verify by measuring, not by listening

Render to a file and check the numbers.

ls examples/audio/*probe* examples/audio/*verify*
grep -rn --include='*.flow' "function verify_" lib/stdlib/audio/verify.flow | head

Useful assertions:

  • peak and RMS fall inside an expected range;
  • no sample is NaN or infinite;
  • no sample exceeds full scale, unless clipping is the point;
  • a sine at a stated frequency has its energy in the right bin;
  • an envelope with a proper attack has no discontinuity at note start, which is what adsr_vs_click.flow demonstrates.

Return a distinct non-zero code from main per failed check.

Reporting

State the sample rate, the block size, the duration rendered, the peak and RMS, and the exact command. If you produced a WAV, give its path. Never say a sound "sounds right"; you did not hear it.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.