irrKlang object (v1.0.2)

an advanced sound extension for Clickteam Fusion based on the irrKlang audio library (© Nikolaus Gebhardt)


Table of contents:


Introduction

The irrKlang object is an advanced sound extension for Clickteam Fusion. From it's features is allowing Fusion developers to feasibly implement real-time 3D and 2D sound with realistic effects, recording the microphone, playing it back and saving it locally to a WAV file.

Please note that this extension must not be used in commercial products (see the irrKlang license). If you wish to do so, you must purchase the appropriate license from Ambiera and recompile the extension from source with your irrKlang Pro files (see the extension source code here).

Note: This extension currently doesn't include native support for Fusion's embedded binary files feature. To use these, you must extract/release your binary files yourself and pass the temporary filenames for playback. Refer to The objects -> Inventory -> Special objects -> The Special Object -> Actions section in the Clickteam Fusion help file to learn more about this.


How to use : Actions

- Creating the irrKlang device (optional)

Before doing anything with the object, you must create the irrKlang device first. By default, it is created automatically (see object properties), but you can create it manually in events if you want to do specific things like play sounds using a specific device driver and on a specific sound device. Assuming you're already familar with placing events in Fusion:

This action contains 2 parameters:

- Playing a sound

Playing a sound can be done as follows:

Playing sounds contains these 3 parameters:

- Playing a 3D sound

You can play a 3D sound to simulate sound in a three-dimensional space. Playing a 3D sound can be done as follows:

Unlike 2D sounds, playing 3D sounds contains these unique parameters:

3D sounds can be manipulated using the 7 actions listed below:

- Manipulating sounds

3D and 2D sounds share actions for general sound manipulation. They are listed below:

NOTE: You can also manipulate sounds by referring to them using a numeric ID specified when initially playing the sound rather than their pathname. To do this, you use the same actions but in the Modify sounds by ID submenu instead. This applies to Conditions/Expressions as well:

- Realtime sound effects

You can apply realtime sound effects such as chorus and reverb to playing sounds and manipulate their sound effect parameters at runtime.

The full list of available sound effects are:

IMPORTANT NOTE: Sound effects are only available when using the DirectSound8 device driver.

You can apply these effects to sounds by using the Enable XXX sound effect for a sound action (where XXX is the name of the sound effect you want to use).

If a sound has a sound effect applied, you can modify it's parameters by using the Set XXX parameters action.

The full list of parameters for each sound is displayed below, and an explanation for them via the irrKlang library documentation:

Chorus

Compressor

Echo

Distortion

Flanger

Gargle

Interactive 3D Audio Level 2 reverbation

Parametric Equalizer

Waves reverb

- Recording audio using the microphone

You can record and play back audio using one of the microphones present on the computer. This can be done by first creating a microphone recorder using the Microphone > Create microphone recorder action (or by enabling the Automatically create microphone recorder checkbox in the object properties), and then using the Start recording microphone action to begin recording the microphone. You must then call the Stop recording microphone action when you are finished recording.

IMPORTANT NOTE: The microphone recorder is only compatible with the DirectSound8 device driver.

All actions are listed below:

The Create microphone recorder action has 1 parameter:

The Start recording microphone action has 1 parameter:

The Stop recording microphone action has 1 parameter:

The Save last microphone recording to WAV file action has 1 parameter:

- Loading plugins from a folder

irrKlang supports plugins, which allows to extend the possible file formats you can play (see the irrKlang library documentation for creating your own plugins, which requires general C++ and sound knowledge). To utilize plugins, you use the Load plugins from a folder action which will load all plugin DLLs in that folder. It contains 1 parameter:

How to use : Conditions

Using Conditions in the Event Editor, you can check if the sound/microphone device is active and check sound states like if a sound is paused or if it is currently playing. Each condition is documented below:

Check if the irrKlang device is active

You can use the Is irrKlang device created? condition to check if irrKlang is active.

Check if the microphone recorder is active

You can use the Is microphone recorder created? condition to check if the microphone recorder is active.

Check if a sound is playing

You can use the Is a specific sound playing? (or Check sounds by ID -> Is a specific sound playing by ID? to check by ID rather than filename) condition to check if a sound is playing. This condition takes a filename parameter which indicates what sound to be checked.

Check if a sound is paused

You can use the Is a specific sound paused? (or Check sounds by ID -> Is a specific sound paused by ID? to check by ID rather than filename) condition to check if a sound is paused. This condition takes a filename parameter which indicates what sound to be checked.

How to use : Expressions

You can use Expressions to get values of things like 3D sound/listener position, sound volume, etc. Each expression is documented below:

Retrieving listener states

The Listener submenu (or By ID -> Listener submenu for refrencing sounds by ID) contains a list of expressions related to the 3D sound listener (remember, it's like the position of the player around the sounds), such as Get the listener's X/Y/Z position to get the listener position, Get the listener's X/Y/Z rotation to get the listener rotation, and Get the listener's X/Y/Z velocity to get the listener velocity (only used for doppler effects).

Retrieving sound states

The Sound submenu contains a list of expressions related to 3D sounds, such as Get a sound's X/Y/Z position to get the position of a 3D sound, Get a sounds's minimum/maximum distance to get the minimum/maximum distance of a 3D sound, and Get a sounds's X/Y/Z velocity to get the velocity (the speed of a sound, only used for doppler effects) of a 3D sound.

Generic expressions

The rest of the general expressions are documented below:

Microphone expressions

The Microphones submenu contains a list of expressions related to the microphone devices currently connected to the computer. They are documented below:

Sound device expressions

The Sound devices submenu contains a list of expressions related to the sound devices currently connected to the computer. They are documented below:

Retrieve active device driver name

The Get active device driver name expression simply returns the name of the device driver actually being used by the irrklang device. Possible returned strings are "DirectSound", "DirectSound8", "winMM" or "" if the irrKlang device isn't created.