SEGAN
Sound Effect Grammar And Notation

You speak English.
Your agent speaks SEGAN.

SEGAN is a language for game audio: instrument kits, sound effects, music patterns and mix rules, written as plain text. Your AI agent writes it, SEGAN checks and renders it, and your game gets engine-ready WAVs, loop points and a manifest.

  • MIT-licensed, free
  • Runs locally, offline
  • No account, no credits
  • The sound is yours

Looking for the same for pixel art? Try PAGAN. For 3D models,KILN. Both are SEGAN's sister libraries.

A 4-bar loop at 128 bpm, from this 63-line file. Press play; the yellow lines are its loop points.music/theme.song.yaml
name: theme
description: "Title theme: A minor, 128 bpm, a pulse lead over driving triangle-bass eighths and noise drums. Am F | C G, four bars, loops seamlessly."
kit: chip
tempo: 128
key: A minor                  # rows are the notes of the key: an off-key note can't be written
status: draft
tracks:
  lead:  { roll: [A4, A5] }
  bass:  { roll: [E2, E3] }
  drums: { drums: [k, s, h] }
patterns:
  a:                          # Am | F
    length: 32
    lead: |
      ....|....|....|....|....|....|....|....  A5
      ....|....|....|....|....|....|....|....  G5
      ....|....|....|....|p---|--..|....|....  F5
      ....|p---|....|p---|....|..p-|....|....  E5
      ....|....|p-..|....|....|....|....|....  D5
      ..p-|....|..p-|....|....|....|p---|....  C5
      ....|....|....|....|....|....|....|....  B4
      p-..|....|....|....|....|....|....|p---  A4
    bass: |
      ....|....|....|....|....|....|....|....  E3
      ....|....|....|....|....|....|....|....  D3
      ....|....|....|....|....|....|....|....  C3
      ....|....|....|....|....|....|....|....  B2
      b-b-|b-b-|b-b-|b-b-|....|....|....|....  A2
      ....|....|....|....|....|....|....|....  G2
      ....|....|....|....|b-b-|b-b-|b-b-|b-b-  F2
      ....|....|....|....|....|....|....|....  E2
    drums: |
      x...|....|x...|....|x...|....|x.x.|....  k
      ....|x...|....|x...|....|x...|....|x..o  s
      x.x.|x.x.|x.x.|x.x.|x.x.|x.x.|x.x.|x.x.  h
  b:                          # C | G
    length: 32
    lead: |
      ....|....|....|..p-|....|....|....|....  A5
      p---|....|....|p-..|p---|--..|....|....  G5
      ....|....|....|....|....|..p-|....|....  F5
      ....|p-..|p---|....|....|....|....|....  E5
      ....|....|....|....|....|....|p---|....  D5
      ....|..p-|....|....|....|....|....|....  C5
      ....|....|....|....|....|....|....|p---  B4
      ....|....|....|....|....|....|....|....  A4
    bass: |
      ....|....|....|....|....|....|....|....  E3
      ....|....|....|....|....|....|....|....  D3
      b-b-|b-b-|b-b-|b-b-|....|....|....|....  C3
      ....|....|....|....|....|....|....|....  B2
      ....|....|....|....|....|....|....|....  A2
      ....|....|....|....|b-b-|b-b-|b-b-|b-b-  G2
      ....|....|....|....|....|....|....|....  F2
      ....|....|....|....|....|....|....|....  E2
    drums: |
      x...|....|x...|....|x...|....|x.x.|....  k
      ....|x...|....|x...|....|x...|..x.|xXXX  s
      x.x.|x.x.|x.x.|x.x.|x.x.|x.x.|x...|....  h
sections:
  main: [a, b]
arrangement: [main]
loop: main
The translation layer

You don't learn SEGAN. Your agent does.

With the SEGAN skill (Claude) or the MCP server (any agent), your AI agent becomes the translator between what you want and the sounds your game plays. It can't hear, so SEGAN shows it a picture of every sound and the numbers that matter.

  1. You English

    "A coin pickup, bright and short."

  2. Agent Claude + SEGAN skill / MCP
    • writes coin.sfx.yaml
    • runs segan lint
    • reads the listen sheet
    • fixes what's off
  3. SEGAN the compiler
    • renders 4 variations
    • one shared mix
    • on its loudness target
    • byte-identical builds
  4. Your game any engine
    • coin.1-4.wav
    • coin.tres
    • manifest.json
Interactive demo

Watch an agent make game audio

Choose your own adventure: pick what you're building, then what to ask for next. Start over to take another path. Each reply has the sounds (press play), their listen sheets, what the agent wrote, and the files your game gets.

A scripted conversation. The sounds, listen sheets, source files, diffs, lint results and build output are real SEGAN output, rebuilt from the source files in this site's repo.

Let your agent do it

An agent building your game calls SEGAN like a service

While you play-test, an orchestrator agent asks SEGAN for the sounds it needs, reads back the manifest and wires them into the scene. manifest.json is the contract, so it works for any engine; Godot resources come for free.

  1. orchestrator → seganwrite_asset sfx/coin.sfx.yaml

    "Coins need a pickup sound; they're collected a lot, so vary it."

  2. segan → orchestrator{"ok": true, "errors": 0, "warnings": 0, listen sheet: image}

    It reads the sheet and the numbers (-14 LUFS, no lead-in), then calls build.

  3. segan → gamesfx/coin.1-4.wav · coin.tres · manifest.json

    11 coin files: 4 variations, an AudioStreamRandomizer, their lengths in samples.

  4. orchestrator → game$Coin.stream = load("res://assets/generated/audio/sfx/coin.tres")

    Every coin now sounds a little different.

Level 1-2 · coin.tres · AudioStreamRandomizer

Why SEGAN

Built for a whole game's worth of sound

Everything below is real build output from the demo projects, played in your browser from the same files and loop points a game loads.

1 Sound as source code

The agent writes text you can read, diff, review and keep in git. "A danger version for when enemies are near" is a one-line change, and the review is a normal pull request.

music/dungeon.song.yaml
@@ -105,3 +105,6 @@   main: [a, b, a, c] arrangement: [main] loop: main                    # the whole song loops++variants:                     # each one is music/dungeon.<variant>.wav, same bars and loop points in bars+  danger: { tempo: 124, instrument_swap: { q: r } }   # enemies near: faster, a thinner, edgier arpeggio

2 Kits are the palette

A kit maps one-character keys to synth instruments and drum macros. Songs write those keys in their step grids, whose rows are the notes of the song's key, so an off-key note can't be written. Every song made with a kit sounds like the same game. Click a key to hear it.

Bright 80s arcade synth: filtered saw lead, square bass, fast arpeggio, punchy drums.

3 One mix for everything

Every sound goes through one shared mix: room, tone, crush, limiter and loudness targets. "Punchier and drier" is segan mix adjust --room -0.1 --brightness 2, and every asset follows.

4 It checks its own work

Lint catches what an agent can't hear: lead-in silence (input lag), clicks at loop points, clipping, aliasing, off-key clashes, loudness out of reach. A real finding, from the stomp's first version:

W005 stomp starts after 38 ms of near-silence (> 5 ms)

Fixed: every layer starts at 0, 0 warnings

5 Loops that don't click

Looping songs end with the loop's first bar again, so the tail rings into the start, and the manifest gives loop points in samples. This player loops on them, sample-exact, like a game.

SEGAN's seam view of the dungeon loop: the end spliced onto the start, with no jump at the splice

6 Variations, not repetition

Sounds that play all the time get variations: small pitch and timbre changes, each normalised. Godot gets an AudioStreamRandomizer. Press "play again" a few times.

7 Variants that switch in time

danger: { tempo: 124, instrument_swap: { q: r } } is a whole second version of the song. Switch while it plays: it jumps to the same bar, from the manifest's timing.

8 Loudness that matches

Every asset is normalised to its category's target (music -16 LUFS, SFX -14, UI -20, footsteps -22), so nothing jumps out. segan gallery draws all of them, with this chart at the bottom:

segan gallery of SEGAN's demo project: every asset's waveform and spectrogram, and a loudness chart by category with each target

9 Free, open, local

MIT-licensed. Runs on your machine, offline. No account, no credits, no API key, no cloud. Builds are deterministic: the same sources give byte-identical WAVs.

10 Built for agents

A Claude skill that teaches the whole workflow (including how to read a listen sheet honestly), an MCP server with 22 tools that returns listen sheets as images, --json on every command, and a long-term memory in the project: BRIEF.md, SOUND.md, asset status.

11 Honest about hearing

An agent can't hear, so SEGAN never lets it pretend: every asset stays status: draft until a human listens and runs segan mark --status approved. Everything on this page is still a draft.

12 Engine-ready

manifest.json describes every file: length and loop points in samples, sections, bars and markers, variants, variations, phases and stems. Any engine can read it. For Godot 4, SEGAN also writes the loop points into each WAV's .import, an AudioStreamRandomizer per varied SFX and an AudioStreamSynchronized per song with stems.

manifest.json (shortened)
{
 "dungeon": {
  "kind": "song",
  "file": "res://assets/generated/audio/music/dungeon.wav",
  "samples": 952560,
  "sample_rate": 44100,
  "bpm": 100,
  "bars": 8,
  "loop": {
   "end": 952560,
   "end_seconds": 21.6,
   "offset": 105840,
   "section": "main",
   "start": 105840,
   "start_seconds": 2.4
  },
  "lufs": -16,
  "variants": {
   "danger": {
    "file": "res://assets/generated/audio/music/dungeon.danger.wav",
    "bpm": 124,
    "loop": {
     "start": 85355,
     "end": 768194
    }
   }
  },
  "stems": {
   "drums": {
    "channels": 2,
    "file": "res://assets/generated/audio/stems/dungeon/drums.wav",
    "loop": {
     "end": 952560,
     "start": 105840
    },
    "samples": 952560,
    "seconds": 21.6,
    "tracks": ["drums"]
   },
   "…": "3 more"
  },
  "godot_stems": "res://assets/generated/audio/stems/dungeon.tres"
 }
}
# Godot 4
var music: AudioStreamSynchronized = load("res://assets/generated/audio/stems/dungeon.tres")
music.set_sync_stream_volume(1, -60.0)   # stream_1 = drums: out while exploring
$Music.stream = music
$Music.play()                       # every stem in sync

# a fight starts: bring the drums in
music.set_sync_stream_volume(1, 0.0)

$Coin.stream = load("res://assets/generated/audio/sfx/coin.tres")
$Coin.play()                        # a different variation each time
How it compares

Four kinds of tool

Facts as of October 2026, from each tool's own documentation. Pick what fits your game.

AI audio generatorsElevenLabs Sound Effects, Stable Audio, Suno, UdioProcedural SFX toolssfxr / jsfxr / bfxr, ChipTone, ZzFXTrackersFamiTracker, FurnaceSEGAN
How sound is madeA generative model renders audio from a text promptSliders and randomise buttons over one synth patchA human enters notes into pattern gridsThe agent writes a source file in a text notation that SEGAN compiles
Sound is stored asMP3/WAV filesParameter sets, or exported WAVsModule files (.ftm, .fur, …) + exportsText in git: diffable, reviewable, editable by hand or by agent
What it makesSFX, ambience, voice, full songsShort SFXMusic (and SFX by hand)SFX, layered and phased; looping music with variants and stems
Cost / accessCredits or subscriptions, cloud, accountFree, mostly in the browserFree (some open source)Free, MIT, offline
RealismBest of the four: recorded-sounding audio and vocalsRetro synth onlyChip / synth (sample playback in some)Synth only: chiptune and 80s synth; no samples, no vocals
Consistency across a gamePer promptPer soundPer moduleOne shared kit palette, mix, room and loudness targets; change one setting, every asset re-renders
Quality checksNoneNoneYour earsLint the agent reads and fixes (lead-in silence, loop clicks, clipping, aliasing, clashes, loudness), and listen sheets it can look at
Engine outputAudio filesWAVWAV / NSF / chip formatsWAVs with smpl loop points, manifest.json for any engine, Godot .import loops, randomizers and synchronized stems
Agent accessAPIs; ElevenLabs has an official MCP serverZzFX's sounds are short code arraysNoneClaude skill, MCP server (22 tools), --json CLI
DeterministicNoYesYesYes: byte-identical builds

Where SEGAN loses: it isn't a recording studio or a composer. For realistic foley, orchestral scores or vocals, a sample library or an audio generator is better, and SEGAN can't judge taste: a human has to listen. SEGAN wins on a whole game's worth of retro-synth sounds and loops that match, loop cleanly, and change together.

Install

One line, then ask

Requires Python 3.11+. Pin a tag so your sounds build the same way next year (v0.4.1 is current).

$ pip install "git+https://github.com/lukasgolino/segan.git@v0.4.1"  # install SEGAN (Python 3.11+)
$ segan skill install  # copy the skill into this repo's .claude/skills/

Then ask Claude: "I'm making a dungeon crawler; make a tense exploration loop and a door creak."

Open source

Free, for good

SEGAN is MIT-licensed. Every released version stays free to use, change and ship, commercially or not. No account, no telemetry, no cloud: it runs on your machine.

  • Source, issues and releases on GitHub
  • Current release: v0.4.1, see the changelog
  • Contributing: open an issue first for notation changes; every feature lands with tests, output stays byte-identical, and anything that changes rendered samples gets a version bump.
  • Game repos pin a tag, so your sounds never change under you.
  • Sister libraries: PAGAN (pixel art) and KILN (smooth 3D models), same design, same workflow.
The SEGAN icon, a speech bubble holding a waveform

MIT · free forever · icon made with PAGAN

SEGAN's sound logo, made with SEGAN: sfx/jingle.sfx.yaml

FAQ

Straight answers

Is SEGAN an AI audio generator?

No. SEGAN doesn't generate audio with a model: it compiles. Your AI agent writes SEGAN source files (kits, step-grid songs, layered SFX); SEGAN checks them and renders them with a deterministic synthesizer. The results are exact, repeatable and editable, and they sound like synths, not recordings.

Does it sound good?

We can't promise that, and neither can your agent: it can't hear. SEGAN gives it listen sheets and numbers (pitch, loudness, clicks, timing), which catch mistakes but not taste. Every sound on this site is still a draft that no human has signed off yet; listen and judge for yourself. Your own sounds stay drafts until you approve them.

When should I use something else?

For realistic foley, orchestral scores, vocals or anything that should sound recorded, use a sample library or an audio generator: SEGAN is synth only (chiptune and 80s synth styles). For one quick retro blip, sfxr-style tools are faster. SEGAN wins when you need a whole game's worth of sounds and loops that match and change together.

Is it a composer?

No. It makes wrong notes impossible to write (grid rows are the notes of the key) and flags clashes, but the music is only as good as what the agent writes. The skill teaches it the craft (chords, bass on the beats, phrases); you decide if it works.

Which agents work with it?

Any agent that speaks MCP (Claude Desktop, Claude Code, Cursor, your own). The SEGAN skill, which teaches the full workflow, is for Claude. Without either, the CLI's --json output is easy for any program to drive.

Which engines?

Any: manifest.json describes every file, its loop points in samples, sections, bars, markers, variants and stems, and the WAVs carry their loop points in a smpl chunk. Godot 4 gets loop points in .import files, randomizers and synchronized stems out of the box.

Who owns the sounds?

You do. SEGAN is MIT-licensed and runs locally; nothing is uploaded and nothing is claimed.

Is the demo a live AI?

No. It's a scripted conversation, so it can't make things up. But every sound, listen sheet, source file, diff, lint result and file listing in it is real SEGAN output, rebuilt from the project files in this site's repository. Music is served as Ogg Vorbis to keep the page light; it has the same length in samples, so the loop points are exact.

More in the docs.