bgm
Plays or stops looping music from audio/bgm/.
{ "type": "bgm", "value": "main_theme", "volume": 0.7, "fadein": 1.0 }
{ "type": "bgm", "value": null, "fadeout": 1.0 }
[bgm main_theme fadein 1.0 volume 0.7]
[bgm stop]
Usually you need
| Field | Type | Default | Effect |
|---|---|---|---|
value | string or null | — | Track name; null / stop clears |
volume | 0–1 | 1.0 | Track ceiling |
fadein | ≥ 0 | 1.0 when playing | New track fade-in |
fadeout | ≥ 0 | 0 play; 1.0 if stopping and omitted/0 | Old track fade-out |
All fields
| Field | Type | Default | Effect |
|---|---|---|---|
value | string or null | — | Track / stop |
volume | 0–1 | 1.0 | Ceiling |
fadein | ≥ 0 | 1.0 (play) | Fade in |
fadein_from | 0–1 | 0.0 | Start fraction of ceiling |
fadeout | ≥ 0 | see above | Fade out |
fadeout_to | 0–1 | 0.0 | End fraction |
when | expression | — | Skip when falsy |
Same track again does not restart; volume may update. Both fadein + fadeout on play → crossfade. Title default BGM uses sounds.main_bgm* (often 1.5s fades) — not these command defaults. Audio · sounds.