macros:example:halvechasespeed
This is an old revision of the document!
Table of Contents
Example
Halve chase speed
by: | Gregory Haynes, Feb 2016 |
---|---|
published: | http://forum.avolites.com/viewtopic.php?f=20&t=3744#p15848 |
description: | halves currently chase's BPM rate |
remarks: | The problem with this code is that it requires the chase to be set as the selected playback in the editor (used for the Edit Times menu). This means that the Playback View which could be showing a cue list switches to show the chase instead, to get around this I have stored the previous selected playback and restore that afterwards but this does cause the display to flicker. |
functions
affected properties
This macro works perfectly well in Titan 9.1, does misbehave in 10.0 (always sets speed to 0 BPM), and throws an error in 10.1 (variable not registered).
Code
- halvechasespeed.xml
<?xml version="1.0" encoding="utf-8"?> <avolites.macros xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Avolites.Menus.xsd"> <macro name="Chase Speed Half" id="Avolites.Macros.ChaseSpeedHalf"> <description>Halves the speed of the currently connected chase.</description> <sequence> <step>ActionScript.SetProperty("Handles.SourceHandle", Playbacks.Editor.SelectedPlayback)</step> <step>ActionScript.SetProperty("Playbacks.Editor.SelectedPlayback", Chases.ConnectedHandle)</step> <step>ActionScript.SetProperty.Float("Playbacks.Editor.Times.ChaseSpeed", Playbacks.Editor.Times.ChaseSpeed / 2)</step> <step condition="Math.IsLessThan(Playbacks.Editor.Times.ChaseSpeed, 1.0)">ActionScript.SetProperty.Float("Playbacks.Editor.Times.ChaseSpeed", 0.0)</step> <step>ActionScript.SetProperty("Playbacks.Editor.SelectedPlayback", Handles.SourceHandle)</step> </sequence> </macro> </avolites.macros>
Explanation
This explains the functional steps within the sequence. For all the other XML details please refer to Formats and syntax
ActionScript.SetProperty(“Handles.SourceHandle”, Playbacks.Editor.SelectedPlayback)
temporarily stores the currently selected playback into 'Handles.SourceHandle' from where it will be retrieved when the macro is finished, see Gregory's explanation aboveActionScript.SetProperty(“Playbacks.Editor.SelectedPlayback”, Chases.ConnectedHandle)
this selects the currently connected chaser for editingActionScript.SetProperty.Float(“Playbacks.Editor.Times.ChaseSpeed”, Playbacks.Editor.Times.ChaseSpeed / 2)
sets the speed of the chaser to its half<step condition=“Math.IsLessThan(Playbacks.Editor.Times.ChaseSpeed, 1.0)”>ActionScript.SetProperty.Float(“Playbacks.Editor.Times.ChaseSpeed”, 0.0)</step>
if the speed is less than 1.0: sets speed to 0.0ActionScript.SetProperty(“Playbacks.Editor.SelectedPlayback”, Handles.SourceHandle)
restores the selected playback from before the macro was run
How to use it
This macro works perfectly well in Titan 9.1, does misbehave in 10.0 (always sets speed to 0 BPM), and throws an error in 10.1 (variable not registered).
- with a chase running and connected (Speed and Cross Fade on the wheels), triggering this macro halves the speed of the chase
You could leave a comment if you were logged in.
macros/example/halvechasespeed.1511344035.txt.gz · Last modified: 2017/11/22 09:47 (external edit)