MST5K v1.2.73 - Advanced MIDI Note Selection by Lemerchand
Update to v1.2.73
+ MST will now refocus the active midi editor after making a selection!
Update to v1.2.67
+ MST can now export presets with the option to select only within the time selection. (Alt+Shift+Right-click a loaded preset)
Update to v1.2.3b
+ MST can now handle pitches in both sharp or flat! Alt-Left-Click the pitch buttons to toggle!
UPDATE to v1.2b
+ Presets exported to actions are prefixed with "MST_" in the actions list.
- TODO: Prompt user to save a changed preset before export
UPDATE to v1.2b
+ Save Preset' input box now defaults to the current preset's name to make overwriting a it easier
+ You can now export presets to the action list to run your favorite filters without loading MST5K!!
- Alt-Right-Click the currently loaded preset. Exported presets automatically appear in your actions list.
Enjoy!
About
Hello, hello, hello everyone!
I got into reascripting a few months ago and a practice project I was working on--thanks to the encouragement from some very cool people*--quickly became a full script. The very same people suggested I post it here, and while it may still need some polish and bug-squashing, I think you may find it quite useful in myriad scenarios.
It is a MIDI Note Selection tool that has been likened to the Cubase Logical Editor. I always felt the native filter was cumbersome. My script can do nearly anything the native filter can, but far more quickly. It is not, however, just a reskinned native filter--I assure you!
I have even baked in an info panel that describes all the various controls' functions!
I often use it to quickly accent kick/snare hits, humanize midi, or quickly select notes without capturing key switches, but I'm sure you can find other creative ways to use it.
Some nifty features under:
Quickly select notes in the active midi editor (even restricted to the time selection if you so please) using filters for...
High/Low Note range
Pitches you choose (including built-in scales!)
Min/Max velocity
Note Length from 1-1/64th (triplet support is in a new feature--bear with me)
Note position on the grid in 16th notes
Built-in documentation so you don't have to remember advanced features
Unlimited Global Presets and 16 beat pattern presets
Quickly set filters by "capturing" the properties of selected notes
Probably some other things I'm forgetting right now
Bonus: MST5K utilizes a custom UI library I built which you can also use if you're so inclined. Caveat: it is not as fleshed out as existing UI libs, but it is very easy to use for quick ideas!
You can also use Git or download the .zip. If you opt for the .zip, place it int your resource path's 'Scripts' folder, extract it, and rename the folder to "lemerchand" (as opposed to "lemerchand-master")
Please be sure to maintain the file structure in my github or the script will not work. If you have any questions I'm friendly and only bite upon request.
For reference, it should look like this: C:\Users\YourName\AppData\Roaming\REAPER\Scripts\l emerchand\MIDI Selector Tool
*A shout-out to Daniel Lumertz, Stevie, and Birdbird for the advice, suggestions, bug testing, and constantly helping me find API calls I couldn't find. Without your encouragement/help I wouldn't have gotten this far!
On a final note, I am looking for new ideas. Right now I am working on a console tool that works in ways I wish reaconsole did (don't get me wrong, reaconsole is fantastic). If you want to give me feature ideas for that, test it out, or suggest something else I'm open to ideas!
Last edited by lemerchand; 02-04-2021 at 05:01 AM.
Reason: Version Update
It's been tested by a few people using mac. Can you tell me how long ago you downloaded it and with which method you used?
The number one installation error I'm seeing so far is that if you download the .zip from github then the unzipped file must be renamed from "lemerchand-master" to "lemerchand"
Also, some people aren't not putting it into their scripts folder within their resource path!
I'm working to make installation more simple. As of right now the file structure is very important.
This is one of my fav new scripts! Have been testing for one month or more! really neat! I used to use MIDI filter but this get the job done quicker to me hahahah, and have other things, and with a nice UI.
Also about the UI, really good GUI lib to start learning about GUI in reaper and oop. helped me a lot!
cf.lua:126: attempt to index a nil value (local 'file')
in Reaper 6.18 Win though. Bug or my error?
__________________ Windows 10x64 | AMD Ryzen 3700X | ATI FirePro 2100 | Marian Seraph AD2, 4.3.8 | Yamaha Steinberg MR816x "If I can hear well, then everything I do is right" (Allen Sides)
Can you all go to Actions > Reapack > Synchronize Packages and let me know if it works now, please? Sorry for the hassle.
@vanhze
@beingmf
@hojo (Delete your github version and try with reapack please!)
Great, it works now! Thanks a lot!
__________________ Windows 10x64 | AMD Ryzen 3700X | ATI FirePro 2100 | Marian Seraph AD2, 4.3.8 | Yamaha Steinberg MR816x "If I can hear well, then everything I do is right" (Allen Sides)
Is it possible to export presets so that they only work within time selection?
Nope! Err...well, there wasn't. Now there is, thanks to you!
Until I come up with a better solution you can now Alt+Shift+Right-click a loaded preset to export it as Time-Selection-Only. It will appear under actions with the prefix 'MST' and the suffix 'time selection.' It's not the most elegant solution I suppose, but it'll have to do for now. I hope you can work with that.
Update to v1.2.67 for the added functionality. Do me a favor and let me know if you encounter any problems--I didn't test it very thoroughly. Thanks again, and enjoy!
Nope! Err...well, there wasn't. Now there is, thanks to you!
Until I come up with a better solution you can now Alt+Shift+Right-click a loaded preset to export it as Time-Selection-Only. It will appear under actions with the prefix 'MST' and the suffix 'time selection.' It's not the most elegant solution I suppose, but it'll have to do for now. I hope you can work with that.
Update to v1.2.67 for the added functionality. Do me a favor and let me know if you encounter any problems--I didn't test it very thoroughly. Thanks again, and enjoy!
Wow thanks! I did a quick test and it works great so far. I'll use it more in depth tonight, I'll let you know if encounter anything suspicious
bah, still a lost of time with not working at first time script in Reaper.I Get this on Catalina "MIDI Selector Tool.lua:33: attempt to call a nil value (field 'JS_Window_GetFocus')"
Any chance to update gui to be shown properly on HDPI / Retina?
It's blurry at now.
Heda has given me a piece of code that should work. I don't have access to a retina display so I'll have to update and have you look at it for me. I'll let you know when it's up.
Quote:
Originally Posted by dupont
bah, still a lost of time with not working at first time script in Reaper.I Get this on Catalina "MIDI Selector Tool.lua:33: attempt to call a nil value (field 'JS_Window_GetFocus')"
I'm going to assume that Daniel is right, Dupont. That message would indicate you don't have one of the dependencies installed. You'll need this for a lot of reascripts.
It was me who asked HeDa to make this recent "retina update" ..he made it in a few minutes and it works very well, so I believe it will work with your script too It would be nice, I like your script idea very much
You use:
local lastWindow = reaper.JS_Window_GetFocus()
and later:
reaper.atexit(reaper.JS_Window_SetFocus(lastWindow ))
I altered the script to put:
reaper.JS_Window_SetFocus(lastWindow)
inside every if/then of the SELECT BUTTON section (around line 339). This allows me to keep the selector script open and select some notes, move or alter with keyboard shortcuts, select other notes, move them, etc. without needing to click in the editor or close the tool first to set focus back to the MIDI editor manually.
Jon of The REAPER Blog mentioned in his video that it would speed up the work flow, and I think it does.
I have another suggestion, however this one requires the SWS/S&M EXTENSION:
The issue is that the Note name on the midi editor (eg. C4) does not always match the Pitch Max/Min in the tool when captured. This is because of the MIDI Octave Name Display Offset preference. When I click C4 in the editor, the tool captures it as Min/Max C5.
function midi_to_note(n)
return tostring(note_names[(n%12)+1]) .. tostring(math.floor(n/12)- OCTAVE_OFFSET)
end
And:
function note_to_midi(str)
.
.don't change anything here
.
local o = tonumber(str.match(str, '%d%d')) or tonumber(str.match(str, '%d'))
o = o + OCTAVE_OFFSET
.
.Don't change anything else
.
end
I didn't look at all the code, so there may be other places where you set note name to note number or vis-versa.
You use:
local lastWindow = reaper.JS_Window_GetFocus()
and later:
reaper.atexit(reaper.JS_Window_SetFocus(lastWindow ))
I altered the script to put:
reaper.JS_Window_SetFocus(lastWindow)
inside every if/then of the SELECT BUTTON section (around line 339). This allows me to keep the selector script open and select some notes, move or alter with keyboard shortcuts, select other notes, move them, etc. without needing to click in the editor or close the tool first to set focus back to the MIDI editor manually.
Jon of The REAPER Blog mentioned in his video that it would speed up the work flow, and I think it does.
You might consider it in your next code update.
I like it very much and the above would be a much appreciated update; so we can use our midi editor shortcut while using the script.
For those having trouble with the install through ReaPack.
You have to either manually mark it for install, or enable bleeding edge/pre-release.
I removed the beta flag from the version in Reapack so it should now show up and update automatically!
Quote:
Originally Posted by Sid
Hi,
Lovely script.
You use:
local lastWindow = reaper.JS_Window_GetFocus()
and later:
reaper.atexit(reaper.JS_Window_SetFocus(lastWindow ))
I altered the script to put:
reaper.JS_Window_SetFocus(lastWindow)
inside every if/then of the SELECT BUTTON section (around line 339). This allows me to keep the selector script open and select some notes, move or alter with keyboard shortcuts, select other notes, move them, etc. without needing to click in the editor or close the tool first to set focus back to the MIDI editor manually.
Jon of The REAPER Blog mentioned in his video that it would speed up the work flow, and I think it does.
You might consider it in your next code update.
I just updated it with this feature. Thanks for the suggestion.
Quote:
Originally Posted by Sid
I have another suggestion, however this one requires the SWS/S&M EXTENSION:
The issue is that the Note name on the midi editor (eg. C4) does not always match the Pitch Max/Min in the tool when captured. This is because of the MIDI Octave Name Display Offset preference. When I click C4 in the editor, the tool captures it as Min/Max C5.
I have been planning on tweaking this for some time. Thanks for the advice on how to implement it. It will be pushed out when I can get around to it!
Quote:
Originally Posted by Knob Twiddler
I like it very much and the above would be a much appreciated update; so we can use our midi editor shortcut while using the script.
I encouter an issue when trying to set the Float at mouse values, the second one adds the number five as it pleases... like I set -100 and when reopen it says -1005 and so on... is it just me or can anyone confirm it ? (v1.2.71 on reaper 6.21 x64 windows 7)
I encouter an issue when trying to set the Float at mouse values, the second one adds the number five as it pleases... like I set -100 and when reopen it says -1005 and so on... is it just me or can anyone confirm it ? (v1.2.71 on reaper 6.21 x64 windows 7)
This issue has popped up a few times for me and at least one other person. I'm not 100% sure what causes it. I'll put it on my list of things to look into. Sorry for the inconvenience!
console output
...pts\Scripts by Lemerchand\MIDI Selector Tool\libs/cf.lua:179: attempt to concatenate a nil value (local 'filename')
separate issue
the refocusing of the editor stopped working after I saved some presets. Not sure if that's the cause but its when I noticed the issue. it was working fine yesterday
__________________
REAPER Video Tutorials, Tips & Tricks and more at The REAPER Blog