Skip to content

Percussive parameter control

In this recipe, we'll create a page that lets us control 64 parameters at once, depending on how hard we strike the control.

We'll target the first eight parameters of the first device of the tracks inside the session ring.

Instructions

First, create the matrix section. In this example, we'll make it 8x8 and call it velocity_params, but you can make it any size and choose any name.

matrix_sections.yaml
velocity_params:
  row_start: 0
  row_end: 7
  col_start: 0
  col_end: 7

Create the file matrix_sections/velocity_params.yaml. We'll use a whole-section group for this recipe, so create it like so:

matrix_sections/velocity_params.yaml
pad_group: velocity_params

For LED feedback, we'll use the param control. The param control has a mandatory binding option: the parameter we want to control.

matrix_sections/velocity_params.yaml
pad_group: velocity_params
type: param
binding: RING(${me.x}) / DEV(1) B1 P${me.Y}

Inside the RING() part, we're using a template string and referencing each control's x property to associate each column with each track of the session ring. We're using the Y property to associate each row with a parameter on the first device of that track.

Because we're targeting the session ring, we use a special syntax combined with the Bb Pp parameter.


This works, but it will only toggle each parameter between its minimum and maximum.

matrix_sections/velocity_params.yaml
pad_group: velocity_params
type: param
binding: RING(${me.x}) / DEV(1) B1 P${me.Y}
toggle_param: false
midpoint: 50.0
gestures:
  press: >
    "${ring.tracks[me.x]}" / DEV(1) B1 P${me.Y} ${me.velps}%

We have set toggle_param to false, disabling the default behaviour of the param control. We've also set a midpoint of 50.0, meaning the control will be colored when the parameter is at its middle value or higher, and grey when below.

By using the velps property, we are capturing the velocity of the last press, scaled according to the control's threshold.

Striking the row third from the top with average force will produce an output like:

"my track" / DEV(1) B1 P3 56.3%

Ramping

We can easily add another gesture to ramp the parameter over a number of beats. Let's change the press gesture to short_press, and add a long_press gesture, giving us different actions for a short and long press:

matrix_sections/velocity_params.yaml
pad_group: velocity_params
type: param
binding: RING(${me.x}) / DEV(1) B1 P${me.Y}
toggle_param: false
midpoint: 50.0
gestures:
  short_press: >
    "${ring.tracks[me.x]}" / DEV(1) B1 P${me.Y} ${me.velps}%
  long_press: >
    "${ring.tracks[me.x]}" / DEV(1) B1 P${me.Y} RAMPS 1B ${me.velps}%

Now, after a long press, the parameter will ramp to the target velocity over one bar.

Final output

matrix_sections.yaml
velocity_params:
  row_start: 0
  row_end: 7
  col_start: 0
  col_end: 7
matrix_sections/velocity_params.yaml
pad_group: velocity_params
type: param
binding: RING(${me.x}) / DEV(1) B1 P${me.Y}
toggle_param: false
midpoint: 50.0
gestures:
  short_press: >
    "${ring.tracks[me.x]}" / DEV(1) B1 P${me.Y} ${me.velps}%
  long_press: >
    "${ring.tracks[me.x]}" / DEV(1) B1 P${me.Y} RAMPS 1B ${me.velps}%