Modifiers - FunkybotsEvilTwin/CSIUserGuide GitHub Wiki

Modifiers are a way to indicate that you want one control to perform different actions under different circumstances. For example, this could be when another button is pressed in combination with the control (like your keyboard behaving differently when you hold the Shift key down), or it could be when a button is held down for a longer period of time.

The full list of available modifiers is:

Global Modifiers

To avoid creating dependencies between zone files (where a control specified in one is referenced in another), there are a set of global modifiers available:

  • Shift
  • Option
  • Control
  • Alt

In your Surface.txt file you can name one or more controls on your surface with whichever of these you wish to use:

Widget Shift
	Press 90 46 7f 90 46 00
WidgetEnd

Widget Option
	Press 90 47 7f 90 47 00
WidgetEnd

Widget Control
	Press 90 48 7f 90 48 00
WidgetEnd

Widget Alt
	Press 90 49 7f 90 49 00
WidgetEnd  

Now you can use them like this in any of your zone files, but for consistency, we should all put our modifiers in the Home Zone.

Zone Home
 	Shift Shift
        Option Option
        Control Control
        Alt Alt

 	Save Reaper 40026
	Shift+Save Reaper 40022

	Undo Reaper 40029
	Shift+Undo Reaper 40030
ZoneEnd

Additionally, any widget can be defined to act as a modifier...

Zone Home
 	Zoom            Shift
	Rewind 		Rewind
	Shift+Rewind	Reaper 40042	//go to start of project
ZoneEnd

...In the above example, the Zoom widget was defined within the zone to act as the Shift modifier. That Shift modifier can then be combined with other widgets like the Rewind button to trigger additional actions. In this case, pressing Zoom+Rewind will return to the start of the project.

Modifiers are global to a page, and as long as they are defined in a zone somewhere in that page, they can be used anywhere.

Local Modifiers

You can configure any Global Modifiers to impact only the local surface by setting up "Local Modifiers" by using the ToggleUseLocalModifiers action.

Latching Modifiers

If your surface sends release messages on button press, then you can do a quick press and release to "latch" a modifier. Example: let's say you want to use a few actions that require a Shift modifier. Quickly pressing and releasing the Shift button will engage the latch mode, which is the same as continuing to hold down the Shift button. A quick press and release turns the latching off.

Chaining Multiple Modifiers

You're not limited to one modifier like Shift or Control or Alt. You can combine them to add additional capabilities to your surface. Here are some examples of what that might look like...

Shift+Control+Button
Control+Alt+Button
Shift+Control+Alt+Button
Shift+Control+Alt+Option+Button

Modifiers Work on Displays Too!

Did you know that you can use modifiers on your displays? Here is an example where the lower displays show the track volume, until you hold down Shift, when the TrackPans are displayed.

     DisplayLower|                      TrackVolumeDisplay
     Shift+DisplayLower|                MCUTrackPanDisplay

Built-in Modifiers

Touch

Touch messages can be used to tell CSI "when I'm touching this parameter, do this other thing." But Touch is a special kind of modifier in that a few things need to exist for it to work.

First, you need a control surface that's capable of sending Touch and Touch Release messages for a given control. Examples: fader touch messages on an MCU device, rotary touch messages on a Eucon surface, or an OSC parameter set to work with touch messages. If you have a surface that supports touch message for certain controls, you need to define the touch messages in your Surface.txt files. Here is an example using an MCU's fader1.

Widget Fader1
	Fader14Bit e0 7f 7f
	FB_Fader14Bit e0 7f 7f
	Touch 90 68 7f 90 68 00
WidgetEnd

Next, you will need to actually create the touch modifier in your .zon file.

Touch+DisplayLower1

Which in the context of a SelectedTrack zone could allow us to do something like this where the track pan display always appears on the lower display, unless you're actually touching the fader, at which point, the track volume display will appear in the lower display.

Zone SelectedTrack
     DisplayUpper1                      TrackNameDisplay
     DisplayLower1                      TrackPanDisplay
     Touch+DisplayLower1                TrackVolumeDisplay
     Fader1                             TrackVolume
ZoneEnd

Touch modifiers also work in a Track context if you want all channels in the .zon to respond similarly. Here's the same zone as above just in a Track zone.

Zone Track
     DisplayUpper|                      TrackNameDisplay
     DisplayLower|                      TrackPanDisplay
     Touch+DisplayLower|                TrackVolumeDisplay
     Fader|                             TrackVolume
ZoneEnd

Similarly, Touch can be used in other .zon files/types, including fx.zon's!

InvertFB

InvertFB (Invert Feedback) is useful in instances where you want to improve the feedback behavior of actions that report their state the opposite of how you'd expect. Example: these SWS/S&M actions will light a button in CSI if there is no FX in one of the 8 slots assigned to the MCU function buttons. Using the InvertFB modifier, the lights are off if 1) the FX is bypassed, or 2) if the FX slot is empty. This is the opposite of how these actions report their feedback state by default.

Zone Home 

// Function Buttons
    InvertFB+F1                 Reaper _S&M_FXBYP1          // SWS/S&M: Toggle FX 1 bypass for selected tracks
    InvertFB+Shift+F1           Reaper _S&M_FXBYPALL        // _S&M_FXBYPALL
    InvertFB+F2                 Reaper _S&M_FXBYP2          // SWS/S&M: Toggle FX 2 bypass for selected tracks
    InvertFB+F3                 Reaper _S&M_FXBYP3          // SWS/S&M: Toggle FX 3 bypass for selected tracks
    InvertFB+F4                 Reaper _S&M_FXBYP4          // SWS/S&M: Toggle FX 4 bypass for selected tracks
    InvertFB+F5                 Reaper _S&M_FXBYP5          // SWS/S&M: Toggle FX 5 bypass for selected tracks
    InvertFB+F6                 Reaper _S&M_FXBYP6          // SWS/S&M: Toggle FX 6 bypass for selected tracks
    InvertFB+F7                 Reaper _S&M_FXBYP7          // SWS/S&M: Toggle FX 7 bypass for selected tracks
    InvertFB+F8                 Reaper _S&M_FXBYP8          // SWS/S&M: Toggle FX 8 bypass for selected tracks

Hold

The Hold modifier in CSI lets you trigger a second action by holding down a button for a set period of time. Once a Hold modifier is assigned, by default, holding a button for one second will activate the Hold action, which can be different from the normal (short press) action. For example, pressing the "Click" button toggles the metronome, while holding the "Click" button opens the metronome settings. You can change the default hold duration using the SetHoldTime action.

Important:
For Hold actions to work, your button or widget must send both press and release messages. Without release messages, CSI cannot detect a hold.
Also, you must use Feedback=No on the Hold action to avoid glitches or flickering caused by conflicting feedback.

Example:
    Stop                        Stop  
    Hold+Stop                   Reaper 40042 Feedback=No    // Go to start of project

Flip

The Flip modifier was designed for MCU-style surfaces with a "Flip" button that is meant to put TrackPan on faders for easier pan adjustment. See the example below for most common use-case.

Zone Track
    Rotary|                     MCUTrackPan
    Fader|                   	TrackVolume 
    Flip+Fader|                	TrackPan 

Marker

The Marker modifier was designed for MCU-style surfaces with a "Marker" button, allowing you to combine that button to create a range of marker-related actions similar to the examples below.

    Marker+Up                   Reaper 40613       // Delete marker near cursor                         
    Marker+Down                 Reaper 40157       // Insert marker at current or edit position                  
    Marker+Right                Reaper 40173       // Go to next marker or project end                      
    Marker+Left                 Reaper 40172       // Go to previous marker or project start

Nudge

The Nudge modifier was designed for MCU-style surfaces with a "Nudge" button, allowing you to combine that button to create a range of nudge-related actions similar to the examples below.

    Nudge+Up                    Reaper 41925     // Item: Nudge items volume +1dB
    Nudge+Down                  Reaper 41924     // Item: Nudge items volume -1dB
    Nudge+Left                  Reaper 41279     // Item edit: Nudge left by saved nudge dialog settings 1
    Nudge+Right                 Reaper 41275     // Item edit: Nudge right by saved nudge dialog settings 1

Scrub

The Scrub modifier was designed for MCU-style surfaces with a "Scrub" button, allowing you to combine that button to create a range of scrub-related actions similar to the examples below.

    Decrease+Scrub+Jogwheel     Reaper 40084     // Transport: Rewind a little bit
    Increase+Scrub+Jogwheel     Reaper 40085     // Transport: Fast forward a little bit

Zoom

The Zoom modifier was designed for MCU-style surfaces with a "Zoom" button, allowing you to combine that button to create a range of zoom-related actions similar to the examples below.

    Zoom+Up                     Reaper 40111     // Zoom in vertical                                            
    Zoom+Down                   Reaper 40112     // Zoom out vertical                                                       
    Zoom+Right                  Reaper 1012      // Zoom in horizontal                                      
    Zoom+Left                   Reaper 1011      // Zoom out horizontal         

Global, GlobalModeDisplay

The Global modifier is designed for use with MCU/X-Touch style surfaces with the GlobalView button. The original use-case was to switch AssociatedZones between the SelectedTrack type and the Track type. Example: in the X-Touch Home zone, the Global modifier is assigned to GlobalView, and pressing Global+Send will put the X-Touch into the TrackSend zone type, whereas just pressing the Send button by itself would put you into the SelectedTrackSend zone.

The GlobalModeDisplay action will show an "SE" (meaning Selected) or "GL" for Global to indicate the state of the modifier on MCU and X-Touch surfaces.

    GlobalView                  Global
    AssignmentDisplay           GlobalModeDisplay 

    Send                        GoAssociatedZone SelectedTrackSend
    Global+Send                 GoAssociatedZone TrackSend
    Plugin                      GoAssociatedZone SelectedTrackFXMenu
    Global+Plugin               GoAssociatedZone TrackFXMenu
    Instrument                  GoAssociatedZone SelectedTrackReceive
    Global+Instrument           GoAssociatedZone TrackReceive

Toggle

See ToggleChannel for details on how to use the toggle modifier.

Increase, Decrease

Now you can assign two different Reaper actions to a single encoder based on which way the encoder is being turned, Counter-Clockwise (CCW) or Clockwise (CW). We do this via the Decrease and Increase modifiers. Note: these modifiers only work with Encoders. The examples below all show the JogWheel but this functionality will work with any encoder.

Zone Home
    Decrease+JogWheel      Reaper 41326   // Decrease track height
    Increase+JogWheel      Reaper 41325   // Increase track height
ZoneEnd

Important Note: for this to work on your JogWheel, you will need to update your Surface.txt file. If you're coming from a prior version of CSI, you probably have two or more separate JogWheel widgets and those widgets probably are defined using Press instead of Encoder. So replace your JogWheel widgets to look like this (assuming MCU-style surface):

Widget JogWheel JogwheelWidgetClass
	Encoder b0 3c 7f
WidgetEnd

The following native CSI actions support this same syntax:

TrackBank
VCABank
FolderBank
SelectedTrackSendBank
SelectedTrackReceiveBank
SelectedTrackFXMenuBank
TrackSendBank
TrackReceiveBank
TrackFXMenuBank

Example:

Zone Home
    Decrease+JogWheel      TrackBank -1
    Increase+JogWheel      TrackBank  1
ZoneEnd

ClearModifiers

ClearModifiers is useful for having a single action that will clear/unlatch any and all modifiers currently active in CSI.

    Shift+Cancel            ClearModifiers

DoublePress

DoublePress allows any button to respond to a double-press. The default double-press window is 400ms, but you can change this using the SetDoublePressTime action.

When using DoublePress, the first action always fires immediately on press, and the second action fires if the button is pressed again within the double-press window.

Example usage:

Zone Home  
    OnInitialization            SetDoublePressTime 500      // if you want to change from 400ms default  

    Stop                        Stop  
    DoublePress+Stop            Reaper 40042 Feedback=No    // Go to start of project