Skip to content

Examples - the demo project

The examples/demo-project/ folder is a runnable project skeleton: sounds/ (foley, impact, rpg packs), soundefs/ (the files below), and an empty baked/. Open that folder in Forge (File → Open Project…) and click any .soundef to preview it.

Each example is chosen to teach one feature. Start at rpg_pickup (simplest) and work down.

FileTeachesKey features
rpg_pickupThe minimal shapePure scalars, explicit sources, no glob, no range
sword_hitThe canonical fileLayers + selection + gain/pitch/offset ranges + reverb
footstep_suiteCompact variantsBasename glob, randomized probability
spell_wooshRange + glob everywhereGlob per layer, sequence vs random selection
hammer_limitedTaming loud hitsHot (positive dB) layers + limiter bus
slap_delayEchodelay (time/feedback/mix), ranged delay time
cave_dripSpace and tailsRandomized reverb decay/damping + delay + limiter
explosion_bigBig layered designFive layers, deep pitch-down, staggered offsets
chest_openObject sequenceFour layers + reverb, chest thud with sweeteners
armor_equipCross-pack layeringCloth + plates + helmet across packs
impact_heavyEvery field typesequence selection, all value forms together

rpg_pickup - start here

Pure scalars, explicit sources, one reverb. No randomRange, no glob. This is the smallest useful file - read it first to see the shape without any randomness.

yaml
layers:
  cloth:
    sources:
      - rpg/Audio/cloth1.ogg
      - rpg/Audio/cloth2.ogg
      - rpg/Audio/cloth3.ogg
    selection:
      mode: random
      avoidRepeat: 1
    gain: -2dB
    pitch: 0st

gain: -2dB and pitch: 0st are fixed values; selection.avoidRepeat: 1 stops the same cloth sample twice in a row.

sword_hit - the canonical example

Three layers (body, metal, sparkle), selection with avoidRepeat, randomRange on gain/pitch/offset, probability on the optional layers, and a scalar reverb. This is the canonical example. The full annotated version is in the Spec.

footstep_suite - glob + randomized probability

yaml
layers:
  body:
    sources:
      - impact/footstep_wood_00*.ogg   # basename glob → many variants
    gain: 1                            # bare number → implicit-unit warning, plays as 1dB
  carpet:
    sources:
      - impact/footstep_carpet_00*.ogg
    probability: 0.6

One glob line stands in for a whole variant set. Note the bare gain: 1 deliberately shows the implicit-unit warning - it still plays.

spell_woosh - glob + ranges + mixed selection

Every layer uses a basename glob and ranged params, and it mixes mode: random (charge, crack) with mode: sequence (shimmer). sequence steps through sources in order and consumes no RNG - good for predictable cycling.

hammer_limited - the limiter bus

Layers are intentionally hot (gain: 3dB, ranges up to +4dB) so the sum would clip. A limiter on the bus keeps the bake clean:

yaml
effects:
  limiter:
    threshold: { randomRange: ["-8dB", "-4dB"] }
    ceiling: "-0.1dB"

Reach for the limiter when you want punch without a red clip dot. See Troubleshooting: clipping.

slap_delay - the delay line

A woosh + metal hit through a mono delay with ranged time and feedback:

yaml
effects:
  delay:
    time: { randomRange: ["140ms", "260ms"] }
    feedback: { randomRange: [0.25, 0.45] }
    mix: 0.28

Randomizing time wobbles the slap distance per trigger. delay is distinct from a layer's offset - see the FAQ.

cave_drip - reverb tails + delay + limiter

Showcases randomized reverb.decay/damping for a long dark space, plus a wall-slap delay and a bus limiter. Good reference for the full effects block with ranges.

explosion_big - large layered design

Five layers (thump, boom, crack, shrapnel, rumble) with staggered offsets and deep pitch-down (down to -24st) for weight. Shows how layer order and offset build a single cinematic event from small impacts.

impact_heavy - every field type

The kitchen-sink file: sequence selection, positive and ranged gain, deep pitch ranges, and a full reverb + delay + limiter chain. Use it to see all value forms in one place. Reproduced in the Spec.

chest_open - object sequence

Four layers (thud, latch, coins, creak) build a chest open from always-on wood thud to rare coin sweetener. Uses only rpg/Audio for a self-contained example with staggered offsets.

armor_equip - cross-pack layering

Cloth rustle + armor plates + helmet across rpg and foley packs. Shows heterogeneous sound packs in one behavior and basename globs for plates/helmet.

See also

Soundef — declarative SFX behavior