Automation Getting Started Guide
Quick example:
- Install the Automation Quark and run below example code. This should open a GUI window with buttons and sliders.
- Click '[ô]' (record a snapshot of all current slider levels)
- Click 'O' (enable live recording, goes orange)
- Click '>' (play button), the time slider on the top moves.
- Do crazy motion on any sliders (record them, record button goes red).
- Click '<<' (rewind button), sliders repeat recorded motion.
- Grab a moving slider (overwrite previous recording).
- Click 'O' (disable recording), playing continues.
- Click '<<' (rewind again), enjoy watching your recording. If you grab sliders now, it doesn't affect the recorded values.
- Click '||' to stop playing, if you wish.
- Click '^', enter a writable directory and hit Return. (current slider recordings are saved to that directory)
- Restart your computer ;) (just for illustration)
- Relaunch below code, click '...', enter the same path as above and hit Return. (previous values are loaded from disk)
- Click '>' (play) and enjoy watching your previous slider motion.
- Go to the path as above and swap two files' names. Load again and observe that the sliders swap their motion. ;)
From the default Quarks directory:
If you'd like to use your local git checkout at e.g.'~/git/Automation' instead:
To remove:
You need at least one Automation class instance, where you register sliders (etc.) as desired. Every slider (etc.) is registered with a distinct name (for saving its recorded values to a file).
By "sliders", I also mean buttons and number boxes, and any controllable things as defined by AutoClient. It doesn't necessarily have to be GUI elements.
The Automation Control GUI, explained in detail:
- Click the play button (marked '>') and the time slider starts moving. This starts the automation for all the clients. The play button hence becomes the stop (or pause) button (marked '\|\|').
- The rewind button '<<' seeks the beginning (zero seconds). If the rewind button is clicked during play, playing resumes from the start. If you were recording any sliders, though, they will stop recording and go back to being "ready" for recording (read on...). You can set control.doStopOnSeek = true to stop transport on each seek.
- When you click the record button (marked 'O'), this tells all the sliders to be "ready" for recording. Sliders will only actually start recording as soon as you first adjust their value.
If recording is enabled, the recording button becomes orange. As soon as any one slider is adjusted, the recording button becomes red, to show that something is actually recording.
Recording, naturally, overwrites any previously recorded values within the time span of recording. The last value of the recording will remain up until another recorded value comes up, regardless.
You can also record a slider's momentous value without playing. Seek a position, enable recording (orange) and then move a slider (red). Disable recording (grey). You have set one single value.
If you move the time slider or rewind during recording, all sliders are reset to only being "ready" for recording (orange). Note that play/stop does effectively NOT change recording states, so, while recording, you can just pause the timing to grab a restless slider and calmly adjust it before resuming play.
- The snapshot button (marked '[ô]') records an instant value of *all* subscribed sliders at the current time. That's useful, for example, to set an initial level for time zero for all sliders. Or you might have played around with some sliders and don't want to nudge every single one to record the current values.
Snapshots work both while stopped, during playback and while recording. Taking a snaphot while recording will not start (or stop) prolonged recording for all sliders, it will just record one value per client.
- The save button (marked '^') opens a small window, for you to enter the name of a directory. The different sliders' stored values will be saved in files within that directory, with corresponding names. Any directories will be created if missing (TODO: only works on systems with a '/' path separator).
Files are never overwritten: If files already exist, they are renamed to remain as backup.
Saving also works during play or recording. If you have to.
- The load button (marked '...') opens a small window for you to enter a directory name that you previously saved controls in. Each subscribed slider will try to find a file with its name. Loading also works while playing or recording. Loading values stops any recording and resets to "ready" for recording.
- Moving the time slider seeks automation control to that position. If you were recording any sliders, though, they will stop recording and go back to being "ready" for recording (record button goes orange).
Moving the time slider affects the client GUIs both during play and when stopped.
- There also is a time number box, which always displays the current control time in seconds. If you enter a new number and hit enter, Automation will seek to that position.
- If a slider seems to take a random value at each rewind, it's probably because you haven't recorded a starting value for it. (The slider keeps its previous level, might seem "random".) Each recorded value acts from its time on up to either the next recorded value comes up, or to infinity if there is none. It doesn't act before its time. So, you need to stop transport, rewind, and a) put everything in its initial state and take a snapshot of everything ("[ô]" button), or b) enable recording ("O" button) and set each GUI element separately. Each one of them needs to be *changed* for its recording to catch on. So even if it's at the proper level already, wobble it. This allows to keep some sliders out of Automation control even though you automatically docked everything you could find.
- You need to *first* set up a slider's action, and *then* dock it to Automation. Not the other way around. If you set a slider's action *after* it was docked, you have half un-docked it in a bad way. If you really need to change an action, set the respective AutoClient's action instead (an AutoClient takes the action off a slider and puts itself inbetween). You can find an AutoClient by name in the Automation.clients list.