SPB Git

Repository Public

crossfader-chop.md 2.9 KB 72 lines markdown

1# Crossfader Chop23A transformer-style cut between two decks: for two bars the crossfader jumps between the A side and the B side on a sixteenth-note pattern written as an array of 0 and 1. The crossfader position and curve are remembered and put back. It shows reading settings into `let`, a text parameter, and a pattern loop.45## The script67```orixdj8automation "Crossfader Chop" quantize bar {9    // 1 = deck B audible, 0 = deck A audible. Sixteen steps of a quarter beat = one bar.10    let pattern = [0, 0, 1, 0,  0, 0, 1, 1,  0, 1, 0, 0,  1, 0, 1, 1]11    let home = mixer.crossfader12    let homeCurve = mixer.curve1314    if not deck.B.loaded {15        print("Load a track on deck B first.")16        stop17    }18    if not deck.B.playing {19        deck.B.sync(true)20        deck.B.play()21    }2223    mixer.curve = "cut"24    repeat 2 {25        for side in pattern {26            mixer.crossfader = side27            wait 1/4beat28        }29    }30    mixer.crossfader = home31    mixer.curve = homeCurve32}33```3435## What happens, bar by bar3637| Position | What happens |38| --- | --- |39| Before bar 1 | The automation waits for the next bar line. If deck B is empty it prints a message and stops. |40| Bar 1, beat 1 | The crossfader position and curve are remembered. If deck B is not playing, it is synced and started. The crossfader curve is set to "cut". |41| Bars 1 and 2 | Every quarter beat the crossfader goes to the side given by the pattern: 0 is the A side, 1 is the B side. The sixteen-step pattern is played twice. |42| Bar 3, beat 1 | The crossfader returns to where it was and the curve is restored. The automation finishes. |4344## When to use it4546When two tracks are playing in sync and you want to tease the incoming one, or as a fill at the end of a phrase. It needs both decks on opposite sides of the crossfader.4748## Check before running it live4950- Deck A is assigned to the A side of the crossfader and deck B to the B side, with both channel faders up.51- Deck B is loaded. If it is not playing, the script starts it at its current position: cue it first.52- Both tracks have an analysed tempo so that they stay in time.53- You are happy for the crossfader to end where it was at the start, typically on the A side or in the centre.5455## Notes and variations5657With the "cut" curve, a deck is fully on or fully off at the ends of the crossfader, so the jumps are clean cuts. The previous curve is read with `mixer.curve` and restored at the end.5859The pattern is easier to edit when written in groups of four, one group per beat. Extra spaces inside an array are ignored.6061If you move the crossfader by hand during the two bars, the script overrides it at the next step.6263To cut the fader of one deck instead of switching between two, see the preset "Stutter Cut".6465## Related6667- [Loops](../loops.md)68- [Mixer Commands](../mixer-api.md)69- [Variables](../variables.md)70- [Presets](../presets.md)71- [Examples](README.md)72
Files main
Menu

Theme