Function TriggerFx

From Uzebox Wiki
Jump to: navigation, search
Prototype

void TriggerFx(unsigned char patch,unsigned char volume, bool retrig);

Description

Triggers a patch at the specified volume. Contrary to TriggerNote(), the function uses a voice stealing algorithm to play the patch on the next available channel. You also don't specify a pitch for FXs, it must be defined within the patch's command stream.

Parameters
  • patch: Patch number to play.
  • volume: Volume to play the patch, 0x00 to 0xff.
  • retrig: If set to true and another TriggerFx() call is made for the same patch *before* the previous one is finished playing, it will re-trigger it right away on the same channel instead of starting another simultaneous instance of the sound onto another channel (determined by the voice stealing algorithm).
Returns

Void

Video Modes

All

Since

V1

Example:

//trigger fx #5 at maximum volume
TriggerFx(5, 0xff, true);