20240131_Interactive Audio in GameSynth EN b

Interactive Audio with GameSynth

The patching environment of GameSynth comes with many Control and Logic modules that are usually not found in virtual synthesizers. They allow for the creation of advanced sonic behaviors and interactive systems, for instance driven by game parameters. In this post, we will be focusing on the Logic modules.

Types of logic modules

The logic modules mostly handle triggers (or events) and can be grouped by category:

  • Event generation: Clock, Distribution, Gait, Sequencer, and Pattern send triggers periodically, randomly, or based on rules and parameters.
  • Event filtering: Oncer and Divider will remove events, while Retrigger will add some.
  • Logic operations: Crossings, Comparator, and Logic Gate evaluate their inputs and trigger events when the right conditions are met.
  • Signal routing: Selector, Switch, and Transitions will route signals to different branches of your patch based on their inputs and operating modes.
  • Storage: Queue and Stack can temporarily store values, making them useful to create simple algorithms.

From dynamically re-routing modulation signals to triggering and muting sub-sections of your patches, the logic modules of GameSynth offer ways to make your sounds evolve far beyond what a regular synthesizer can provide. In the rest of this post, we will show a few use cases.

Parameter-Triggered Events

The Crossings module generates triggers when its input signal crosses specific values. This makes it easy to play different branches of a patch based on the value of a parameter.

In the following patch, a MetaParameter drives several Crossings modules to generate a mechanical sound.

  • All the outputs of the first Crossings module trigger metallic clicks. The thresholds are spaced at regular intervals, effectively allowing us to control the clicking speed via the MetaParameter’s movement.
  • The two other Crossings modules are configured as to play impact sounds when the MetaParameter reaches its minimum or maximum values.
  • Finally, a Motor sound is played, but only when the MetaParameter is moving, thanks to the use of the Derivatives module, which outputs the movement’s velocity.

Dynamically Switching Modulation Signals

The Selector lets a different control signal go through each time it is triggered. Its various modes of operation (Sequential, Random, Shuffle…) help you to dynamically route your modulation signals.

For instance, when the “Pitch” meta-parameter of this Force Field patch reaches a specific value, some of the parameters will fade out to end the patch smoothly:

  • The Crossings module will trigger the Selector, making it switch to its second input.
  • At the same time, the Automation Curve connected to the second input is triggered to start the fade-out of several parameters (frequency of the EQ Filter, duration of the Blip, and amplitude of the Beam).
  • The Crossings module will also switch the state of the Mute module, ensuring that the sound is completely cut off.

Similarly, in the Cash Register patch below, the Selector module allows us to alternate between two distinct mechanical sounds, corresponding to the movements of the register.

  • The two Envelopes are routed through the Selector, which is set to Sequential mode.
  • A Switch module allows us to trigger them alternatively when it is activated by the Crossings module.
  • In order to change the routing each time, the Crossings is also triggering the Selector.
  • Finally, the second output of the Switch is used to trigger the bell of the cash register on the second movement.

Comparing signal levels

While the Crossings module is sufficient to trigger simple logic, its threshold values are fixed, and therefore it cannot perform comparisons between control signals. Instead, the Comparator should be used.

This Laser patch plays a charging sound followed by a shot. The longer the charging time, the louder the shot will be.

  • The MetaParameter is used as a threshold. The shot is triggered when the Envelope of the charging sound becomes greater than its value.
  • To achieve this, the values of the Envelope and the MetaParameter are compared by the Comparator module (set to Greater).
  • Once the value of the Envelope goes higher than the value of the MetaParameter, the output of the Comparator switches to true and the shot is triggered. (Note that a Oncer module is used to only keep the first trigger. This is because the Comparator will continue to output triggers as long as the comparison remains true.)

An additional branch – with a Thunder module – is triggered if the threshold is high enough. This means that the patch must meet two conditions to trigger that branch:

  • The MetaParameter value must be higher than 0.85 (value provided by a Constant module).
  • The shot must have been triggered. That is why a Logic Gate module set to AND is used. If the shot is triggered AND the threshold is higher than 0.85, the thunder branch will play.

Going further

The last patch is a shotgun sound with a simple reloading system. If you simply pull the trigger – using the meta-parameter of the same name -, only the mechanical sound of the weapon will be heard. But once a bullet is loaded with the “Pump” MetaParameter, the shooting sound will play back. The shotgun must be reloaded with the pump after each shot.

  • A Crossings module – with the “Trigger” MetaParameter as input – is used for the shot.
  • Two other Crossings modules simulate the working of the pump as the “Pump” MetaParameter is moved back and forth.
  • More logic allows for the shot to be fired, but only if the pump has just been used. The Queue module comes in handy to store this information. The value 1 is written when the “Pump” MetaParameter has been used.
  • This value is read when using the Trigger MetaParameter. A Comparator checks that it is higher than 0.5. If the pump was used and the trigger was activated by the Crossings module, the shot is fired.
  • Once the first shot has been triggered, a Mute module is switched to Unmuted, activating a branch with a Bullet module. The next time the “Pump” MetaParameter is used it will also trigger the sound of a shell bouncing on the ground.

These are only a few examples of interactive patches showcasing the logic modules. Combined with the many control modules available, they offer endless possibilities to craft advanced audio behaviors in GameSynth. Download the patches and start experimenting with them, and if you need more help using these modules, do not hesitate to ask on our Discord server!

download-patches

GameSynth

discord