Creating Audio with CHOPs

From Derivative
Jump to navigation Jump to search

Introduction
[edit]

Audio is managed with CHOPs in TouchDesigner. CHOPs can generate sounds and can read sounds into TouchDesigner from external sources. Audio can be generated, played from audio files, filtered, mixed and recorded.

The ways to obtain audio in CHOPs include: from files, movies, microphones or line in. These are described in detail in the section below. To hear audio output from CHOPs, send the audio to an Audio Device Out CHOP.

For example, the Audio Oscillator CHOP can generate a constant-frequency audio signal. The Trigger CHOP takes an on-off control from TouchDesigner, and generates a volume envelope with a delay, attack, decay, sustain and release transition that can multiplied with an audio CHOP with a Math CHOP controlling its loudness. The Math CHOP and Audio Dynamics CHOP act as a mixer and the Audio Para EQ CHOP filters the spectrum of audio.

Quick Audio Startup
[edit]

To quickly get audio going, try the following: File:Audio with CHOPS ex.tox

  • Connect a default LFO CHOP to a default Audio Oscillator CHOP.
  • Connect the Audio Oscillator CHOP to an Audio Device Out CHOP.
  • You should hear a rising and falling tone.
  • Connect the LFO CHOP to a new Audio Oscillator CHOP and set the oscillator's Base Frequency to 330.
  • Connect the two Oscillators to a Merge CHOP. Connect the Merge CHOP to the Audio Device Out CHOP. You should hear one oscillator in each left and right channels.

Next use an Audio File In CHOP as a sound source, connecting it to the Audio Device Out CHOP.

Loading Audio
[edit]

Audio File In CHOP - loads audio from a file as it plays. This method of streaming uses very little memory as it only loads the samples of audio it needs at the time, ideal for large audio files. The CHOP channels created are time-sliced.

Audio Movie CHOP - loads the audio track from a movie that has been loaded into a Movie File In TOP. Playback is controlled from Movie File In TOP. The CHOP channels created are time-sliced.

File In CHOP - loads the entire audio file into CHOPs. The audio is loaded into CHOPs at the sample rate of the audio file. The higher the sample rate, the more memory CHOPs will use to load the audio. The channels created are not time-sliced. When completely loaded into CHOPs, it is easy to manipulate the audio downstream with additional Filter CHOPs; stretch, splice, pitch, volume, etc. Care must be taken running real-time systems with large audio files and high sample rates, as CPU usage for these operations is very high.

Audio Device In CHOP - streams audio into TouchDesigner from any audio input device attached to the computer. The CHOP channels created are time-sliced.

Audio Play CHOP - plays back a sound file directly to the audio output device. Great for simple triggering of sounds. Plays back just a single file or selects from a list of files stored in a DAT list. Can also be triggered using the Tscript audioplay Command. Audio is not passed further down the CHOP network.


Scrub Controls
[edit]

When using a Audio File In CHOP, audio can be cued or scrubbed at least 3 ways:

  • Audio File In's parameter Play Mode must first be set to Sequential. Select a Cue Point and press Cue Pulse.
  • Audio File In's parameter Play Mode must first be set to Specify Index. using the Index parameter. Turn off the Repeat parameter to stop audio buzzing when not scrubbing.
  • When using the Audio Movie CHOP, scrubbing the audio can be done through the Movie File In TOP which is referenced. As the movie playback is scrubbed, the audio will follow.

Using a File In CHOP, audio can be scrubbed by scrubbing TouchDesigner's main Timeline throughout the frame range of the File In CHOP.

Repeating Audio
[edit]

When using an Audio File In CHOP, set the Repeat parameter to On.

Using a File In CHOP, which statically loads the entire audio file, you can set the Extend Left and Extend Right parameters to Cycle.

Audio Play CHOPs need to be repeatedly triggered to repeat the audio.

TouchDesigner Audio Output Volume
[edit]

The Audio Device Out CHOP sets the overall output level to the speakers. This is sent to the volume controls in Windows.

Outputting Audio to a File
[edit]

You can output the audio in any CHOP using the RMB menu on the CHOP. Select Save Data Channels in the menu and hit the arrow button to see the file format suffixes that can be used on your output files, such as .aif. You can check the file by playing it with VLC or QuickTime or another audio player.

Note, the CHOP may be time-sliced, in which case you will need to first record it into a Record CHOP or Trail CHOP.

Modifying Audio
[edit]

When you are processing an audio clip by reading the whole file into an File In CHOP:

3D Audio
[edit]

CHOPs can take events from a 3D scene, imported through the SOP to CHOP or Object CHOP, and be used to trigger sounds and control the placement of sounds in 3D space.

An object, particle, or point position in 3D space can be used to set the left-right ear separation, or used as reverb controls which add a cue that simulates proximity of the sound.

Audio can be generated for offscreen objects, adding more 3D cues and realism.

Filter Animation Channels