# Motor fader CV source with presets


# This patch uses the first fader of an M4 to control four different
# CV outputs at O1 ... O4. Select the output with one of the
# four buttons. And use the fader to modify the value.
# 
# Furthermore, there are 6 presets. Dial through the presets with
# the first pot on the P2B8.
# 
# This means that the one fader controls 24 virtual values,
# 4 of which are output to O1 ... O4 at any given time.

# OUTPUTS:
#   O1: [CV1] 
#   O2: [CV2] 
#   O3: [CV3] 
#   O4: [CV4] 

# CONTROLLER 2:
#   P2.1: [PRE] Preset 1 ... 6
#   B2.1: [1] Select output 1
#   B2.2: [2] Select output 2
#   B2.3: [3] Select output 3
#   B2.4: [4] Select output 4

[m4]
[p2b8]

[buttongroup]
    button1 = B2.1
    button2 = B2.2
    button3 = B2.3
    button4 = B2.4
    led1 = L2.1
    led2 = L2.2
    led3 = L2.3
    led4 = L2.4

# -------------------------------------------------
# Faders
# -------------------------------------------------

# I use a copy circuit in order to make this more
# readable. Get the preset number from the pot
# by multiplying its value by 5 and send it through
# a cable to the motorfader circuits.
[copy]
    input = P2.1 * 5
    output = _PRESET

[motorfader]
    fader = 1
    select = L2.1
    preset = _PRESET
    output = O1

[motorfader]
    fader = 1
    preset = _PRESET
    select = L2.2
    output = O2

[motorfader]
    fader = 1
    select = L2.3
    preset = _PRESET
    output = O3

[motorfader]
    fader = 1
    select = L2.4
    preset = _PRESET
    output = O4
