Skip to main content
← PSoXide SDK guides and examples · SDK 80d1c329e977 · All Cargo features enabled; check feature gates before use.

Module vloop

Module vloop 

Source
Expand description

Virtual loops: many loops, few voices.

Half-Life authors thirty-two ambient loops on seven voices, Quake thirty-two on eleven, WipEout a crowd plus rival engines of which only the nearest two sound. The shape is always the same: a table of loop emitters, each with the level it would have if it had a voice, and a rule that gives the voices to the loudest. LoopTable is that rule.

A loop only changes hands when a waiting loop beats the weakest holder by a margin (25 percent), so two loops of nearly equal level do not trade voices every frame and click.

The lane the loops play on should use Policy::FirstFree and hold nothing else: the table does its own stealing, with the margin, and must not have the mixer do it behind its back.

Structs§

LoopTable
A table of M loop emitters sharing the voices of one lane.

Constants§

HYSTERESIS_PERCENT
How much louder (in percent) a waiting loop must be than the weakest loop holding a voice before it takes that voice. Half-Life’s claim_if_louder.