Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 04-05-2015, 04:02 PM   #1
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,032
Default Script (EEL): Select-Unselect MIDI Notes (various)

Hi !

The idea is to add to selection all the MIDI notes that are next to the mouse in the MIDI editor.

The first versions of this scripts were available online since two months, but it was not yet ready for a dedicated post.
All three scripts has been combined into one only, and it works without pitch offset (this was a way to overpass a bug).
  • X-Raym_Select-Unselect all MIDI notes with same pitch right of the mouse.eel
  • X-Raym_Select-Unselect all MIDI notes with same pitch left of the mouse.eel
  • X-Raym_Select-Unselect all MIDI notes under mouse based on grid.eel
  • X-Raym_Select-Unselect all MIDI notes over mouse based on grid.eel
  • FnA_Select-Unselect notes in grid over mouse.eel (same use as above but works better with non straight grid)
  • FnA_Select-Unselect notes in grid under mouse.eel(same use as above but works better with non straight grid)
  • X-Raym_Select-Unselect highest MIDI notes in active take.eel
  • X-Raym_Select-Unselect lowest MIDI notes in active take.eel


Demo:



Update: 13/04/2015


Update: 02/05/2015

Disclaimer:
Tested for REAPER v5 pre 21 and SWS 2.6.3 #0, it may not work as expected for earlier versions.

EDIT 2015-06-04
Two new scripts :
  • X-Raym_Select-Unselect all MIDI notes over mouse.eel
  • X-Raym_Select-Unselect all MIDI notes under mouse.eel




Download link:

See my signature (link to my collection), and find the folder MIDI Editor.

Tell me if you use it
See you soon for a next script!

Last edited by X-Raym; 06-04-2015 at 03:57 AM.
X-Raym is offline   Reply With Quote
Old 04-06-2015, 02:27 AM   #2
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 4,772
Default

I am very eager to try out these scripts !

However, maybe i am blind but can't find those on your site;

I click on "my reascripts" in your signature, that takes me to attached picture.
I then click on Midi Editor folder but in there i don't see the scripts.

Can you please lead me to it ?

Thx in advance !

Last edited by vanhaze; 01-09-2016 at 02:50 PM.
vanhaze is offline   Reply With Quote
Old 04-06-2015, 02:45 AM   #3
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,032
Default

@Vanhaze
Oh yeah, my explanation may a bit confusing.

Click on the link, you go on the webpage, now click and the blue download button. It will download a ZIP containing all my scripts. The script is inside MIDI Editor folder.
You are not supposed to clink the image thumbnail :P

Thanks for you interest in my scripts
X-Raym is offline   Reply With Quote
Old 04-06-2015, 04:47 AM   #4
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 4,772
Default

Ok, thx for the info !

So i succesfully downloaded the scripts and imported them into Action List (Midi Editor section).
I am on Reaper 50pre22, 64bit OSX version, SWS 2.6.3.0 beta.

I tried both scripts, but they just don't do anything for me.

Also i tried the script: Select all midi notes and events right of mouse.eel.
For me, when executed, just selects all notes and events in the item, not just the ones to the right of mouse.
vanhaze is offline   Reply With Quote
Old 04-06-2015, 05:44 AM   #5
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 9,050
Default

Quote:
Originally Posted by vanhaze View Post
Ok, thx for the info !

So i succesfully downloaded the scripts and imported them into Action List (Midi Editor section).
I am on Reaper 50pre22, 64bit OSX version, SWS 2.6.3.0 beta.

I tried both scripts, but they just don't do anything for me.
Same here (Reaper 5pre22 x32, Win 8.1 x64, SWS 2.6.3.0 beta.).
Also I'm not quite sure how to use them, can you put these scripts on a mouse modifier (or keyboard shorcut) or is it like "run script - make selection - stop script" ?
nofish is offline   Reply With Quote
Old 04-06-2015, 06:03 AM   #6
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 4,772
Default

Hi Nofish,

FYI:

I tried both: assigning both scripts to keyboard shortcuts and to mouse modifiers.
Both don't work for me : nothing happens.
vanhaze is offline   Reply With Quote
Old 04-06-2015, 06:13 AM   #7
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,032
Default

You have to load them in the Menu Editor section of the Action panel, if you load them in Main it doesn't work. Look fo the dropdown lenu top right of Actions Window.
Then, you assign a keyboard shortcut and it works.
X-Raym is offline   Reply With Quote
Old 04-06-2015, 06:19 AM   #8
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 4,772
Default

Ok, thx for the info !
But does it matter in what "subsection" of Menu Editor i have to load the scripts ??
For example: Midi Main Edit , or Midi Piano Roll Context ??
vanhaze is offline   Reply With Quote
Old 04-06-2015, 06:19 AM   #9
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,032
Default

Here is how:



You can see the Section: MIDI Editor, and the Keyboard shortcuts assign to each script.
X-Raym is offline   Reply With Quote
Old 04-06-2015, 06:21 AM   #10
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,032
Default

@Vanhaze
Quote:
But does it matter in what "subsection" of Menu Editor i have to load the scripts ??
Yes. Else, it doesn't do anything.

Tell me if it works for you !
X-Raym is offline   Reply With Quote
Old 04-06-2015, 06:28 AM   #11
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 4,772
Default

My own quote:

"So i succesfully downloaded the scripts and imported them into Action List (Midi Editor section)."

This is what you are explaining i assume, but the scripts still won't work for me when imported to that section.
vanhaze is offline   Reply With Quote
Old 04-06-2015, 06:32 AM   #12
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 4,772
Default

Testing with just one script, assigned to key A.

See attached pict.

Doesn't work for me.

Last edited by vanhaze; 01-09-2016 at 02:50 PM.
vanhaze is offline   Reply With Quote
Old 04-06-2015, 06:37 AM   #13
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,032
Default

I downloaded my own scripts from my online repo and made a filmed test.

Tell me if you didn't miss anything of this process.

Edit: If you don't, I will have to test it on other computer to be sure that the problem came from my part.
There is absolutely no OS dependant line of code in this script, it may be a SWS problem ?

Last edited by X-Raym; 04-06-2015 at 06:47 AM.
X-Raym is offline   Reply With Quote
Old 04-06-2015, 06:49 AM   #14
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 4,772
Default

I really appreciate your effort to help ;

I exactly followed your tutorial : no succes for me : the scripts don't do anything.
Maybe a mac issue concerning .eel ?

On the other hand, i have some .eel scripts installed that just work fine for me.
vanhaze is offline   Reply With Quote
Old 04-06-2015, 06:58 AM   #15
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,032
Default

@vanhaze
It's normal, I shared this script so they can help people, if they doesn't work, what is the point ?

Just tested with Pre22 x64 with SWS 2.6.3 #0 and it still works for me.
I guess we need more beta testers to determine what is the source of the problem. It may be the script, it may be it dependencies. The script is pretty straightforward (and.. works for some :P), so we need other user feedbacks to go further.
X-Raym is offline   Reply With Quote
Old 04-06-2015, 07:00 AM   #16
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,032
Default

Mac isn't the problem by itself, I often used REAPER on Mac, I even wrote some of my scripts on a Mac :P

@Nofish

Still no good news on your (Windows 8.1) side ?
X-Raym is offline   Reply With Quote
Old 04-06-2015, 07:09 AM   #17
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,514
Default

Works here (Win 8.1, REAPER v5.0pre22).
spk77 is offline   Reply With Quote
Old 04-06-2015, 07:24 AM   #18
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,032
Default

@spk77
I feel better now :P

--
Any MAC OS beta-tester is welcome !
X-Raym is offline   Reply With Quote
Old 04-06-2015, 10:05 AM   #19
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 9,050
Default

Quote:
Originally Posted by X-Raym View Post

@Nofish

Still no good news on your (Windows 8.1) side ?
Will take a bit since I get around to testing again but will report back.

Don't worry too much, I guess it's probably user error from my side since spk77 reported it's working fine for him on Win 8.1.
nofish is offline   Reply With Quote
Old 04-06-2015, 04:25 PM   #20
Breeder
Human being with feelings
 
Breeder's Avatar
 
Join Date: Nov 2010
Location: Croatia
Posts: 2,137
Default

Just to let you know, this script is using some of the SWS API to get mouse info...and that whole mouse detection thing is quite complicated. It was tested A LOT and I hope it's 100% bug-free by now but you can never really know (the whole things was actually developed with Contextual toolbars in mind, and I did get a few bug report on it so that helped tremendously to squish some rare bugs in mouse detection code...which can mean there are still some buggy corner cases that are still undetected for now :/)

If you really want to replicate the problem, you should at least exchange REAPER.ini, project file and langpack (langpacks can change name of various windows which can in theory screw window detection if I did something wrong).

I would personally go that far to request the whole REAPER config folder for further testing

Unfortunately, I'm quite busy so I can't really debug this...but if you find the root of the problem and it has something to do with SWS API, please report it on our GitHub
Breeder is offline   Reply With Quote
Old 04-06-2015, 04:35 PM   #21
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,032
Default

@breeder
Thanks for the expertise

I'm waiting for the original bug reporters to test it again on their system, with the right installation process, and if it still doesn't work, I invite them to send me all what is required to replicate the problem, as you advised.

I will let you know if we find something for you :P
X-Raym is offline   Reply With Quote
Old 04-07-2015, 06:59 AM   #22
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 9,050
Default

Ok, I tested now...

Works fine when assigned to a shortcut, thank you.
(Don't know what happened yesterday, I simply was too tired I guess. Not a good state of mind for testing )

I found out it also works when assigning this script to a mouse modifier, my preferred use (I used MIDI piano roll -> left click). Nice.

When doing this, after a few clicks Reaper sometimes crashes here though.
Seems randomly and not reproduceable. I tried to do a licecap but then it didn't crash no matter how much I clicked.

I'll try to capture it and report back when it happens again.
nofish is offline   Reply With Quote
Old 04-07-2015, 07:17 AM   #23
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,032
Default

Nice to hear

I have to admit that I never thought about putting in as a mouse modifier, but sure, it can be handy !

In piano roll ? You mean on the keyboard touch ? It seems that right click on a piano note already select all notes of that row, and maj+right click add the row to the selection (default behavior), so I don't know if my script is useful in this case. ^^
X-Raym is offline   Reply With Quote
Old 04-07-2015, 07:27 AM   #24
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 9,050
Default

Quote:
Originally Posted by X-Raym View Post
Nice to hear

I have to admit that I never thought about putting in as a mouse modifier, but sure, it can be handy !

In piano roll ? You mean on the keyboard touch ? It seems that right click on a piano note already select all notes of that row, and maj+right click add the row to the selection (default behavior), so I don't know if my script is useful in this case. ^^
I emphasized the little difference here which makes your script very useful.
Your script selects to or from mouse cursor !

edit:
I mean doing it directly on the piano roll, not on the keyboard to the left as you wrote above.

(It's basically the same as assigning it to a shortcut, I just happen to like it more using it as mouse modifier.)

Last edited by nofish; 04-07-2015 at 07:32 AM.
nofish is offline   Reply With Quote
Old 04-07-2015, 07:33 AM   #25
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,032
Default

Oh yes ok

haha ! I'm glad it is useful to someone else !
X-Raym is offline   Reply With Quote
Old 04-07-2015, 12:10 PM   #26
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 4,772
Default

Ooh Gosh, i want these scripts so bad, i hope some other OSX users will chime in to test :0)
vanhaze is offline   Reply With Quote
Old 04-07-2015, 01:44 PM   #27
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,032
Default

@Vanhaze
I will test it on Mac soon.
X-Raym is offline   Reply With Quote
Old 04-07-2015, 02:07 PM   #28
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 4,772
Default

Ooh, fantastic , thank you in advance !

Meanwhile, if you have ideas about me testing it further, i really like to hear from you.

I was thinking of setting my current Reaper folder aside (user/Application support/Reaper)
and thus starting Reaper with a clean slate and thus testing your scripts again.
But then i forgot Reaper had to scan all my 350 VST plugin's all over (time is money) LOL.
vanhaze is offline   Reply With Quote
Old 04-08-2015, 02:24 AM   #29
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 4,772
Default

Hi !

I have some "good" news (!):

This morning, i tested both scripts on my other mac and they work !!
This mac has the very same soft installed as the mac where the scripts don't work on:

OSX 10.10.2 , Reaper 50pre22, 64bit.

So i assume there's something fishy going on, maybe some corruption in my Reaper setup, on the "faulty" mac.
vanhaze is offline   Reply With Quote
Old 04-08-2015, 02:29 AM   #30
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,032
Default

@Vanhaze
That's an awesome news
Thanks for testing !!

(and have fun with it :P)
X-Raym is offline   Reply With Quote
Old 04-08-2015, 02:16 PM   #31
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 4,772
Default

Thx X-Raym !

And big hands up for all your effort in making wonderful scripts : me and i know many others like them to the max !
vanhaze is offline   Reply With Quote
Old 04-10-2015, 01:33 AM   #32
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 4,772
Default

X-Raym: Just wanted to know that, magically, your scripts DO now work on my macbook also !
I have nothing changed in Reaper's settings or whatsever, but this morning i tried your scripts again
and now they just work , hooray !!
vanhaze is offline   Reply With Quote
Old 04-10-2015, 02:38 AM   #33
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,032
Default

@Vanhaze
Aaaaah, nice !
I didn't change anything from my side either so... We will never know haha but as it works, then... Have fun with it :P
Thanks for your testing and your enthousiastic feedbacks !
X-Raym is offline   Reply With Quote
Old 04-10-2015, 03:55 AM   #34
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 4,772
Default

Thank you Sir, i am so happy with your scripts , awesome stuff !
vanhaze is offline   Reply With Quote
Old 04-10-2015, 05:11 AM   #35
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,032
Default

@vanhaze
Be sure your positive comments are well received

I'm considering a vertical MIDI note selector based on mouse and grid length, don't know yet exactly how to do it...
Do you think it can be useful ? for selecting chords for exemple ?
X-Raym is offline   Reply With Quote
Old 04-10-2015, 05:44 AM   #36
Ozymandias
Human being with feelings
 
Join Date: Apr 2011
Posts: 144
Default

X-Raym,

Many thanks for this & great work!

If you're interested in expanding on these scripts, here's something I would love to be able to do (if possible!)...

Have two scripts that add or subtract note selection (same pitch) relative to the note to the right of the mouse cursor. Here's a demo of what I mean:



As you execute the first script, it will add notes right OR subtract notes from the left, changing behaviour as it passes the "mouse note". As you execute the second script, it will add notes left OR subtract notes from the right (again, changing behaviour as it passes the "mouse note").

Does that make sense?
Ozymandias is offline   Reply With Quote
Old 04-10-2015, 08:38 AM   #37
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,032
Default

@Ozymandias
Hi !
Thanks for your support and thanks your suggestions !

I don't plan to make it for the moment, this may be more complicated to code than it sounds, and would surely not be designed to behave exactly as you would like (as when there will be just one note selected, or none, there will be no way to determine the direction of the selection).
So if it has to be scripted, it will probably 4 scripts
  • Expand note selection on the left at mouse cursor (with same pitch)
  • Shrink note selection on the left at mouse cursor (with same pitch)
  • Expand note selection on the right at mouse cursor (with same pitch)
  • Shrink note selection on the right at mouse cursor (with same pitch)
(these are not definitive name of course)


Feel free to edit my script to make some test !

--
About the vertical version of the script, I struggle with one thing. Almost ready but... Can't see what's wrong.
X-Raym is offline   Reply With Quote
Old 04-10-2015, 10:54 AM   #38
Ozymandias
Human being with feelings
 
Join Date: Apr 2011
Posts: 144
Default

Thanks & understood! I'll dabble with your code in the meantime.
Ozymandias is offline   Reply With Quote
Old 04-12-2015, 04:56 PM   #39
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,032
Default

Thanks to FnA, I manage to finish the verticla version of the scripts (grid based).
It select all notes that start, ends, or pass through the grid section wich contains the mouse.
There is two scripts:
  • X-Raym_Select-Unselect all MIDI notes under mouse based on grid.eel
  • X-Raym_Select-Unselect all MIDI notes over mouse based on grid.eel
See the demo in first post

cheers !
X-Raym is offline   Reply With Quote
Old 04-12-2015, 06:58 PM   #40
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 2,173
Default

At first I thought it wasn't working right, then I noticed I had dotted grid on. I don't usually use that. Triplet grid is not quite right either. Straight grid seems good.

The other scripts (left/right) seem to be working here in v5 pre too.

Edit- problem seems to be note with end snapped to grid line in previous grid space gets selected in triplet grid.

Last edited by FnA; 04-12-2015 at 08:48 PM.
FnA 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 01:26 AM.


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