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.
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- flow-autodiffSkill
- flow-basicsSkill
- flow-compiler-devSkill
- flow-debugSkill
- flow-dynamicsSkill
- flow-effectsSkill
- flow-graphicsSkill
- flow-perfSkill
- flow-setupSkill
- flow-stdlibSkill
- flow-verifySkill
- flow-wasmSkill
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
- Distinctive: line 57
Read a complete one before writing your own:
- Distinctive: line 89
no sample is NaN or infinite.
- Distinctive: line 90
no sample exceeds full scale, unless clipping is the point.
≈ “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.
Files
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 onlyThe modules
ls lib/stdlib/audio/
cat lib/stdlib/audio/README.md| Module | Holds |
audio.flow | SampleRate, Samples, Seconds, Frame, Buffer, conversions |
audio/oscillators.flow | Sine, saw, square, noise |
audio/filters.flow | Biquads and friends |
audio/envelopes.flow | ADSR and shaping |
audio/delay_line.flow, audio/delay.flow | Delays |
audio/effects.flow | Effects |
audio/lattice_allpass.flow | Allpass structures |
audio/graph.flow, graph_bus.flow, graph_scheduler.flow | Signal graph |
audio/wav.flow, audio/io.flow, audio/sink.flow | File and device output |
audio/notation.flow, audio/scales.flow, audio/clock.flow | Musical structure |
audio/safety.flow, audio/verify.flow | Real-time safety and checks |
audio/simd.flow, audio/gpu.flow | Vectorised and GPU paths |
stdlib/dsp.flow | General 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 existReal-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 | headUseful 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.flowdemonstrates.
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.
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
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.

