Designer Plugins
Plugins for Disguise Designer software.
Plugins for Disguise Designer software.
This guide provides an overview of how to use the Disguise Python API to manage and interact with audio.
An AudioTrack is a resource that represents an audio file in the timeline.
| Task | Python |
|---|---|
| Get audio file | audio_file = audio_track.audioFile Returns an AudioFile object. |
| Get audio header | header = audio_track.header Returns an AudioInfo object. |
An AudioFile resource contains information about a specific audio file.
| Task | Python |
|---|---|
| Get audio header | header = audio_file.header Returns an AudioInfo object with details like sample rate and bit depth. |
The AudioAnalyser is a device that provides real-time analysis of an audio signal.
| Task | Python |
|---|---|
| Get audio lines | lines = audio_analyser.lines Returns a list of AudioLine objects. |
Volume for sequenceable objects like layers is controlled via keyframes. To set a static value, you typically set the value of the first keyframe.
audio_layer = next((l for l in guisystem.track.layers if l.name == "MyAudioLayer"), None)
if audio_layer:
vol_seq = audio_layer.findSequence("volume")
if vol_seq:
vol_seq.disableSequencing = False
key_seq = vol_seq.sequence
if key_seq:
# Set a keyframe at time 0.0 seconds
key_seq.setFloat(0.0, 0.5)
transport = guisystem.currentTransportManager
transport.volume = 0.8
t_vol_layer = next((l for l in guisystem.track.layers if l.name == "TransportVolumeLocal"), None)
if t_vol_layer:
vol_seq = t_vol_layer.findSequence("volume")
if vol_seq:
vol_seq.disableSequencing = False
key_seq = vol_seq.sequence
if key_seq:
# Set a keyframe at time 0.0 seconds
key_seq.setFloat(0.0, 1.0)
You can animate audio properties, such as the volume of an Audio layer, using keyframes. This follows the same pattern as other sequenceable properties in Disguise (see Track and Sequencing).
An AudioLine represents a single line of audio analysis data. This is often used for frequency analysis (e.g., getting bass, mid, treble levels).
| Task | Python |
|---|---|
| Example Expression | audioline:name.c[range] This is used in expressions to get frequency data. For example, audioline:my-audio.c[0] might give you the bass level. |
You can access audio-related components from the main system object.
| Task | Python |
|---|---|
| Get audio output device map | audio_out_map = system.audioOut Returns an AudioOutDeviceMap2 object for managing audio outputs. |
| Get all audio tracks | tracks = system.audioTracks Returns a list of all AudioTrack objects in the project. |
| Check if video has audio | has_audio = video_clip.hasAudio Returns True if a VideoClip resource has an embedded audio track. |
| Reset audio system | system.resetAudio() Resets the audio engine. |
# Find the logical device to map by iterating and checking its description
logical_device = next((d for d in system.audioOut.outputs if d.description == "L-Acoustics P1"), None)
if logical_device:
# Find the physical machine output to map to
machine_output = next((o for o in system.machines[0].audio.outputs if o.description == "Dante PCIe RX (machine-name)"), None)
if machine_output:
patch = logical_device.patch
patch.device = machine_output
patch.channel = 0 # e.g., Left channel
Maps the named logical device to a named physical output.