@maruaudio/dsp/voices/gong models large struck plates as a modal resonator bank with two behaviors a linear bank lacks: an upward energy bloom that raises the high modes after the strike, and an amplitude-dependent pitch glide of the low modes. Six recipes: tam-tam, wind gong, daluo, xiaoluo, gong ageng and symphonic, up to twelve modes each, with left and right resonators per mode, four mallets, deterministic xorshift exciter noise and ombak beating. The source cites its research and marks the other tables as design values.
Parameters
setGongParam(state, index, value), clamped as coded (indices rounded where integer):
| Index | Range | Default | Unit |
|---|---|---|---|
0 IR_INSTRUMENT / 7 MALLET_TYPE | 0 to 5 (recipe order above) / 0 yarn, 1 felt, 2 wood, 3 metal | 0 / 0 | — |
1 IR_SIZE / 2 IR_DECAY_SCALE / 3 IR_DAMPING | 0.5 to 2 / 0.1 to 3 / 0.05 to 4 | 1 / 1 / 1 | — |
4 IR_STEREO_WIDTH / 5 STRIKE_POSITION / 6 STRIKE_VEL_TONE | 0 to 1 | 0.4 / 0.15 / 0.6 | — |
8 EXCITER_NOISE / 9 BLOOM_AMOUNT / 11 GLIDE_AMOUNT | 0 to 1 | 0.15 / 0.7 / 0.7 | — |
10 BLOOM_TIME / 23 GLIDE_TIME | 0.1 to 3 / 0.1 to 2.5 | 0.8 / 0.85 | s |
12 OMBAK_AMOUNT / 13 OMBAK_RATE | 0 to 2 / 0 to 8 Hz | 1 / 2.5 | — |
14 AMP_DECAY / 15 AMP_RELEASE | 0.05 to 15 / 0.02 to 4 | 15 / 0.6 | s |
16 TUNING_BASE_FREQ | 55 to 440; MIDI 45 plays this, 12-TET | 110 | Hz |
17 MASTER_LEVEL | 0 to 1; 0.01 s glide while voices ring | 0.8 | — |
18 MODEL_STIFFNESS / 21 MODEL_RADIATION | −1 to 1 | 0 | — |
19 MODEL_COUPLING / 20 MODEL_EDGE_LOSS / 22 GLIDE_DEPTH | 0 to 1 | 0 / 0 / 0.65 | — |
Lifecycle
initGongVoice(rate) → setGongParam / gongNoteOn / gongNoteOff → gongGlideQuantum(state, voice) per render quantum per voice → gongVoiceTick per voice per frame into a caller-owned stereo bus, and gongAdvanceMasterLevel once per frame. A note-on releases a ringing voice on that note, then takes the lowest free slot or steals the oldest (starting the note-transition bridge). Note-off releases every voice on the note. To reset, init a new state.
When to use it
Tam-tams, opera gongs and gong ageng whose high modes should rise after the strike or whose pitch should settle as the plate decays.
Limits
- Stereo, sample tick, six voices of up to twelve modes; a tail is capped at 15 s, or amp decay + 0.05 s below an amp decay of 12.
- Every key is mapped, 12-TET only; there are no slendro or pelog keys here.
- The PCM16 render entry stays in audio-kernels; the voices barrel omits it.