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

Reply
 
Thread Tools Display Modes
Old 08-08-2019, 12:55 AM   #1
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default MIDI Editor Snap to Scale & Chord Guide

These will create snap guides for midi notes,
the second one will run independent of ReaTrak using the Lokasenna GUI
this is installed via ReaPack, just run the Script: Set Lokasenna_GUI v2 library path.lua first.
The other 2 will run with ReaTrak and use the local GUI Library and other scripts.

right click Save Link/Target As
ReaTrak create midi scale (snap guide).lua

ReaTrak create midi scale (snap guide) (Lokasenna GUI library).lua
Select the whole song or part,
run the script
set the Key & Scale
hit the green button.
The Chord Snap Guide button in ReaTrak will create the Midi Chord Snap Guide track.
Both scripts will set the Editor to color notes by channel,
scale note will be blue, chord root and slash notes will be green and other chord notes yellow.
If you have issues seeing the colors because of your theme you can use the default midi note color map or you can set the midi editor to color notes by Track and set the Midi Scale track color to whatever you like, it just won't show the root of the chord a different color if you are using the Midi Chord Snap Guide so you can switch back to color notes by Channel.
Will update them both in the next ReaTrak release.

See if it is working correctly and I can add some more scales.

Full Screen



You can also set the note color to Track:

__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak

Last edited by MusoBob; 08-08-2019 at 06:27 PM.
MusoBob is offline   Reply With Quote
Old 08-08-2019, 09:29 AM   #2
hopi
Human being with feelings
 
hopi's Avatar
 
Join Date: Oct 2008
Location: Right Hear
Posts: 15,618
Default

Thanks Bob... this is almost great for me... however I suppose due to the theme and MIDI color map I use, the item that holds the snap to track is colored just as strongly as the track with the real notes on it...
The result is that the snap to track essentially obliterates the real notes...

In your shown examples it is dimmed way down which is what I'd like to see, ...but I don't see that. I'm pretty sure this is a problem internal to reaper theme, etc. Any ideas?
__________________
...should be fixed for the next build... http://tinyurl.com/cr7o7yl
https://soundcloud.com/hopikiva
hopi is offline   Reply With Quote
Old 08-08-2019, 11:33 AM   #3
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

You need to have only the "eye" selected and not the edit "lock",
else you can change the midi note color map to the default.

__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak

Last edited by MusoBob; 08-08-2019 at 12:26 PM.
MusoBob is offline   Reply With Quote
Old 08-08-2019, 03:32 PM   #4
hopi
Human being with feelings
 
hopi's Avatar
 
Join Date: Oct 2008
Location: Right Hear
Posts: 15,618
Default

thanks Bob... I'll see if that helps

EDIT: yeah it does help... and if I change the setting to color by velocity, then I can also change what the color of the shown notes is... that makes it even more workable for me
__________________
...should be fixed for the next build... http://tinyurl.com/cr7o7yl
https://soundcloud.com/hopikiva

Last edited by hopi; 08-08-2019 at 03:40 PM.
hopi is offline   Reply With Quote
Old 08-08-2019, 04:46 PM   #5
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

You can set the midi editor to color notes by Track and set the Midi Scale track color to whatever you like, it just won't show the root of the chord a different color if you are using the Midi Chord Snap Guide.

__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak

Last edited by MusoBob; 08-08-2019 at 06:20 PM.
MusoBob is offline   Reply With Quote
Old 11-26-2019, 03:33 PM   #6
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,134
Default

For the editor to display the guide notes in faint color under "Options when using one (MIDI) editor per project" submenu (found in the Track list context menu or main menu Contents) "(Media item) Selection is linked to visibility" option must be disabled.

It might make sense to disable this with the script in the background provided the user is notified. And notification of the notes coloration method change will also be fair to a user.

And thank you for sharing.

Last edited by Buy One; 11-26-2019 at 03:58 PM.
Buy One is online now   Reply With Quote
Old 11-26-2019, 11:44 PM   #7
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

Thanks, I was looking for that setting.
Try these and let me know if it works for you.

ReaTrak create midi scale (snap guide).lua
ReaTrak create midi chords from region chord name (snap guide).lua
ReaTrak create midi scale (snap guide) (Lokasenna GUI library).lua

Code:
  reaper.MIDIEditor_OnCommand(hwnd, 40739) -- color notes/CC by channel
  
  reaper.SetToggleCommandState( 3, 40818, 1 ) -- Contents: Show/hide track list ON
  
  reaper.SetToggleCommandState( 3, 40892, 0 ) -- Options: MIDI track list/media item lane selection is linked to visibility OFF  
 
  reaper.MIDIEditor_OnCommand(hwnd,2) -- File: Close MIDI Editor window 
  
  
     
  Info = [[
  Set Color notes/CC by channel
  Set Contents: Show/hide track list ON
  Set Options: MIDI track list/media item 
  lane selection is linked to visibility OFF
  ]]
  reaper.MB(Info, "Info Midi Editor Settings", 0)
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak

Last edited by MusoBob; 11-27-2019 at 12:27 AM.
MusoBob is offline   Reply With Quote
Old 11-27-2019, 08:15 AM   #8
nait
Human being with feelings
 
nait's Avatar
 
Join Date: Jun 2018
Location: Edmonton, AB, Canada
Posts: 1,391
Default

I'm pretty lazy about jumping on add-ons, but this looks like the one for me. Looks great! Can't wait to try this out later. Very nice work, MusoBob.
__________________
My Rig (also serves as my gaming PC): MSI Mag X570 Tomahawk Mobo, Ryzen R9 3900X, 32GB RAM, Samsung 960 Evo 500gb NVMe, Crucial 1TB NVMe, NVidia RTX 2080 Super, Arturia Minifuse 2, Nektar Impact LX25+ MIDI Controller Keyboard.
nait is offline   Reply With Quote
Old 11-27-2019, 08:58 AM   #9
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,134
Default

Quote:
Originally Posted by MusoBob View Post
Try these and let me know if it works for you.
Thank you, for the suggestion implementation as well, seems to work fine.

Do i understand correctly that ReaTrak create midi chords from region chord name (snap guide).lua script creates chords whose name is specified in the region name in the format listed within this script? And if so, can several chord names be specified in the region name and what must be their delimiter?

Last edited by Buy One; 11-27-2019 at 12:15 PM.
Buy One is online now   Reply With Quote
Old 11-27-2019, 12:45 PM   #10
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

Each chord has it's own region, so with other ReaTrak scripts it will snap midi notes that start within the region to chord notes, it will create chords from the chord name etc.. With other ReaTrak scripts you can split region insert new chord, remove chord and glue region. If you install the latest ReaTrak-xxConfigZIP all the ReaTrak scripts are put into Scripts\ReaTrak.
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   Reply With Quote
Old 11-27-2019, 02:33 PM   #11
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,134
Default

Got it, i haven't followed the development hence the question. After studying it a little bit i'm starting to understand the general principle.

I tested this script several times with C as the region name and i noticed that after G4 the notes sequence breaks, further up i get G#4 as the root, then C and D# and so one, which all have two copies sitting on top of each other.

Or maybe i'm using it wrongly because i get the exact same result with Gm in the region name, meaning it starts off as a C sequence then breaks.

Last edited by Buy One; 11-27-2019 at 02:53 PM.
Buy One is online now   Reply With Quote
Old 11-27-2019, 04:32 PM   #12
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

EDIT: sorry I thought you were snapping midi notes to chords, but it's just the snap guide you are creating ?

If you can upload a pic of the before after midi or upload the midi I can try it out.

I was thinking about making a GUI for it with a few options like mute notes greater than the chord note, say if you have a CMaj7 chord snapped to a CMaj it will mute the top note.
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak

Last edited by MusoBob; 11-27-2019 at 04:41 PM.
MusoBob is offline   Reply With Quote
Old 11-27-2019, 04:52 PM   #13
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

This is the snap guide I get when I create a 1 bar C region:

__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   Reply With Quote
Old 11-28-2019, 08:14 AM   #14
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,134
Default

Yes, exactly, simply running the script, here's a presentation

FULL SIZE

In the video the key snap happens to be enabled, but it doesn't affect the script's behavior because the result is the same with its being off.

This time the odd sequence was a bit different in terms of the intervals.

Maybe it's because of my older version of the program?

Last edited by Buy One; 11-29-2019 at 12:10 PM.
Buy One is online now   Reply With Quote
Old 11-28-2019, 03:29 PM   #15
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

Try that
ReaTrak create midi chords from region chord name (snap guide).lua
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   Reply With Quote
Old 11-29-2019, 09:16 AM   #16
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,134
Default

In terms of chord structure the new script works properly but unfortunately exhibits two new issues, it creates 4 bars long MIDI item regardless of the region span, and sets loop points to region

BTW does this script depend on other Reatrak scripts or do SWS/S&M extensions suffice?

Last edited by Buy One; 11-29-2019 at 12:08 PM.
Buy One is online now   Reply With Quote
Old 11-29-2019, 12:34 PM   #17
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

I copied any ReaTrak scripts to an internal function so if should only need SWS/S&M.
You will have to send another pic of what you mean.
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   Reply With Quote
Old 11-29-2019, 01:19 PM   #18
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,134
Default

OK

Please take a look

First i ran the new version, then the previous to highlight the difference
Buy One is online now   Reply With Quote
Old 11-29-2019, 02:51 PM   #19
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

ReaTrak create midi chords from region chord name (snap guide)2.lua
is 2 the new or old ?

what start measure have you got it set on as I tried it with -1 & -3 ?

as this is what I get:

__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   Reply With Quote
Old 11-29-2019, 03:46 PM   #20
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,134
Default

2 is the newer version which is glitchy on my end as far as length and adding loop points are concerned

my measure start was 0, it can be seen on my gif, just like it is for the new version on your screenshot

then i gave it another shot and discovered another oddity, while having two regions and trying to create an item for the farther one on the timeline the item was consistently being created under the one earlier on the timeline instead

in this case the item length fit the earlier region perfectly, but the guide notes were always shorter

Last edited by Buy One; 11-29-2019 at 04:00 PM.
Buy One is online now   Reply With Quote
Old 11-29-2019, 03:56 PM   #21
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

But what's the bar offset in Project settings > Project start measure
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   Reply With Quote
Old 11-30-2019, 03:17 AM   #22
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,134
Default

Oh sorry, misread your question, my project start measure was -2

I just tested with it being 0, the result is virtually the same only that this time the item created under another (earlier non-selected) region is still 4 bars long but the notes length fits that particular region

May be i don't use it correctly... what i do is set time selection to region and run the script
Buy One is online now   Reply With Quote
Old 11-30-2019, 08:35 AM   #23
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

It might be some other setting that's different to what I have Reaper set to ??
This is how I use it:

ReaTrak Chord Snap Guide animation

Try View > Region Manager > right click Import Regions
and import one of the .csv below

http://reatrak.com/downloads/test_files/templates/
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   Reply With Quote
Old 11-30-2019, 02:20 PM   #24
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,134
Default

I tested with http://reatrak.com/downloads/test_fi...ountry%20G.csv
and
http://reatrak.com/downloads/test_fi...huffle%20A.csv

The regions loaded from measure 1 (the project start measure was both 0 and 1), after applying the script
A. the first region was filled with notes only halfway, the remaining half was empty of notes,
B. the MIDI item length was short of the very last region, it didn't get beyond the end of the penultimate region. Tried extending time selection beyond the last region, didn't help.

This behavior was consistent.

I guess the bottom line is if i'm the only one for whom it doesn't work, then don't mind me, we'll leave it as it stands
Buy One is online now   Reply With Quote
Old 11-30-2019, 03:32 PM   #25
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

I would like to find out where the problem is.
Try this, it will do it step by step and you can see where it stuffs up.
ReaTrak create midi chords from region chord name (snap guide) - test.lua
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   Reply With Quote
Old 12-01-2019, 03:53 AM   #26
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,134
Default

Alright then

With individual region the item as well as the notes in it were consistently 1 bar long regardless of the region length

With the regions imported from Blues Shuffle A.csv file
A. first region got 2 items, one half its length, the second one with proper length, they were created one by one
B. the last region still didn't get any item
Buy One is online now   Reply With Quote
Old 12-01-2019, 10:23 AM   #27
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

The script is pretty basic,
it will select the region,
insert new midi item,
length = reaper.BR_GetMidiSourceLenPPQ(take) -- length of region/midi item
insert the chord notes length in the midi item,
select the next region,
....

Regions-Midi-Items.gif

if you could post a pic it would help, you don't have to do all the regions, just do some of the regions.
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   Reply With Quote
Old 12-02-2019, 12:54 AM   #28
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,134
Default

Please check out the movie
Buy One is online now   Reply With Quote
Old 12-02-2019, 05:27 PM   #29
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

Try this I re-wrote it to work better:
ReaTrak create midi chords from region chord name (snap guide) - test3.lua
It will skip regions with @ as a prefix so you can use other regions besides chord names.
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   Reply With Quote
Old 12-03-2019, 04:58 AM   #30
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,134
Default

So far seems to work properly in different combinations of regions both in terms of names and of distribution on the timeline
Buy One is online now   Reply With Quote
Old 12-03-2019, 05:28 AM   #31
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

That's good thanks for finding issues and testing it.
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   Reply With Quote
Old 12-03-2019, 07:58 AM   #32
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,134
Default

If i could suggest another thing (and if it's feasible), it's to make the script more robust by forcing it to completely ignore unrelated regions, including those not specifically marked with @ symbol. Currently under unnamed regions it creates items with a C chord broken sequence, a bug which i initially reported to be affecting relevant regions, and under named regions it creates an item with a C and a G# notes spread across 6 first and 5 last octaves respectively.

But that's at your discretion of course and thank you for sharing the script.
Buy One is online now   Reply With Quote
Old 12-03-2019, 01:01 PM   #33
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

Try this :
ReaTrak create midi chords from region chord name (snap guide) - test3.lua

if region_name == "" then i = i +1 goto skip_region end
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   Reply With Quote
Old 12-04-2019, 11:59 AM   #34
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,134
Default

It still creates items under unnamed regions only devoid of any notes.
Buy One is online now   Reply With Quote
Old 12-04-2019, 03:21 PM   #35
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

It has to do that otherwise you won't have 1 item that shows through the other midi item that are on top of that layer that you want to snap the notes to.

If you need it that way just take the GLUE command out of the script.
--reaper.Main_OnCommand(40421,0) -- Item: Select all items in track
--reaper.Main_OnCommand(41588,0) -- Item: Glue items

ReaTrak create midi chords from region chord name (snap guide) - no glue.lua

then you can manually glue any you like.
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   Reply With Quote
Old 12-05-2019, 03:36 AM   #36
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,134
Default

Yeah, i think it's better this way.

What i meant though was that the script ignore irrelevant regions regardless of the @ symbol presence. But this is nitpicking really so i don't want to nag you any further about that.

Could you maybe tell where in the script i can disable automatic notes selection in the MIDI item, which happens with its latest no-glue version. I guess it has to do with the fact that now all items are separate. I've managed to make it deselect notes in the last item, but not in the rest. If it's not easily possible, never mind.

Last edited by Buy One; 12-05-2019 at 03:43 AM.
Buy One is online now   Reply With Quote
Old 12-05-2019, 04:08 AM   #37
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

The @ lets you name the regions "@ Chorus" "@ Verse" "@ Bring in FX"

at the bottom of the script add this
Code:
reaper.MIDI_SelectAll( take, 0)
just above
Code:
::skip_region::

and add
Code:
reaper.Main_OnCommand(40289, 0) -- Item: Unselect all items
just above
Code:
  Info = [[
  Set Color notes/CC by channel
So just click Edit then Ctrl+S to save n run.

reaper.Main_OnCommand(40289, 0) -- Item: Unselect all items
the command numbers you get by right click in the Action list
Copy Selected action commandID or text

If it's a non Reaper Command for user script or SWS
Code:
  commandID2 = reaper.NamedCommandLookup("_SWS_CREATETRK1")
  reaper.Main_OnCommand(commandID2, 0) -- SWS: Create and select first track

__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   Reply With Quote
Old 12-06-2019, 03:44 AM   #38
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,134
Default

That does it. Thank you very much for such a thorough explanation.
Buy One is online now   Reply With Quote
Old 12-06-2019, 03:48 AM   #39
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

Ok what's next ? lol
Thanks for your help in getting it working better.
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   Reply With Quote
Old 12-06-2019, 11:30 AM   #40
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,134
Default

I guess you're the one to decide, i'm just an average user who occasionally finds glitches.
Buy One is online now   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 04:54 AM.


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