score
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->
score
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->TODO: describe this module.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2game.audio.score — the recipes for every sound the cloister makes. Four looping BEDS, encoded `codec = "pcm"` because an Opus clip loses its first few milliseconds on decode and a bed that loops would tick at the seam. Everything else is a one-shot, where Opus costs nothing and saves a lot. The score is three layers over one another rather than three tracks in a row: `music_calm` is the cloister as it should be, `music_swell` is the strings coming in under it, and `music_sour` is the same harmony bent — a minor second, a tritone and a detuned unison that beats. The conductor raises `music_sour` and lowers `music_calm` as `state.blightShare` climbs, so the music does not change track, it curdles. Every bed is 16 seconds long and every periodic thing in it is locked to a whole number of cycles per 16 seconds, so the last sample joins the first.
bedBuf( ) → void
pump( ) → void
choir(buf: ?, freq: ?, amp: ?, env: ?, detune: ?, vibRate: ?) → void
A choir-ish voice: a fundamental with a soft partial stack and slow vibrato.
| arg | type | description |
|---|---|---|
| buf | ? | |
| freq | ? | |
| amp | ? | |
| env | ? | |
| detune | ? | |
| vibRate | ? |
strings(buf: ?, freq: ?, amp: ?, env: ?, detune: ?) → void
A bowed-string-ish voice: a denser odd/even stack, brighter than the choir.
| arg | type | description |
|---|---|---|
| buf | ? | |
| freq | ? | |
| amp | ? | |
| env | ? | |
| detune | ? |
strike(buf: ?, sr: ?, atSec: ?, durSec: ?, freq: ?, amp: ?, decay: ?, ratios: ?) → void
One struck note into a one-shot buffer, with a harmonic stack and a decay.
| arg | type | description |
|---|---|---|
| buf | ? | |
| sr | ? | |
| atSec | ? | |
| durSec | ? | |
| freq | ? | |
| amp | ? | |
| decay | ? | |
| ratios | ? |
burst(buf: ?, sr: ?, atSec: ?, durSec: ?, amp: ?, attack: ?, decay: ?, lp: ?, hp: ?) → void
A burst of filtered noise — the raw material of every impact and whoosh.
| arg | type | description |
|---|---|---|
| buf | ? | |
| sr | ? | |
| atSec | ? | |
| durSec | ? | |
| amp | ? | |
| attack | ? | |
| decay | ? | |
| lp | ? | |
| hp | ? |
music_calm( ) → void
The cloister at rest: a low pedal, a fifth, and three voices in D minor breathing at slightly different rates so the chord never sits still.
music_swell( ) → void
The strings under it: the same chord, bowed, and a slow rise into the room.
music_sour( ) → void
The same music, wrong. A minor second rubbing on the tonic, a tritone above it, and a unison split by a third of a hertz so the whole thing beats.
amb_greenhouse( ) → void
The greenhouse itself: air moving over broken glass, the brass mains ticking and dripping, a long glassy resonance overhead, and leaves.
shot(durSec: ?, seed: ?) → void
| arg | type | description |
|---|---|---|
| durSec | ? | |
| seed | ? |
ui_click( ) → void
ui_hover( ) → void
ui_confirm( ) → void
ui_back( ) → void
ui_deny( ) → void
tile_select( ) → void
unit_select( ) → void
move_step( ) → void
tile_heave( ) → void
attack_anselm( ) → void
attack_meridia( ) → void
attack_cassian( ) → void
attack_vespera( ) → void
hit_flesh( ) → void
hit_crystal( ) → void
miss( ) → void
unit_death( ) → void
overwatch_arm( ) → void
plant_grow( ) → void
blight_grow( ) → void
sow( ) → void
burn( ) → void
flood( ) → void
round_begin( ) → void
phase_garden( ) → void
phase_blight( ) → void
sting_victory( ) → void
sting_defeat( ) → void
names( ) → void
--!desc Every clip name this module can build, beds first. --!return An array of names. --!example for _, n in ipairs(Score.names()) do print(n) end
build(name: string) → void
--!desc Build one clip's samples without writing an asset. --!arg name A name from Score.names(). --!return Three values: the sample table, the sample rate, the channel count. --!example local pcm, rate, ch = Score.build("ui_click")
| arg | type | description |
|---|---|---|
| name | string |
bake(name: string) → any
--!desc Build a clip and write it as a `.soundClip` under game/audio/clips. --!arg name A name from Score.names(). --!return A table with the asset path, the frame count and the encoded codec. --!example Score.bake("music_calm")
| arg | type | description |
|---|---|---|
| name | string |
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.