Old 12-29-2016, 12:01 PM   #1
hopi
Human being with feelings
 
hopi's Avatar
 
Join Date: Oct 2008
Location: Right Hear
Posts: 15,618
Default Strange thought, ...,maybe request

because of Lokasana's chord helper lua, I've been using some of the monster reascale files... all good

Now I'm wondering this:

Imagine a MIDI track with tons of notes on it... not set to a scale snap

OK now load up a reascale file for say a pentatonic scale and turn on scale snap and let's say set the key to D... [or whatever]

OK so now we see in the MIDI Ed. many grayed out keys, and because of the MIDI file there are notes on all those grayed out keys.

So if I want to delete or mute those notes, I can rt clk the key they are on to select all notes in the row and hit delete button [or mute]

Alright... so what I'm wondering is would it be possible to accomplish this in one stroke with a script?

Like, it would select all notes on the grayed out keys and let you delete them?

thanks for listening %^)
__________________
...should be fixed for the next build... http://tinyurl.com/cr7o7yl
https://soundcloud.com/hopikiva
hopi is offline   Reply With Quote
Old 12-29-2016, 12:09 PM   #2
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

Should be pretty easy.
Code:
1. Get the current key-snap key + scale and parse them into a list of legal notes.

2. Select all notes in the current item.

3. For each note, see if its value % 12 is legal.

4. If it's not, delete it.
I'll see what I can do if I have time this afternoon.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 12-29-2016, 01:25 PM   #3
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

This seems to do the job: https://github.com/ReaTeam/ReaScript...nt%20scale.lua

Should be up on ReaPack in a bit.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 12-29-2016, 05:00 PM   #4
hopi
Human being with feelings
 
hopi's Avatar
 
Join Date: Oct 2008
Location: Right Hear
Posts: 15,618
Default

first of all, thanks so much for looking into this...

It is EXACTLY what I wanted... golly it is even the right size and color!!!

At first I did not think it was working but then realized I had to first select all notes for it to work... and then it does it perfectly.

So clearly I can make a custom action to select all notes and then run this lua...

however, that brings to mind a thought about a refinement... I'll explain and perhaps you will tell me what you think.

What if, instead of directly deleting the grayed out notes, it set them all to muted... but left them in place ...so that the user could listen and think about possibly unmuting a few here and there in the future...

...and then having another script that would look at the track and delete all muted notes...

I'm thinking that way a few custom actions could be made.

One to simply select all,directly delete, then unselect all.
Another to select all, set unwanted grayed out to mute, then unselect all.

and then the delete all muted lua could be tacked on the the end of that or run separately...

Good idea or am I off the deep end?
__________________
...should be fixed for the next build... http://tinyurl.com/cr7o7yl
https://soundcloud.com/hopikiva
hopi is offline   Reply With Quote
Old 12-29-2016, 07:13 PM   #5
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

So if someone were to replace that script with these...

Lokasenna_Delete all notes outside the current scale.lua
Lokasenna_Delete selected notes outside the current scale.lua
Lokasenna_Mute all notes outside the current scale.lua
Lokasenna_Mute selected notes outside the current scale.lua

...that might tickle your fancy?

There's already a native action for "Select All Muted Notes", so the rest should be pretty simple.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 12-30-2016, 09:42 AM   #6
hopi
Human being with feelings
 
hopi's Avatar
 
Join Date: Oct 2008
Location: Right Hear
Posts: 15,618
Default

Thank you yet again... and yes, that should provide the ammunition to handle the situation a few different ways...

You are so good!

[small donation sent and more when I have it]
__________________
...should be fixed for the next build... http://tinyurl.com/cr7o7yl
https://soundcloud.com/hopikiva
hopi is offline   Reply With Quote
Old 12-30-2016, 11:36 AM   #7
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

Any time.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 12-31-2016, 10:00 AM   #8
hopi
Human being with feelings
 
hopi's Avatar
 
Join Date: Oct 2008
Location: Right Hear
Posts: 15,618
Default

Quote:
Originally Posted by Lokasenna View Post
Any time.
Oh good... thanks for saying that and I will most likely call on you again for another crazy idea... %^)
__________________
...should be fixed for the next build... http://tinyurl.com/cr7o7yl
https://soundcloud.com/hopikiva
hopi 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 09:33 AM.


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