View Single Post
Old 07-04-2016, 02:34 PM   #78
Human being with feelings
Join Date: Jul 2009
Posts: 2,802

Major update:

I am trying to replicate the user interface and user experience of FL Studio and Cubase. In these DAWs, MIDI editing functions can be selected by means of toolbar buttons, so the user is not limited to using (and remembering) keyboard shortcuts.

My scripts that edit the "lane under mouse" (such as Stretch, Tilt, Draw, Arch etc) could previously not be selected using toolbar buttons, since the mouse needs to be positioned over the CC lane when the script starts.

In the new versions of these scripts:
1) The scripts can be linked to toolbar buttons. Clicking a toolbar button will select ('arm') the script to be applied next.
2) A single keyboard shortcut and a single mousewheel shortcut are all that is needed to run any selected ('armed') script.

EDIT 2017-01-30: New update: Any of the scripts that use the mousewheel can now be controlled via the single mousewheel modifier that is linked to the "js_Run..." 'control script' - even if those scripts are called from their own keyboard shortcuts.

I.e. if you prefer to run the scripts via easy-to-remember keyboard shortcuts such as "C" = Compress/Expand, "A" = Arch linear, "shift+A" = Arch sine, etc., all these scripts can now be controlled via the single mousewheel shortcut. No need anymore to remember a different mousewheel modifier combination for each script!

This keyboard shortcut and mousewheel shortcut must be linked to the new 'control script' with the long (but hopefully descriptive) name of
"js_Run the js_'lane under mouse' script that is selected in toolbar (link this to shortcut and mousewheel).lua".

This script will call the 'armed' script that has been selected in the toolbar.

For detailed instructions, please read the header of the abovementioned ""js_Run..." script (in REAPER's script editor, or in ReaPack's "About" window), or follow the discussions in the posts below.

Example of a MIDI editor toolbar:

Demonstration of toolbar-linked scripts:


The following instructions are included inside the js_Run script:

[TL/DR version:
1) Add all of the 'lane under mouse' scripts to the toolbar.
2) Link the js_Run script to a keyboard shortcut as well as a mousewheel shortcut.
3) Now any 'lane under mouse' script that is activated in toolbar can be run using the shortcuts assigned in step 2.
4) EDIT 2017-01-30: Moreover, even if the script was called from its own keyboard shortcut, it can still be controlled via the single mousewheel modifier that is linked to "js_Run...".]

This script helps to improve the UI by allowing js_ MIDI editing functions to be selected via toolbar buttons, similar to FL Studio and other DAWs.

Any js_ script that edits the 'lane under mouse' and that has been linked to a toolbar button can be run using a single keyboard shortcut that has been linked to this script -- therefore no more need to remember a different shortcut for each script.

This script currently works with the following js_ MIDI editing scripts:
~ Arch with sine curve
~ Arch with linear or power curve
~ Stretch
~ Tilt
~ Compress or expand
~ 1-sided warp (accelerate)
~ 2-sided warp (and stretch)
~ Draw linear or curved ramp in real time
~ Draw linear or curved ramp in real time (chasing start values)
~ Draw sine curve in real time
~ Draw sine curve in real time (chasing start values)
~ Split notes
~ Split selected notes
~ Trim notes
~ Trim selected notes
~ Remove redundancies (in lane under mouse)
~ Move ALL selected events to mouse position

Any user-customized variants of these scripts can also be added to the toolbar.

NOTE: The scripts listed above are those that work with events in the lane under mouse. Since the mouse needs to be positioned over the MIDI editor's CC lanes or notes area for these scripts to work, they cannot be run directly from toolbar buttons.

Scripts that work with events in the last-clicked lane (such as variants the LFO Tool or the Remove Redundancies script) can be run directly from the toolbar.

* This script must be linked to a keyboard shortcut (such as "S") as well as a mousewheel shortcut (such as Ctrl+mousewheel).
* This script should not be linked to a toolbar button.
* The js_ MIDI functions listed above should each be linked to a toolbar button. (They can also be linked to their own keyboard shortcuts, but this is not necessary.)
* To run the selected js_ MIDI function:
* 1) click its button, which will light up,
* 2) move the mouse to its position in the CC lane or notes area, and
* 3) press the shortcut key for this "Run the js_..." script.

Note: Since this script is a user script, the way it responds to shortcut keys and mouse buttons is opposite to that of REAPER's built-in mouse actions with mouse modifiers: To run the script, press the shortcut key *once* to start the script and then move the mouse *without* pressing any mouse buttons. Press the shortcut key again once to stop the script.

(The first time that the script is stopped, REAPER will pop up a dialog box asking whether to terminate or restart the script. Select "Terminate" and "Remember my answer for this script".)

The standard arming method (right-click to arm and then left-click to run the action) actually does work - but only in the piano roll area, not in the CC lane. For some reason, REAPER's toolbar arming does not work in the CC lane. The Trim notes script, for example, can be run via the standard toolbar arming method.

Last edited by juliansader; 09-17-2017 at 10:30 PM.
juliansader is offline   Reply With Quote