# LFO Motor Bank

# This patch implements a bank of four independent LFOs that
# are controlled by four motor faders. For each LFO you can set
# the speed, the level, wether it should be bipolar or unipolar and
# the waveform.
# 
# Also there are 6 presets that can be changed with a knob.
# 
# This circuit illustrates the use of the fadermatrix circuit.
# the four LFOs with the parameters speed, level, bipolar
# and waveform form a 4X4 matrix. With the eight buttons
# you can either select one "row" - i.e. one of the LFOS -
# and control all of its four parameters. Or you can select
# one "column" and control one parameter - e.g. the level -
# for all four LFOs at once.

# INPUTS:
#  I1: [TRG1]
#  I2: [TRG2]
#  I3: [TRG3]
#  I4: [TRG4]

# OUTPUTS:
#  O1: [ENV1]
#  O2: [ENV2]
#  O3: [ENV3]
#  O4: [ENV4]

# CONTROLLER 4:
#  B4.1: [1] LFO 1
#  B4.2: [A] Attack
#  B4.3: [2] LFO 2
#  B4.4: [D] Decay
#  B4.5: [3] LFO 3
#  B4.6: [S] Sustain
#  B4.7: [4] LFO 4
#  B4.8: [R] Release

[s10]
[m4]
[m4]
[p2b8]

# -------------------------------------------------
# Buttons, Faders
# -------------------------------------------------

[buttongroup]
    button1 = B4.1
    button2 = B4.3
    button3 = B4.5
    button4 = B4.7
    button5 = B4.2
    button6 = B4.4
    button7 = B4.6
    button8 = B4.8
    led1 = L4.1
    led2 = L4.3
    led3 = L4.5
    led4 = L4.7
    led5 = L4.2
    led6 = L4.4
    led7 = L4.6
    led8 = L4.8
    output = _ROWCOLUMN

[fadermatrix]
    rowcolumn = _ROWCOLUMN
    ledcolor1 = 0.2
    ledcolor2 = 0.4
    ledcolor3 = 0.6
    ledcolor4 = 0.8
    output11 = _ATTACK_1
    output12 = _DECAY_1
    output13 = _SUSTAIN_1
    output14 = _RELEASE_1
    output21 = _ATTACK_2
    output22 = _DECAY_2
    output23 = _SUSTAIN_2
    output24 = _RELEASE_2
    output31 = _ATTACK_3
    output32 = _DECAY_3
    output33 = _SUSTAIN_3
    output34 = _RELEASE_3
    output41 = _ATTACK_4
    output42 = _DECAY_4
    output43 = _SUSTAIN_4
    output44 = _RELEASE_4

# -------------------------------------------------
# Envelopes
# -------------------------------------------------

[contour]
    gate = I1
    attack = _ATTACK_1
    decay = _DECAY_1
    sustain = _SUSTAIN_1
    release = _RELEASE_1
    output = O1

[contour]
    gate = I2
    attack = _ATTACK_2
    decay = _DECAY_2
    sustain = _SUSTAIN_2
    release = _RELEASE_2
    output = O2

[contour]
    gate = I3
    attack = _ATTACK_3
    decay = _DECAY_3
    sustain = _SUSTAIN_3
    release = _RELEASE_3
    output = O3

[contour]
    gate = I4
    attack = _ATTACK_4
    decay = _DECAY_4
    sustain = _SUSTAIN_4
    release = _RELEASE_4
    output = O4

# -------------------------------------------------
# LFO
# -------------------------------------------------

[lfo]
    hz = 1
    square = G11
