I have my Chord Track (Region Names)
I can convert the Chord Name to a Reascale value.
I select the first Chord Region
Open MIDI Item in Editor
"Edit: Select all notes starting in time selection"
to snap those MIDI notes in the current time selection (Chord Region)
I get the Region name and from that get the chord root name
I get the Region name and from that get the chord type and convert to a reascale value.
Code:
root, chord = string.match(region_name, "(%w[#b]?)(.*)$")
if not chord or #chord == 0 then chord = "Maj" end
I have a script to do all the above,
now this is what I need help with,
edit
Script: mpl_Snap takes to scale.lua and trim it down (without GUI) to snap the selected MIDI notes to:
Key= (root note of Region Chord name)
function LoadScale() = "Reascale value of Region Chord type"
the mpl script is using it's own scale that the notes are snapped to, not Reapers (there is
Script: mpl_Snap selected notes to scale.lua but it just uses what reascale the MIDI Editor is set to (that can't be set with reascipt !)):
Code:
function LoadScale()
local content = [[
// Scales use same syntax as .reascale files
"Major" 100030050000
"Minor" 100300050000
"Diminished" 100300500000
"Augmented" 100030005000
"Sus 4" 100004050000
"Sus 2" 102000050000
"Flat 5" 100030500000
"Major 7" 100030050007
"Major 7 #5" 100030005007
"Major 7 b5" 100030500007
"Dominant 7" 100030050070
"Dominant 7 #5" 100030005070
"Dominant 7 b5" 100030500070
"Minor Major 7" 100300050007
"Dim Major 7" 100300500007
"Minor 7 b5" 100300500070
"Diminished 7" 100300500700
"Minor 7" 100300050070
"minor 7 b5" 100300005070
"Dominant sus 4" 100004050070
"Major sus 4" 100004050007
"Major 6" 100030050600
"Minor 6" 100300050600
"Major add 9" 109030050000
"Minor add 9" 109300050000
"Major 9" 109030050007
"Maj 9 #5" 109030005007
"Maj 9 b5" 109030500007
"Dominant 9" 109030050070
"Dom 9 b5" 109030500070
"Dom 9 #5" 109030005070
"Dom 7 #9" 100930050070
"Dom 7 b9" 190030050070
"Dom 7 #5 #9" 100930005070
"Dom 7 #5 b9" 190030005070
"Dom 7 b5 #9" 100930500070
"Dom 7 b5 b9" 190030500070
"Dom 9 sus 4" 109004050070
"Min 9" 109300050070
"Min 9 Maj 7" 109300050007
"Dim Maj 9" 109300500007
"Min 9 b5" 109300500070
"Min 6/9" 109300050600
"Maj 6/9" 109030050600
"Maj 6/11" 10003B050600
"Min 6/11" 10030B050600
"Maj 9 #11" 109030B50007
"Maj 9 #5 #11" 109030B05007
"Dom 9 #11" 109030B50070
"Dom 7 #9 #11" 100930B50070
"Dom 7 b9 #11" 190030B50070
"Dom 7" 10900B050070
"Min 11" 10930B050070
"Min 11 b5" 10930B500070
"Maj 13 #11" 109030B50D07
"Dom 13 #11" 109030B50D70
"Dom 13 sus 4" 109004050D70
"Dom 13 b9" 190030050D70
"Dom 13" 109030050D70
"Dom 13 b9 sus 4" 190004050D70
"Min 13" 10930B050D70]]