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 transports. Transports are the systems that allow Disguise to be controlled by external signals like timecode, MIDI, and OSC.
The TransportManager is the central hub for managing all transport-related activities in a Disguise project. There is one main transport manager that can be accessed from the guisystem object.
| Task | Python |
|---|---|
| Get the main Transport Manager | transport_manager = guisystem.currentTransportManager |
| Get the current track | current_track = transport_manager.track |
| Get the current play mode | play_mode = transport_manager.play_mode |
| Get the timecode transport | timecode_transport = transport_manager.timecode |
| Get local event transports | local_transports = transport_manager.local_transportsReturns a list of EventTransport objects for local signals. |
| Get remote event transports | remote_transports = transport_manager.remote_transportsReturns a list of EventTransport objects for remote signals. |
The TimecodeTransport object provides information about the current timecode signal.
| Task | Python |
|---|---|
| Get the current timecode receiver | current_timecode = timecode_transport.timecode |
| Get the timecode status | status = timecode_transport.statusString |
| Get the timecode frame rate | fps = timecode_transport.SMPTE_clock_type NOTE only works with SMPTE (LTC) timecode type |
Event transports handle signals from protocols like OSC and MIDI. You can iterate through the local_transports and remote_transports lists to find the specific transport you need.
This example shows how to find an OSC transport and get its properties.
| Task | Python |
|---|---|
| Find an OSC transport | osc_transport = next((t for t in transport_manager.remote_transports if isinstance(t, EventTransportOSC)), None) |
| Get the OSC transport’s play string | play = osc_transport.playNote: This assumes you have found an OSC transport. |
if osc_transport:
for output in osc_transport.outputs:
print("Address: {}, Expression: {}".format(output.address, output.expr.expression))
The following static methods are available on the TransportCommand class to trigger transport actions programmatically:
In each case, the transport_manager is the target transport manager the command is sent to, and source should always be set to state. Other sources are used internally to perform filtering and logging.
| Command Type | Python Example |
|---|---|
| Jump to a specific frame | command = TransportCommand.makeJumpToFrame(source, transport_manager, tFrame) |
| Jump to a specific time (seconds) | command = TransportCommand.makeJumpToTime(source, transport_manager, tSec) |
| Jump to a specific beat | command = TransportCommand.makeJumpToBeat(source, transport_manager, tBeat) |
| Set the play mode | command = TransportCommand.makePlayMode(source, transport_manager, mode) |
| Set the transport speed | command = TransportCommand.makeSetSpeed(source, transport_manager, speed) |
| Set the transport brightness | command = TransportCommand.makeBrightness(source, transport_manager, brightness) |
| Set the transport audio volume | command = TransportCommand.makeVolume(source, transport_manager, volume) |
| Jump to a relative frame | command = TransportCommand.makeNudgeFrame(source, transport_manager, deltaFrame) |
| Jump to a relative beat | command = TransportCommand.makeNudgeBeat(source, transport_manager, deltaBeat) |
| Jump to a relative section | command = TransportCommand.makeNudgeSection(source, transport_manager, deltaSection) |
| Jump to a relative track | command = TransportCommand.makeNudgeTrack(source, transport_manager, deltaTrack) |
| Jump to a specific cue | command = TransportCommand.makeJumpToCue(source, transport_manager, xx, yy, zz, cueMode) |
Important note: Commands do not do anything by themselves. They need to be created and then added to the target transport manager for execution: transport_manager.addCommand(command). It is critical that the transport_manager parameter to the command is the same transport_manager the command is executed on.
TransportCommand.makeJumpToMidiNote(source, transport_manager, search_channel_1, search_channel_2, note, cue_mode)
Jumps to the given MIDI note. Returns None if the note is not found as a valid trigger.
TransportCommand.makeJumpToCue(source, transport_manager, xx, yy, zz, cue_mode)
Jumps to the given cue. Returns None if the cue is not found.