Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Q&A, Tips, Tricks and Howto

Reply
 
Thread Tools Display Modes
Old 12-10-2017, 07:12 PM   #1
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 3,204
Default [Script] A couple of different MIDI note, CC and other scripts

Hey all, since moving from Cubase to Reaper, I was still missing some crucial functions for my work. I messed around a bit with ReaScript and added everything that was missing for me. New scripts will be added over time.

The script are available via my ReaPack repository:
Code:
https://github.com/StephanRoemer/ReaScripts/raw/master/index.xml
Most of my scripts consist only of a couple of lines of code, because the rely on a function file. These are available as a so called "bundle".
They are tailored that way, that you can easily adjust parameters yourself. E.g. if you are missing a Delete CC32 you can easily edit a Delete CC script and only adjust the dest_cc variable in the script and save it as Delete CC32. Same goes for the quantize script. You can adjust the grid, humanize factor, swing off/on and swing amount.

Also for Add VSTi and replace existing VSTi you need to install "Add or replace VSTi".
Be sure to select it in ReaPack, if you want to use these scripts. As with the MIDI scripts, you can easily modify them by changing the variables.


Script demos (right click the GIF and select "show image" to zoom)



2017-12-12

Select notes after edit cursor (in selected item(s) or MIDI editor)
Select notes before edit cursor (in selected item(s) or MIDI editor)
Delete notes before edit cursor (in selected item(s) or MIDI editor)
Delete notes after edit cursor (in selected item(s) or MIDI editor)

  • select all notes, that are located before the edit cursor Position
  • this script works in arrangement, MIDI Editor and Inline Editor
  • for obvious reasons, this script only works with a single item and will popup a message box, if you have more than one item selected





2017-12-12
Delete short notes
  • deletes leftover short notes, that are created, when splitting (on grid) notes that are not hard quantized (humanized)
  • this script works in arrangement, MIDI Editor and Inline Editor
  • adjust the length of shortnote in the user area. To get an idea which values are typical for short notes, enable the ShowConsoleMsg near the end of the script





2017-12-13
Select, delete and move CCs
  • these scripts select, delete and move CC in various ways
  • these scripts work in arrangement, MIDI Editor and Inline Editor





2017-12-15
Transpose notes +/- X
  • these scripts transposes either all notes or selected notes +/- X
  • these scripts work in arrangement, MIDI Editor and Inline Editor





2017-12-15
Double Notes +/- X (formerly "Add notes")
  • these scripts add to either all notes or selected notes +/- X
  • these scripts work in arrangement, MIDI Editor and Inline Editor





2017-12-16
Increase / Decrease CC
  • these scripts increase or decrease all CC events or selected CC events
  • these scripts work in arrangement, MIDI Editor and Inline Editor





2017-12-17
Quantize and Human quantize notes (straight, triplets, swing)
  • these scripts human quantize either all notes or selected notes by their respective values
  • these scripts work in arrangement, MIDI Editor and Inline Editor
  • Keep in mind, with my commands not being native Reaper quantize commands, you cannot restore their initial position with "unquantize"
  • The quantize "grid" commands use the project grid to quantize and NOT the MIDI Editor grid





2017-12-18
Set edit cursor to first / last note in selected items
  • these scripts set the edit cursor to the beginning of the first and the ending of the last note in an selected item
  • these scripts work in arrangement, MIDI Editor and Inline Editor





2017-12-19
Select CCs within boundaries of selected notes
  • these scripts select all CCs within the boundaries of selected notes
  • execute again to toggle selection
  • these scripts work in arrangement, MIDI Editor and Inline Editor





2018-01-15
Add VSTi and replace existing VSTi
  • this script adds a VSTi instance in FX slot 1
  • if there is already a VSTi, it will be replaced by this one
  • if there is no VSTi, this one will be added in FX slot 1. Existing insert FX will be moved down by one slot
  • after loading the VSTi, the floating GUI will be shown
  • in order to function correctly, the script expects only 1 VSTi on a track
Important notes: these scripts expect "Add or replace VSTi" to be installed on your system. Make sure you have checked it for installation in ReaPack.





2018-01-20
Render VSTi items without track FX
  • this script will render a VSTi item to audio, without applying the track FX
During rendering, the track FX will be bypassed, otherwise you would hear them twice (offline render
and realtime track FX). MIDI and audio items can live happy together on the same track.
This is especially useful, when you want to render a sound effect, loop, etc... to reverse the
audio or to apply take FX, fade curves...





2018-01-21
Toggle collapse selected folders
  • this script will collapse or compact selected folder tracks




2018-06-20
Move edit cursor by frames (mousewheel)
  • this script moves the edit cursor by frames depending on the value sent by the mousewheel




2018-06-28
Nudge notes left or right by 10 ticks
  • these scripts nudge either all notes or selected notes left or right by 10 ticks
  • these scripts work in arrangement, MIDI Editor and Inline Editor




2018-06-30
Change note length (mousewheel)
  • this script changes the note length via mousewheel
  • when there is no note selection, only the note under the mouse cursor is altered
  • this script only works in the MIDI Editor





2018-07-02
Change note start (mousewheel)
  • this script changes the note start position via mousewheel
  • when there is no note selection, only the note under the mouse cursor is altered
  • this script only works in the MIDI Editor




2018-07-02
Change note position (mousewheel)
  • this script changes the note position via mousewheel
  • when there is no note selection, only the note under the mouse cursor is altered
  • this script only works in the MIDI Editor





2018-07-02
Move items to timecode (in filename)
  • this script moves either all or selected items to their timecode position (written in the filename)
  • the timecode needs to be in the format xx.xx.xx.xx (Windows does not allow : in filenames)
  • this script is useful for audio formats, where Reaper can't read the BWF chunk (FLAC for example)




2018-07-12
Change note position to grid(mousewheel)
  • this script changes the note position (based on the grid, if snap in the MIDI editor is turned on) via mousewheel
  • for the time being, you have to link the grid in the MIDI editor with the arrangement grid, will try to find another way to solve this
  • if snap is turned off, it works the same as "Change note position (mousewheel)" script
  • when there is no note selection, only the note under the mouse cursor is altered
  • this script only works in the MIDI Editor




2018-07-12
Move notes to the edit cursor (relative)
  • this script moves all selected notes to the edit cursor and keeps their relative offsets
  • when the mouse hovers a note, the hovered note is used as offset instead
  • this script only works in the MIDI Editor




2018-09-05
Send selected tracks to FX
  • this script sends all selected tracks to an FX track prefixed with FX 1,2,3 or 4



2018-09-05
Remove 1st, 2nd, 3rd or 4th send FX from selected tracks
  • this script removes the 1st, 2nd, 3rd or 4th send FX in the send slot of selected track(s)




2018-09-05
Toggle show UI of all FX in Xth send slot
  • this script shows/hides the UI of all FX in the Xth send FX slot


Last edited by _Stevie_; 04-09-2019 at 07:14 PM.
_Stevie_ is online now   Reply With Quote
Old 12-11-2017, 06:46 PM   #2
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 3,204
Default

2018-09-16
Toggle select all events in CC lane under mouse cursor
  • This script selects/unselects the whole CC lane under the mouse cursor
  • This script works only in the MIDI Editor


2018-09-16
Select all events in CC lane under mouse cursor
  • This script selects all CC events in the lane under the mouse cursor
  • When a CC selection already exists, the new selection will be added (non-exclusive only)
  • This script works only in the MIDI Editor


2018-09-16
Select all events in CC lane before and under mouse cursor (exclusive and non-exclusive)
  • This script selects all CC events in the lane before and under the mouse cursor
  • When a CC selection already exists, the new selection will be added (non-exclusive only)
  • This script works only in the MIDI Editor


2018-09-16
Select all events in CC lane after and under mouse cursor (exclusive and non-exclusive)
  • This script selects all CC events in the lane after and under the mouse cursor
  • When a CC selection already exists, the new selection will be added (non-exclusive only)
  • This script works only in the MIDI Editor


2018-09-16
Decrease and increase events in CC lane under mouse cursor
  • This script increases all or selected CC events in the lane under the mouse cursor
  • This script works only in the MIDI Editor


2018-09-18
Copy selected CC events to lane under mouse cursor
  • This script copies all selected CC events (from all lanes!) to the lane under the mouse cursor
  • This script works only in the MIDI Editor


2018-09-18
Move selected CC events to lane under mouse cursor
  • This script moves all selected CC events (from all lanes!) to the lane under the mouse cursor
  • This script works only in the MIDI Editor


2018-09-18
Copy selected CC events to lane under mouse cursor at mouse position
  • This script copies all selected CC events (from all lanes!) to the lane under the mouse cursor, starting at the mouse position
  • This script works only in the MIDI Editor


2018-09-18
Move selected CC events to lane under mouse cursor at mouse position
  • This script moves all selected CC events (from all lanes!) to the lane under the mouse cursor, starting at the mouse position
  • This script works only in the MIDI Editor


2018-09-28
Insert signature based on time selection
  • This script inserts a signature based on the grid value and the time selection
  • This script works in the MIDI Editor and the Arrange view


2018-10-07
Change velocity
  • This script bundle consists of several scripts that increase/decrease the velocity of either all or selected notes
  • The amount can be adjusted in the scripts. That way, you can easily create different versions that fit your personal needs.
  • The scripts work in Arrangement, MIDI Editor and Inline Editor

2018-10-14
Align selected items to item under mouse cursor
  • This script aligns selected takes to the take under the mouse
  • Depending on where the mouse is located (near the start or end of the item), selected items will be aligned to their start or end
  • Items with a snap offset will always be aligned to their offset
  • This script only works in the Arrangement



2018-10-16
Move legato point of 2 selected notes (mousewheel)
  • This script moves the legato point of 2 selected notes
  • This script only works, when exactly 2 notes are selected, otherwise an error message will pop up
  • This script only works in the MIDI Editor


2018-12-04
Move cursor to start of selected item and preserve play state
  • This script moves the edit cursor to the start of the selected item
  • If the edit cursor is moved, while playback is on, the playback continues
  • This script works only in the Arrangement

Select and move to next item and preserve play state
  • This script moves the edit cursor to the start of the next item
  • If the edit cursor is moved, while playback is on, the playback continues
  • This script works only in the Arrangement

Select and move to previous item and preserve play state
  • This script moves the edit cursor to the start of the previous item
  • If the edit cursor is moved, while playback is on, the playback continues
  • This script works only in the Arrangement




Open MIDI editor and zoom to 5 measures (zoom center is edit cursor)
  • The code is based to 99% on Julian's code, I only added the open MIDI editor command and cleaned up unnecessary parts.
  • this script should ultimately help you to get rid of any MIDI Editor zooming issues. Assign it to the enter key and it will open the MIDI Editor and zoom to 5 measures (default). Whereas the edit cursor represents the zoom center.
  • You can adjust the measures in the user area.




Open MIDI editor and zoom to content and Zoom MIDI editor to content
  • Almost the same scripts, but the first one works only in the main (opens the MIDI editor) and the second one only works in the MIDI editor and zooms only
  • This script zooms to the content of the MIDI item, without changing the horizontal zoom of the notes




Go to start marker and Go to start marker
  • These scripts put the edit / play cursor to the marker named "=START" or "=END"
  • I use this in conjunction with "X-Raym_Insert or update start and end marker from time selection.lua" to create the project boundaries
  • These scripts work only in the arrangement

Zoom to start and end marker
  • This script zooms in between the boundaries of the start and end marker
  • Again, I use this in conjunction with "X-Raym_Insert or update start and end marker from time selection.lua" to create the project boundaries"
  • To undo the zoom, use "View: Restore previous zoom level



2019-04-05

Delete notes after mouse cursor (in take under mouse or in MIDI editor)
Delete notes before mouse cursor (in take under mouse or in MIDI editor)
Mute notes after mouse (in take under mouse or in MIDI editor)
Mute notes before mouse (in take under mouse or in MIDI editor)
Select notes after mouse cursor (in take under mouse or in MIDI editor)
Select notes before mouse cursor (in take under mouse or in MIDI editor)

  • These scripts select/delete/mute all notes before/after the mouse cursor in the currently focused item, MIDI editor or inline editor

2019-04-10:

Trim head of item(s) and delete item(s) before mouse cursor
Trim tail of item(s) and delete item(s) after mouse cursor

  • These scripts trim the head/tail of all or selected items before/after the mouse cursor
  • Additionally, all items located before the mouse cursor will be deleted
  • This script only works in the arrangement

Last edited by _Stevie_; 04-09-2019 at 07:20 PM.
_Stevie_ is online now   Reply With Quote
Old 12-11-2017, 11:10 PM   #3
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 4,844
Default

Great stuff, many thx !!
Any chance that these scripts become available via ReaPack ?
__________________
Reaper - OSX (always latest version)
OSX Catalina (always latest version)
My Reaper Tips&Tricks: https://www.youtube.com/user/vanhaze2000/playlists
vanhaze is online now   Reply With Quote
Old 12-12-2017, 04:03 AM   #4
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 5,589
Default

_Stevie_, correct me if I am wrong... I think you are a new REAPER user that recently migrated from Cubase, and you are already scripting? That's awesome!
heda is offline   Reply With Quote
Old 12-12-2017, 04:43 AM   #5
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 3,204
Default

Quote:
Originally Posted by vanhaze View Post
Great stuff, many thx !!
Any chance that these scripts become available via ReaPack ?
I would do that immediately, if I knew how!
I couldn't find any guidelines how to set up GitHub for ReaPack.
Any hints appreciated!

Quote:
Originally Posted by heda View Post
_Stevie_, correct me if I am wrong... I think you are a new REAPER user that recently migrated from Cubase, and you are already scripting? That's awesome!
Haha, yeah that's right. When using Cubase, I tried to complement it with AutoHotKey scripts, because it was lacking in some areas. So, I kinda felt quickly at home with ReaScript. But I will never be at the same level as guys like you or juliansader, mpl, spk77, etc...
_Stevie_ is online now   Reply With Quote
Old 12-12-2017, 05:38 AM   #6
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 5,589
Default

haha
you can of course
I'm not very good. I'm learning. for years...

For some reason, testing your script, the undo block is not added.
I think it should be reaper.Undo_EndBlock('Select notes before cursor', 4)
4 for undo in items, but it seems not working either. mmm
I would also put the PreventUIRefresh and the undo commands each one in one line.
heda is offline   Reply With Quote
Old 12-12-2017, 05:58 AM   #7
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 3,204
Default

Yeah, I was just about to write that! I don't know what's going on there.
If you Undo and then Redo, everything is back to normal. But something is not right there. I have never seen such a behavior before, have you?
_Stevie_ is online now   Reply With Quote
Old 12-12-2017, 08:53 AM   #8
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 9,275
Default

Quote:
Originally Posted by _Stevie_ View Post
I would do that immediately, if I knew how!
I couldn't find any guidelines how to set up GitHub for ReaPack.
Any hints appreciated!
In very short:
- Your scripts need a ReaPack header.
https://github.com/cfillion/reapack-index/wiki/Examples
https://github.com/cfillion/reapack-...-Documentation
(or see other scripts in ReaPack for examples)

- You need reapack-index to index the scripts in your repo. reapack-index produces a index.xml file.
https://github.com/cfillion/reapack-index/wiki

- This index.xml is then also pushed to your GitHub repo and you can give this URL other ReaPack users for importing your repo into ReaPack, like e.g. I did with mine:
https://github.com/nofishonfriday/ReaScripts

(or you can have it enabled by default in Reapack, don't know how though)

Thread with more info and for asking questions:
https://forum.cockos.com/showthread.php?t=169127

Last edited by nofish; 12-12-2017 at 09:01 AM.
nofish is offline   Reply With Quote
Old 12-12-2017, 09:42 AM   #9
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 3,204
Default

Thanks nofish! Will check that out.
I looked at some of the ReaPack scripts. Interessting that most of them don't use the "@decription" synthax.
_Stevie_ is online now   Reply With Quote
Old 12-31-2017, 03:56 AM   #10
jbraner
Human being with feelings
 
jbraner's Avatar
 
Join Date: Nov 2017
Location: Edinburgh
Posts: 259
Default

Hi Stevie,

Pardon me for being thick - but that link
https://github.com/StephanRoemer/Rea...ster/index.xml is to a xml file.

Where are the scripts? Do we have to extract them from the xml file?
Or have you managed to get them on to ReaPack?

Thanks.
jbraner is offline   Reply With Quote
Old 12-31-2017, 04:23 AM   #11
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 3,204
Default

Hey jbraner,

Yes, the xml is indeed a ReaPack repository. Just add it to ReaPack and install the needed scripts.
__________________
My Reascripts forum thread | My Reascripts on GitHub | Stephan Römer - film composer
If you wish to donate for my scripts: please consider an organization like: animal shelter, doctors without borders, UNICEF, etc...
_Stevie_ is online now   Reply With Quote
Old 12-31-2017, 09:50 AM   #12
jbraner
Human being with feelings
 
jbraner's Avatar
 
Join Date: Nov 2017
Location: Edinburgh
Posts: 259
Default

Ahh - OK, I'll give it a shot!
Thanks.
jbraner is offline   Reply With Quote
Old 12-31-2017, 10:44 AM   #13
jbraner
Human being with feelings
 
jbraner's Avatar
 
Join Date: Nov 2017
Location: Edinburgh
Posts: 259
Default

Quote:
Originally Posted by _Stevie_ View Post
Hey jbraner,

Yes, the xml is indeed a ReaPack repository. Just add it to ReaPack and install the needed scripts.
OK - I got it - thanks a lot.


I'm still new to all of this, so I'll slowly work my way through these various MIDI scripts ;-)
jbraner is offline   Reply With Quote
Old 01-14-2018, 09:39 PM   #14
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 3,204
Default

New scripts: Add VSTi and replace existing VSTi
Check the OP for more information.
__________________
My Reascripts forum thread | My Reascripts on GitHub | Stephan Römer - film composer
If you wish to donate for my scripts: please consider an organization like: animal shelter, doctors without borders, UNICEF, etc...
_Stevie_ is online now   Reply With Quote
Old 01-17-2018, 02:06 PM   #15
JoostJanssensDS
Human being with feelings
 
Join Date: Feb 2017
Posts: 28
Default

Hey Stevie,

first of all, thanks for these wonderful scripts. I have these all on contextual toolbars ready to go, but...

Some commands return me an error message. Like, your increase CC scripts work, but the decrease CC scripts give me this:

sr_MIDI functions.lua:365: attempt to perform arithmetic on a nil value (local 'increase')

Any idea what this can be?

Thanks for these scripts, they're really handy!
JoostJanssensDS is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 08:50 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.