User Tools

Site Tools


macros:example:dummyspeedascondition

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

macros:example:dummyspeedascondition [2018/09/08 17:23] (current)
icke_siegen created
Line 1: Line 1:
 +Example
  
 +====== Dummy speed as condition ======
 +
 +^ by: | Kim Wida, February 2018 |
 +^ published: | http://​forum.avolites.com/​viewtopic.php?​f=20&​t=5584 |
 +^ description:​ | example of how to use a dummy playback speed as step condition |
 +
 +{{tag>​dummy step condition toggle}}
 +
 +==== functions ====
 +  * [[:​macros:​function:​ActionScript.SetProperty]]
 +  * [[:​macros:​function:​Handles.SetSourceHandleFromHandle]]
 +  * [[:​macros:​function:​Math.IsEqual]]
 +  * [[:​macros:​function:​Profiles.AssignHandleProfile]]
 +  * [[:​macros:​function:​Handles.SetLegend]]
 +  * [[:​macros:​function:​Handles.ClearSelection]]
 +
 +==== affected properties ====
 +  * [[:​macros:​property:​Playbacks.Editor.SelectedPlayback]]
 +  * [[:​macros:​property:​Playbacks.Editor.Times.PlaybackSpeed]]
 +  * [[:​macros:​property:​Handles.PendingLegend]]
 + 
 +==== control structures ====
 +  * conditional steps, see [[macros:​control_structures|]]
 + 
 +===== Code =====
 +<code xml>
 +<step pause="​0.01">​ActionScript.SetProperty("​Playbacks.Editor.SelectedPlayback",​ handle:"​chaseHandleUN=1049"​)</​step>​
 +<step pause="​0.01">​Handles.SetSourceHandleFromHandle("​chaseHandleUN=1049"​)</​step>​
 +<​step>​ { if ( Math.IsEqual(Playbacks.Editor.Times.PlaybackSpeed,​ 60.0) ) 
 +        { Profiles.AssignHandleProfile(handle:"​chaseHandleUN=19162",​493461);​ }
 +      else
 +        { Profiles.AssignHandleProfile(handle:"​chaseHandleUN=19162",​493448);​ }
 +      } </​step>​
 +<​step>​ { if(Math.IsEqual(Playbacks.Editor.Times.PlaybackSpeed,​ 60.0) )
 +         { ActionScript.SetProperty("​Handles.PendingLegend",​ "​Instant"​);​ }
 +       else
 +         { ActionScript.SetProperty("​Handles.PendingLegend",​ "​Latch"​); ​ }
 +      } </​step>​
 +<​step>​ { if(Math.IsEqual(Playbacks.Editor.Times.PlaybackSpeed,​ 60.0) )
 +        { ActionScript.SetProperty("​Playbacks.Editor.Times.PlaybackSpeed",​ 30.0); }
 +      else
 +        { ActionScript.SetProperty("​Playbacks.Editor.Times.PlaybackSpeed",​ 60.0); }
 +       } </​step>​
 +<step pause="​0.01">​Handles.SetLegend()</​step>​
 +<step pause="​0.01">​Handles.ClearSelection()</​step>​
 +</​code>​
 +
 +
 +===== Explanation =====
 +
 +  * The chase with usernumber 1049 is used as dummy, its speed is used as contions for the next steps
 +  * if the speed is 60 BPM then another chase'​s profile is set to a certain profile, else it is set to another profile
 +  * if the speed is 60 BPM then the dummy'​s legend is set to '​Instant',​ else it is set to '​Latch'​
 +  * if the speed is 60 BPM then the speed is set to 30 BPM, else it is set to 60 BPM (the classic toggle)
 +
 +This is not operational within itself but a good example for some special syntax.
 +
 +~~DISCUSSION~~
macros/example/dummyspeedascondition.txt ยท Last modified: 2018/09/08 17:23 by icke_siegen