Repository Public
1# Performance Pads23One automation that stays alive for the whole set and gives three pads a job. Pad 1 throws a beat into the echo. Pad 2 plays a one-bar loop roll starting on the next beat. Pad 16 tidies up and ends the automation. It shows trigger handlers, a busy flag, and getting onto the grid from an unquantized event.45## The script67```orixdj8automation "Performance Pads" {9 var rolling = false1011 // Pad 1: echo throw of one beat on the master.12 on trigger(1) {13 fx.echo.time = 1/2beat14 fx.echo.feedback = 0.6515 fx.echo.mix = 0.7516 fx.echo.enable()17 wait 1 beat18 fx.echo.mix = 019 wait 2 bars20 fx.echo.disable()21 }2223 // Pad 2: loop roll on deck A, starting on the next beat, for one bar.24 on trigger(2) {25 if not rolling {26 rolling = true27 wait nextBeat28 deck.A.loop(1 beat)29 wait 2 beats30 deck.A.loopHalve()31 wait 1 beat32 deck.A.loopHalve()33 wait 1 beat34 deck.A.loopExit()35 rolling = false36 }37 }3839 // Pad 16: tidy up and quit.40 on trigger(16) {41 fx.echo.disable()42 if deck.A.looping { deck.A.loopExit() }43 stop44 }45}46```4748## What happens, bar by bar4950| Position | What happens |51| --- | --- |52| Start | Three handlers are registered. The automation waits. |53| Trigger 1 | At once: the master echo is set to half a beat with feedback 0.65 and mix 0.75, and switched on. One beat later the mix returns to 0 so that nothing new enters the echo; the repeats die away for two bars; the echo is switched off. |54| Trigger 2 | If no roll is in progress: wait for the next beat, start a one-beat loop on deck A, halve it after two beats and again after one more, leave the loop one beat later. The roll occupies four beats. |55| Trigger 2 during a roll | Ignored, because `rolling` is true. |56| Trigger 16 | The echo is switched off, a loop on deck A is released if there is one, and the automation stops. |5758## When to use it5960For live performance with a pad controller: start it at the beginning of the set and play the pads. It is also a template: replace the bodies of the handlers with your own moves.6162## Check before running it live6364- Three controls are mapped to the targets `automation.trigger.1`, `automation.trigger.2` and `automation.trigger.16` (or use `trigger 1` in the console to rehearse).65- Deck A is the deck you want to roll, it is playing, and its track has a beat grid.66- The master echo is free to be reconfigured.67- The automation is running before you hit the pads: triggers fired earlier are lost.6869## Notes and variations7071A trigger is handled a few milliseconds after the press, wherever that falls in the bar. The echo throw is meant to be played by ear, so it acts at once. The loop roll must be on the grid, so it starts with `wait nextBeat`.7273Hitting pad 1 again while the echo of a previous throw is still decaying starts a second run of the handler. Both runs write the same controls; the earlier run switches the echo off two bars after *its* throw, which may cut the later one short. Add a busy flag, as for pad 2, if that bothers you.7475After a loop roll the track continues from the loop, so it ends up some beats behind where it would have been.7677The automation never ends by itself. Pad 16, `stop "Performance Pads"` or the emergency stop end it.7879## Related8081- [MIDI Integration](../midi.md)82- [Events](../events.md)83- [Variables](../variables.md)84- [Effects Commands](../effects-api.md)85- [Examples](README.md)86