# Audio Reactive

{% embed url="<https://youtu.be/hspI1hL-TDA>" %}

Use this behavior to map [Audio Sample](https://axongenesis.gitbook.io/timeflow/reference/behaviors/audio/audio-sample) results to specific properties. Multiple instances of Audio Reactive may be applied throughout the scene to drive animation with audio.

{% hint style="success" %}
To add Audio Reactive, right-click the object in the Timeflow view and select:

#### Add Audio > Audio Reactive > *Select Property*

{% endhint %}

Each Audio Reactive instance has just 1 property mapping, shown as a channel in the Timeflow view. This may be mapped to any numeric or color property on the object, however does not support object or string data types.

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2F2XnKg3TvqJfoUv3ShTMg%2Fimage.png?alt=media&#x26;token=4632cde2-b8f6-448d-8f0d-da2751c55604" alt=""><figcaption><p>An example using Audio Reactive to map to the material emission color.</p></figcaption></figure>

{% hint style="info" %}

### Audio-Reactive vs Midi

Audio-reactive effects are a good way to drive animations using live or dynamically generated audio. However, [Midi](https://axongenesis.gitbook.io/timeflow/reference/behaviors/midi) offers better synchronization overall and greater flexibility for mapping specific instruments and is recommended when it is an option.&#x20;

With midi it is possible to anticipate audio events before they happen, whereas audio-reactive behaviors can only react once audio is detected which may cause some latency. Both methods are viable and can be used at the same time, though when working with pre-recorded audio consider using midi instead of audio-reactive behaviors.

See the section on [Midi](https://axongenesis.gitbook.io/timeflow/reference/behaviors/midi) for further information.&#x20;
{% endhint %}

## Audio Reactive Editor

Select the object to view its settings in the Inspector.

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FVu3gKDjyzz3w5OtWk6fH%2Fimage.png?alt=media&#x26;token=dcfc94f2-5abf-4a66-bf91-cb2e13c88f53" alt=""><figcaption></figcaption></figure>

For common features, please see [Menu Bar](https://axongenesis.gitbook.io/timeflow/user-guide/timeflow-editor/menu-bar) and [Update Settings](https://axongenesis.gitbook.io/timeflow/user-guide/timeflow-editor/update-settings).

### Property Mapping

Click the center button to select a different target property. Only numeric and color properties are supported.&#x20;

## Audio Sample

Reference to the [Audio Sample](#audio-sample) component providing data input to drive the reactive behavior.&#x20;

### Attack

Sets the time in seconds it takes for the value to ramp to full intensity (End Value / Color) from the resting state (Start Value / Color).&#x20;

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FXy0vWPGtTIONwaA1MuJH%2Fimage.png?alt=media&#x26;token=80eaac0c-b646-4789-97c3-a3446bfd6ca7" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
An attack value of 0 means the behavior immediately responds to the audio input and is usually the preferred option. With any value greater than zero, the behavior ramps on more gradually and may introduce latency. &#x20;
{% endhint %}

### Release

This determines how long it takes (in seconds) for the value to return back to its starting value after each spike in audio detected.&#x20;

{% hint style="success" %}
Use release to give behaviors an after glow or to gradually return it back to its resting position. If release is set to 0, the release is immediate causing the behavior to act more like an on/off switch.
{% endhint %}

### Multiply

Scales the overall intensity of reactivity. This is helpful to increase or decrease the overall effect.&#x20;

### Clip

If enabled, amplitude values are clamped between 0 and 1. Otherwise, if disabled, amplitude values are unrestricted and may scale beyond the start and end values.

{% hint style="success" %}
Use clip in situations where you want to strictly adhere to the start and end value (or color) range. Otherwise, disable clip to allow higher intensity values, which may be desired when using HDR colors for glowing effects.&#x20;
{% endhint %}

## Start and End Value / Color

Start determines the resting value (or color) of the target property, and End sets the fully engaged "ON" value when spikes in audio input occur.&#x20;

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FDJ64uF6c14QIz7TZNMsa%2Fimage.png?alt=media&#x26;token=3ebbc06d-e8e9-44b1-acd3-dc38b0d980f5" alt=""><figcaption><p>The property type selected above determines whether a color or value field is displayed.</p></figcaption></figure>

{% hint style="success" %}
Use the multiplier field (\*) to increase or decrease the values. This is especially helpful with colors to adjust intensities without directly changing the color field.
{% endhint %}

{% hint style="info" %}
The start and end values may also be animated using a standard [animation channel](https://axongenesis.gitbook.io/timeflow/reference/behaviors/animation/keyframer) or any [other behaviors](https://axongenesis.gitbook.io/timeflow/reference/behaviors/automation) to change the audio-reactive behavior over time.
{% endhint %}

## Amount

Sets the final blend amount between the start and end values.&#x20;

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2F4LsI3GWYlugGHzydZidN%2Fimage.png?alt=media&#x26;token=0947220d-5f2b-4bbc-82a8-6fa48290cd67" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
Amount is useful to generally decrease intensity of audio-reactive effects and may also be animated to vary the intensity of reactive behavior over time.
{% endhint %}

{% hint style="info" %}
Note that the Amount blend is done before Override.
{% endhint %}

## Chance

This sets a probability factor of 0 to 1. If set to 0.0 no events will fire, whereas if set to 1.0 all events will fire. In between introduces a random probability whether the note will be detected or not.&#x20;

{% hint style="info" %}
Add variation to your audio-reactive visuals using chance to add randomness. This is useful to break up regular beats into less predictable patterns while still remaining in sync.&#x20;
{% endhint %}

## Override

Takes control over the final output value, using the slider to blend with the audio-reactive value.&#x20;

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2F8HrUdDDjglXlaCJY1Ki1%2Fimage.png?alt=media&#x26;token=d6c1de9b-9020-4754-a239-eb7ec03db8aa" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
Use override to influence or overwrite the final output of the audio-reactive behavior. This may useful in situations where an object is only reacting to audio part of the time and at other times controlled by animation or other behaviors.&#x20;
{% endhint %}

## Output Value / Color

Displays a read-only preview of the final output value for references.

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FQIYfwqDMkS9HUN880mTt%2Fimage.png?alt=media&#x26;token=28a87a29-4642-400f-858e-bb32549a5674" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
The final output value of any Audio Reactive behavior may be further processed and mapped to other channels using [Channel Link](https://axongenesis.gitbook.io/timeflow/user-guide/timeflow-view/channel-link).
{% endhint %}
