Old 05-26-2018, 04:51 AM   #1
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default Reascale Format & Chords

I got all my chords in format chord=Maj9, notes=0,4,7,11,14
is there a scrip to convert the notes to reascale format
"Maj9" 109030050000 as I have a lot to do,
not sure what the format is, I saw 0 = scale, 1 = chord ???

Last edited by MusoBob; 05-26-2018 at 04:57 AM.
MusoBob is offline   Reply With Quote
Old 05-26-2018, 07:36 PM   #2
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

I got it worked out now it's morning and the brain is in gear.
The Maj9 I copied should have had a 7 on the end
1 "Major 9" 109030050007

so if it's C base
1 root (C)
0 (C#)
9 octave up (D)
0 (D#)
3 (E)
0 (F)
0 (F#)
5 (G)
0 (G#)
0 (A)
0 (A#)
7 (B)





C D E G B
Maj9, notes=0,4,7,11,14
1 "Major 9" 109030050007




C D D# G A#
chord=m9 notes=0,3,7,10,14
1 "Min 9" 109300050070
MusoBob is offline   Reply With Quote
Old 05-26-2018, 09:07 PM   #3
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

My Theory Helper script has to do this too. Have a look at the function convert_reascale; it might be helpful.

https://github.com/ReaTeam/ReaScript...y%20Helper.lua
__________________
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 05-26-2018, 11:13 PM   #4
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

Thanks I'll check that out.

I did a basic one that worked but will need a lot of elseif's:

Code:
x1=1
x2=0
x3=0
x4=0
x5=0
x6=0
x7=0
x8=0
x9=0
x10=0
x11=0
x12=0

notes = {0,4,7,11,14}

  if notes[2] == 3 then x4=3
  elseif notes[2] == 4 then x5=3

  if not notes then end
  end
  
  if notes[3] == 7 then x8=5
  elseif notes[3] == 8 then x9=5

  if not notes then end
  end
  
  if notes[4] == 10 then x11=7
  elseif notes[4] == 11 then x12=7


  if not notes then end
  end  
  
  if notes[5] == 14 then x3=9
  elseif notes[5] == 15 then x4=9


  if not notes then end
  end  

reascale = (x1 .. x2 .. x3 .. x4 .. x5 .. x6 .. x7 .. x8 .. x9 .. x10 .. x11 .. x12)
MusoBob is offline   Reply With Quote
Old 05-27-2018, 12:46 AM   #5
zappadave
Human being with feelings
 
zappadave's Avatar
 
Join Date: Jan 2008
Posts: 1,257
Default

https://stash.reaper.fm/v/8067/ZD-Chords.reascale
__________________
Music is the best
เพลง ที่ดีที่สุดคือ
zappadave is offline   Reply With Quote
Old 05-27-2018, 01:37 AM   #6
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

Thanks I have them but I have a lot more chords than available in them.
MusoBob is offline   Reply With Quote
Old 05-27-2018, 10:49 AM   #7
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

Alright, I spent some time trying to make a more comprehensive set of converter functions. Almost got there, but not quite.

- My code works for most scales. For chords and scales with passing tones, or missing degrees, it will get all of the correct notes but not the degrees.
- Your code is hit-and-miss for chords once you get beyond the basics.

(no_degs is my conversion, degs is yours)

Scales:
Code:
Phrygian:
original	120304056070
array   	0, 1, 3, 5, 7, 8, 10
nodegs  	120304056070	matches
w/ degs 	100300055070	doesn't match

Lydian:
original	102030450607
array   	0, 2, 4, 6, 7, 9, 11
nodegs  	102030450607	matches
w/ degs 	100030050007	doesn't match
Chords:
Code:
Minor:
original	100300050000
array   	0, 3, 7
nodegs  	100200030000	doesn't match
w/ degs 	100300050000	matches

Diminished:
original	100300500000
array   	0, 3, 6
nodegs  	100200300000	doesn't match
w/ degs 	100300000000	doesn't match

Augmented:
original	100030005000
array   	0, 4, 8
nodegs  	100020003000	doesn't match
w/ degs 	100030005000	matches

Sus 4:
original	100004050000
array   	0, 5, 7
nodegs  	100002030000	doesn't match
w/ degs 	100000050000	doesn't match

Here's my test script. Save it, run it in Reaper, and it will look spit out the conversions for a bunch of scales and chords: https://www.dropbox.com/s/h8nzc4ph8v...scale.lua?dl=0
__________________
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 05-27-2018, 02:15 PM   #8
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

Thanks again !! I'll try that out.
If they had reaper.MIDI_SetScale it would help as I have the chord name in the region then I need to get any midi within the chord region to snap to that chord.

Like this https://www.dropbox.com/s/pes9yfm864...hange.gif?dl=0
MusoBob is offline   Reply With Quote
Old 05-27-2018, 06:24 PM   #9
zappadave
Human being with feelings
 
zappadave's Avatar
 
Join Date: Jan 2008
Posts: 1,257
Default

Quote:
Originally Posted by MusoBob View Post
Thanks I have them but I have a lot more chords than available in them.
I had more but never converted them to Reascale.
Secundal, Quartal, Quintal and compound chords.
I put these into files for the Chordz plugin.

This looks very interesting
__________________
Music is the best
เพลง ที่ดีที่สุดคือ
zappadave is offline   Reply With Quote
Old 05-29-2018, 03:28 AM   #10
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

I was going good until I found B & D in the Reascale

1 "Maj 13 #11" 109030B50D07
notes=0,4,7,11,14,18,21
for
1 "Min 6/11" 10030B050600
notes=0,3,7,9,17
I got 100309050600

Will go to bed now and add some more elseif's tomorrow.
MusoBob is offline   Reply With Quote
Old 05-30-2018, 03:00 PM   #11
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

This seems to work with all the reascale chords notes I have put in the --Input

The only ones I have to try with B's & D's are ZD's
Code:
0 "Maj 6/11"        10003B050600
0 "Min 6/11"        10030B050600
0 "Maj 9 #11"       109030B50007
0 "Maj 9 #5 #11"    109030B05007
0 "Dom 9 #11"       109030B50070
0 "Dom 7 #9 #11"    100930B50070
0 "Dom 7 b9 #11"    190030B50070
0 "Dom 7"           10900B050070
0 "Min 11"          10930B050070
0 "Min 11 b5"       10930B500070
0 "Maj 13 #11"      109030B50D07
0 "Dom 13 #11"      109030B50D70
0 "Dom 13 sus 4"    109004050D70
0 "Dom 13 b9"       190030050D70
0 "Dom 13"          109030050D70
0 "Dom 13 b9 sus 4" 190004050D70
0 "Min 13"          10930B050D70
Not sure about the scales as in the Blues it has F,F# as 4,4 not 4,5

Blues:
original 100304450070
array 0, 3, 5, 6, 7, 10


Whole Tone:
original 102030506070
array 0, 2, 4, 6, 8, 10

This is how I have it
Code:
notes C        C C# D D#E F F#G G#A  A# B
reascale pos   1 2  3 4 5 6 7 8 9 10 11 12
reascale value 1 2  2 3 3 4 5 5 6 6  7  7
transpose      1 9  9 9 9 B B B B D D D D
Code:
-- Display a message in the console for debugging

function Msg(variable)
  reaper.ShowConsoleMsg(tostring(variable).."\n")
end


x1=1
x2=0
x3=0
x4=0
x5=0
x6=0
x7=0
x8=0
x9=0
x10=0
x11=0
x12=0




--Input
orgreascale = "100030050070"
chord = "dom7"
notes = {0, 4, 7, 10}





  if notes[2] == 1 then x2=2
  elseif notes[2] == 2 then x3=2
  elseif notes[2] == 3 then x4=3
  elseif notes[2] == 4 then x5=3
  elseif notes[2] == 5 then x6=4
  elseif notes[2] == 6 then x7=5
  elseif notes[2] == 7 then x8=5
  elseif notes[2] == 8 then x9=6
  elseif notes[2] == 9 then x10=6
  elseif notes[2] == 10 then x11=7
  elseif notes[2] == 11 then x12=7
  elseif notes[2] == 13 then x2=9
  elseif notes[2] == 14 then x3=9
  elseif notes[2] == 15 then x4=9
  elseif notes[2] == 16 then x5=9
  elseif notes[2] == 17 then x6="B"
  elseif notes[2] == 18 then x7="B"

  end
  
  if notes[3] == 3 then x4=3 
  elseif notes[3] == 4 then x5=3
  elseif notes[3] == 5 then x6=4
  elseif notes[3] == 6 then x7=5
  elseif notes[3] == 7 then x8=5
  elseif notes[3] == 8 then x9=6
  elseif notes[3] == 9 then x10=6
  elseif notes[3] == 10 then x11=7
  elseif notes[3] == 11 then x12=7
  elseif notes[3] == 13 then x2=9
  elseif notes[3] == 14 then x3=9
  elseif notes[3] == 15 then x4=9
  elseif notes[3] == 16 then x5=9
  elseif notes[3] == 17 then x6="B"
  elseif notes[3] == 18 then x7="B"

  end
  
  if notes[4] == 5 then x6=4
  elseif notes[4] == 6 then x7=5
  elseif notes[4] == 7 then x8=5
  elseif notes[4] == 8 then x9=6
  elseif notes[4] == 9 then x10=6
  elseif notes[4] == 10 then x11=7
  elseif notes[4] == 11 then x12=7
  elseif notes[4] == 13 then x2=9
  elseif notes[4] == 14 then x3=9
  elseif notes[4] == 15 then x4=9
  elseif notes[4] == 16 then x5=9
  elseif notes[4] == 17 then x6="B"
  elseif notes[4] == 18 then x7="B"  
  elseif notes[4] == 19 then x8="B"
  elseif notes[4] == 20 then x9="B"
  elseif notes[4] == 21 then x10="D"
  elseif notes[4] == 22 then x11="D"
  elseif notes[4] == 23 then x12="D"
   
  end  


  if notes[5] == 6 then x7=5 
  elseif notes[5] == 7 then x8=5
  elseif notes[5] == 8 then x9=6
  elseif notes[5] == 9 then x10=6
  elseif notes[5] == 10 then x11=7
  elseif notes[5] == 11 then x12=7
  elseif notes[5] == 13 then x2=9
  elseif notes[5] == 14 then x3=9
  elseif notes[5] == 15 then x4=9
  elseif notes[5] == 16 then x5=9
  elseif notes[5] == 17 then x6="B"
  elseif notes[5] == 18 then x7="B"
  elseif notes[5] == 19 then x8="B"
  elseif notes[5] == 20 then x9="B"
  elseif notes[5] == 21 then x10="D"
  elseif notes[5] == 22 then x11="D"
  elseif notes[5] == 23 then x12="D"
  
  end  


  
  if notes[6] == 7 then x8=6
  elseif notes[6] == 8 then x9=6
  elseif notes[6] == 9 then x10=6
  elseif notes[6] == 10 then x11=7
  elseif notes[6] == 11 then x12=7
  elseif notes[6] == 13 then x2=9
  elseif notes[6] == 14 then x3=9
  elseif notes[6] == 15 then x4=9
  elseif notes[6] == 16 then x5=9
  elseif notes[6] == 17 then x6="B"
  elseif notes[6] == 18 then x7="B"
  elseif notes[6] == 19 then x8="B"
  elseif notes[6] == 20 then x9="B"
  elseif notes[6] == 21 then x10="D"
  elseif notes[6] == 22 then x11="D"
  elseif notes[6] == 23 then x12="D"
  
  end   


  if notes[7] == 7 then x8=7
  elseif notes[7] == 8 then x9=7
  elseif notes[7] == 9 then x10=7
  elseif notes[7] == 10 then x11=7
  elseif notes[7] == 11 then x12=7
  elseif notes[7] == 13 then x2=9
  elseif notes[7] == 14 then x3=9
  elseif notes[7] == 15 then x4=9
  elseif notes[7] == 16 then x5=9
  elseif notes[7] == 17 then x6="B"
  elseif notes[7] == 18 then x7="B"
  elseif notes[7] == 19 then x8="B"
  elseif notes[7] == 20 then x9="B"
  elseif notes[7] == 21 then x10="D"
  elseif notes[7] == 22 then x11="D"
  elseif notes[7] == 23 then x12="D"
  
  end   


reascale = (x1 .. x2 .. x3 .. x4 .. x5 .. x6 .. x7 .. x8 .. x9 .. x10 .. x11 .. x12)




              

if notes[3] == nil then notes[3] = 0 end
if notes[4] == nil then notes[4] = 0 end
if notes[5] == nil then notes[5] = 0 end
if notes[6] == nil then notes[6] = 0 end
if notes[7] == nil then notes[7] = 0 end

Msg("Chord")
Msg(chord)
Msg("Notes")
Msg(notes[1] .. notes[2] .. notes[3] .. notes[4] .. notes[5] .. notes[6] .. notes[7])
Msg("Original Reascale")
Msg(orgreascale)
Msg("Culculated Reascale")
Msg(reascale)
MusoBob is offline   Reply With Quote
Old 06-23-2018, 06:19 AM   #12
kamalmanzkie
Human being with feelings
 
kamalmanzkie's Avatar
 
Join Date: Jul 2012
Location: inside a man
Posts: 84
Default

man... i could almost count the number of times i searched out exactly this information and came to the same bridge as you and instead got mad and lazy and ended up doing something else. probably more than 5

there was just enough uncertainty about what chords to pick and how best to represent them in some integer notation. i guess the waiting game paid off?

im trying to engineer chord type from midi input, and i think this is exactly what i need. (actually since it is reaktor theres the added sport of working out a way to import it as a 1d table that disallows leading zeros or spaces)
__________________
get a grip, play my tracks : https://soundcloud.com/an-colonel-aronson
kamalmanzkie 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 06:03 AM.


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