back to list

Dimension 31

🔗genewardsmith <genewardsmith@...>

1/14/2011 1:14:10 PM

If you round off Michael's EC scale in 31 equal, you get 323143232314. If you mutate it to a (13 cent tolerance) lesfip scale and round off, you get the same 31et scale. For ec2, the 31 version goes 531432323122, and again the lesfip version gives the same 31et version. They are all pretty close. This makes me think that for dimension scales, Michael might have an easier time of it if he simply created scales that were 12 note subsets of 31edo.

🔗genewardsmith <genewardsmith@...>

1/14/2011 1:41:39 PM

--- In MakeMicroMusic@yahoogroups.com, "genewardsmith" <genewardsmith@...> wrote:
>This makes me think that for dimension scales, Michael might have an easier time of it if he simply created scales that were 12 note subsets of 31edo.

If we equate the various modes, there are 31 choose 11 = 84,672,315 12 note 31edo scales. Since Michael is already programming and running programs, he might code up a search for the 12-note 31et scales with the greatest number of dyads from his list. Taking those with the maximum number, we could further look at which are proper, etc. For extra credit, the odd limits for 7, 9 and 11, same thing. It would make an interesting article for tuning or tuning-math.

🔗Michael <djtrancendance@...>

1/14/2011 1:44:24 PM

Gene,
Firstly, thank you for taking the time to run all these little tests on my
scales...

Gene>"If you mutate it (Dimension EC1) to a (13 cent tolerance) lesfip scale and
round off, you get the same 31et scale."

I am not surprised...I already knew the 22/15 and many of the 11-limit
dyads in Dimension, for example, were in 31TET. The real bugger is that 13 cent
error (which dyad(s) approach that). That is because for some of those
sensitive 11-limit ratios I've found...anything over 8 cents or so completely
kills them (unlike tones like those near 5/4 which seem to have a much higher
tolerance).

>"For EC2, the 31 version goes 531432323122, and again the lesfip version gives
>the same 31et version."

Bizarre, the least squares optimization actually gives virtually the same
value as the original scale (or, within how many cents)...especially considering
my "minimize error of worst possible dyad" method of fine-tuning the scale is
often at odds with "least squares"... Any way you can post the lesfip version?
Note to self...I wish there was an easy way to, say, turn that 5 into a 4 or
decrease the number of different step sizes...

>"They are all pretty close. This makes me think that for dimension scales,
>Michael might have an easier time of it if he simply created scales that were
>12 note subsets of 31edo."

The question to me becomes how much does this alignment knock of dyadic
accuracy for the more sensitive dyads...I already knew a whole lot of the dyads,
in JI form, had 31TET equivalents. Or furthermore, will composing in 31TET
feel/sound significantly different? I am going to have to take a shot at
composing both "pure" and "31TET" versions. That and perhaps monkey around
with moving certain notes by 1 step or so to see if I can "get away" with less
different step sizes without killing the sense of balance.

>"Michael might have an easier time of it if he simply created scales that were
>12 note subsets of 31edo."

Indeed, I might...seems like, slight dyadic optimizations aside...everything
does fit in 31TET. And, of course, working in 31TET would make development a
lot quicker or, at "worst"...I'd be able to find something under 31TET and
simply fine-tune the ratios slightly.

[Non-text portions of this message have been removed]

🔗Michael <djtrancendance@...>

1/14/2011 2:13:50 PM

Gene>"Since Michael is already programming and running programs, he might code
up a search for the 12-note 31et scales with the greatest number of dyads from
his list."

Good idea!
If I have it right...(all) I should have to do is

A) Throw 12 loops to make the scale with each loop selecting one tone from the
31TET list...IE (pseudocode)
For tone = 1 to 31 - (12) 'you can't be further that starting at the step of
31TET where there are only 12 notes after and including that step...and still
have a 12tone scale.
{
for tone2 = tone to 31 - (11)
{
....................................etc.
}
}
...not quite sure how to do this part most efficiently as I should ideally as I
have to make sure none of the 12 notes is the same and, for best performance,
should obviously avoid testing the same scale twice.

B) In the center of the loops...check all possible intervals from each tone to
each other tone within 2 octave range and see how many of the combinations fit
the list of dyads. Add both the number of dyads contained and the scale steps
in 31TET to a scale record.

C) Print the entire scale record...ordered by highest number of matching dyads
first.

>"For extra credit, the odd limits for 7, 9 and 11, same thing."

Meaning, for example simply put a list of all seven limit dyads....and see
how many of them matched to a scale?

Perhaps another obvious step....make a version of this that works for any TET
tunings (IE add an outer loop that lets the user select from a list of TET
tunings, assigns notes, and loops through them all). Or let them choose the
desired number of notes in the scale (not quite sure how I would optimize the
tone = loop for this)...

[Non-text portions of this message have been removed]

🔗genewardsmith <genewardsmith@...>

1/14/2011 2:19:23 PM

--- In MakeMicroMusic@yahoogroups.com, Michael <djtrancendance@...> wrote:

> Bizarre, the least squares optimization actually gives virtually the same
> value as the original scale (or, within how many cents)...especially considering
> my "minimize error of worst possible dyad" method of fine-tuning the scale is
> often at odds with "least squares"... Any way you can post the lesfip version?

! EClesfip.scl
Lesfip scale from EC, 13 cents, 11-limit union {15/11, 22/15}
! approximately 323143232314 in 31et
12
!
114.87793
191.77017
311.62929
346.93942
501.24361
617.92004
697.71766
815.58126
888.24613
1004.76728
1045.29423
1200.00000

! EC2lesfip.scl
Lesfip scale from EC2, 13 cents, 11-limit union {15/11, 22/15}
! approximately 531432323122 in 31et
12
!
191.82959
309.08106
347.77355
502.90469
619.61886
695.58039
812.06094
889.40374
1006.00510
1045.42407
1122.07703
1200.00000

🔗genewardsmith <genewardsmith@...>

1/14/2011 2:25:50 PM

--- In MakeMicroMusic@yahoogroups.com, Michael <djtrancendance@...> wrote:
>
> Gene>"Since Michael is already programming and running programs, he might code
> up a search for the 12-note 31et scales with the greatest number of dyads from
> his list."
>
> Good idea!
> If I have it right...(all) I should have to do is

I think you are making it harder than you need to. I would include 31 (or 0, if you prefer) and then choose 11 from the remaining 30 notes. Which means the right number of scales is actually 30 choose 11 = 54,627,300 to examine.

> >"For extra credit, the odd limits for 7, 9 and 11, same thing."
>
> Meaning, for example simply put a list of all seven limit dyads....and see
> how many of them matched to a scale?

No, meaning go through all the same 55 million possibilities, but this time counting only 7-limit dyads.

🔗Michael <djtrancendance@...>

1/15/2011 8:49:01 PM

Gene>"If we equate the various modes, there are 31 choose 11 = 84,672,315 12
note 31edo scales."

By equate modes...do you mean simply set the root at the first note of the
scale....or is more complex logic involved?

I'm strong guessing it's more complex logic. Just by assuming the first
note in the scale is the same and others can move to wherever they want...I got
some odd 6 billion or so for a scale count! And that's obviously not what the
"NcR" calculation gives (which is exactly what you gave)....

--------------------------------------------------
I have no clue off the top of my head how to efficiently check for duplicate
modes.
. My best guess is
A) Take every interval gap for each new scale and store it in a list IE the
tuning indexes 1 4 5 7 would have a 2, 0, 1 list for interval gaps. Then make
new list items for each of the possible modes (IE 2,1,0 could also be 1,0,2 or
0,2,1).

B1) For every new 12-tone scale...check it's interval gap list against ALL
other scale modes stored so far.

B2) Only add the scale to the stored scale list if there is NO match in B1

The real problem is every new 12-note combination would include an extra
loop, thus making it take many (I'm thinking 100+ IE 12*12+) times as long to
run.

Any ideas how to get around this?

[Non-text portions of this message have been removed]

🔗genewardsmith <genewardsmith@...>

1/15/2011 10:41:45 PM

--- In MakeMicroMusic@yahoogroups.com, Michael <djtrancendance@...> wrote:
>
> Gene>"If we equate the various modes, there are 31 choose 11 = 84,672,315 12
> note 31edo scales."
>
> By equate modes...do you mean simply set the root at the first note of the
> scale....or is more complex logic involved?

I shouldn't have said equate modes, since I didn't get around to discussing that. By equating them, I mean counting every mode as the same scale. A quick way to choose a mode out of all the possibilities is hashing: consider the scale to be a number base two, and then choose the smallest (or largest, if you prefer) among the circular permutations. For instance, the 12edo scale [2 4 5 7 9 11 12] would get the number 2^2+2^4+2^5+2^7+2^9+2^11+2^12 = 6836. A circular permutation with a smaller number is [1 3 5 6 8 10 12] with number 5482, so you'd pick that as your canonical version of the scale. (I used a Scala-type format, with the number of the edo as the last number, so my hash function gives only even numbers; you may prefer to start at 0 instead.)

🔗Michael <djtrancendance@...>

1/16/2011 2:05:22 AM

> Gene>"If we equate the various modes, there are 31 choose 11 = 84,672,315 12
> note 31edo scales."
.......................
Gene>"For instance, the 12edo scale [2 4 5 7 9 11 12] would get the number
>2^2+2^4+2^5+2^7+2^9+2^11+2^12 = 6836. A circular permutation with a smaller
number is [1 3 5 6 8 10 >12] with number 5482, so you'd pick that as your
canonical version of the scale."

Makes sense and seems clever enough but..........

Two fairly major issues (if I understand it correctly):

A) You still have to store 84,672,315 of such numbers (as I understand it) to
make the compare list of hashes...and my computer doesn't have 168 = 84*2 (size
of integer in byes) gigs of memory or (168 = 84*2) gigs of hard drive space
free. And that's assuming the size of the hash stored is that
small...realistically I will likely need an 8 byte (long) integer for storage
considering it's for 31 and not 12 notes!
........this seems an inevitable for any hashing/compare-list methods as there
are 84,672,315 unique combinations

B) How do you compare 6836 to 5482 (IE equality for different modes)? They are
not equal, so this seems to assume you have to have a clever way to find the
lowest mode for each new scale you come up with...preferably a quick
one...before running the compare.
---------------

The good news....is I have working code in Visual Basic.net that does that
task of finding the number of x-limit dyads in any size scale (and not just
TET)...and considers dyad occurring from all roots of the scale and going across
the octave. It also tells you from what note to what note of the scale the
dyads are formed from.
Amazingly...those parts of the problem seemed fairly easy.

Here is the SOURCE CODE in VB.NET (note you must create list boxes named
limitlist, tuninglist, listofdyads, and lisbox....and buttons named button1 <to
calculate number of dyads> and button2 <to add dyads of x-limit to your desired
dyad list>)...

Public Class Form1
Dim total As Long
Dim tuning As New ArrayList
Dim scale1 As New ArrayList
Dim dyadlist As New ArrayList
Dim dyadsintuning As New ArrayList
Dim centerror As Single

Private Function getalldyadsforxlimit(ByVal limit As Integer) As ArrayList
Dim one As Integer
Dim two As Integer
Dim tempone As Single
Dim temptwo As Single
Dim dyad As Single
Dim tempdyadlist As New ArrayList
For one = 1 To limit
For two = one To (limit * 2) - 1
If ((two = limit) Xor (one = limit)) And ((two * 1.0) / (one *
1.0) <= 2.0) Then
'dyad can not be limit/limit IE 1
'one number in the numerator or denominator of the dyad must
be the limit specified
'no dyad can be greater than the octave
If two Mod 2 = 0 Or two = limit Then
'if there is an ODD number in the dyad over the limit
'IE the dyad is over the specified odd limit
'do not add the dyad to the list
tempone = one
temptwo = two
dyad = temptwo / tempone
tempdyadlist.Add(dyad)
End If
End If
Next
Next
Return tempdyadlist
End Function

Private Function generateTETtuning(ByVal numberoftones As Integer) As
ArrayList
Dim index As Integer
Dim tempscale As New ArrayList
Dim root As Single = 2 ^ (1 / numberoftones)
Dim temp As Single = 1.0
For index = 1 To numberoftones
tempscale.Add(temp)
temp *= root
Next
Return tempscale
End Function

Private Function pad(ByVal value As Integer) As String 'lets us sort the
numbers correctly for display
If value < 10 Then
Return "00" + value.ToString
Else
If value < 100 Then
Return "0" + value.ToString
End If
End If
End Function

Private Function comparedyads(ByVal scale1 As ArrayList, ByVal dyadlist As
ArrayList) As ArrayList
Dim result As New ArrayList 'starts off as CLEAR/IE VALUELESS and then
gets copied to result box
Dim dyadcount As Integer = 0
Dim resultstring As String
Dim first As Integer
Dim second As Integer
Dim dyad As Single
Dim index As Integer
Dim dyadresult As Single
Dim onnextoctave As Boolean
For first = 0 To scale1.Count - 1
For second = first To (scale1.Count * 2) - 1
''''''''''''''''''''''''''''''''''''''''''''''''''
onnextoctave = False
dyad = 3
If second > scale1.Count - 1 Then 'when index is past end of
first octave...multiply by 2 to imitate

'going onto second octave
index = second - (scale1.Count)
dyad = (scale1(index) * 2.0) / scale1(first)
onnextoctave = True
Else
dyad = scale1(second) / scale1(first)
End If
''''''''''''''''''''''''''''''''''''''''''''
If dyad <= 2.0 Then 'if not
For index = 0 To dyadlist.Count - 1
dyadresult = Math.Abs(dyadlist(index) - dyad)
If (dyadresult < centerror) Then
resultstring = Math.Round(dyad, 4).ToString + " from
scale position " + pad(first) + " to "
If onnextoctave Then
result.Add(resultstring + (pad(second -
scale1.Count)).ToString + " on the next octave")
Else
result.Add(resultstring + pad(second))
End If
dyadcount += 1
End If
Next
'we can't do the below (easy) method as no dyad is going to
be the exact same value as a perfect dyad
'(unless in a JI scale)
'If dyadlist.BinarySearch(dyad) Then 'is dyad in desired
list
' result.Add(dyad)
'End If
End If
Next
Next
result.Add(" Total number of dyads in this scale from desired list is "
+ dyadcount.ToString())
Return result
End Function

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim number As Integer
For number = 3 To 15
If number Mod 2 <> 0 Then
LimitList.Items.Add(number)
End If
Next

LimitList.SelectedIndex = 2 'select 7 limit when starting the program

For number = 2 To 200
tuninglist.Items.Add(number)
Next number
tuninglist.SelectedIndex = 29 'select 31TET when starting the program
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim index
'copy all dyads in selected dyad list on screen to calculation array
ListBox1.Items.Clear()
dyadlist.Clear()
For index = 0 To listofdyads.Items.Count - 1
dyadlist.Add(listofdyads.Items.Item(index))
Next index
'''''''''''''''''''''''''
centerror = 0.0075 'how far off a dyad can be and still be counted as
being in the scale
tuning = generateTETtuning(Integer.Parse(tuninglist.SelectedItem))
'tuning is pre-sorted

dyadsintuning = comparedyads(tuning, dyadlist) 'get how many dyads are
in the tuning (or scale)
dyadsintuning.Sort()
ListBox1.DataSource = dyadsintuning 'list tuning in listbox for user
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Dim index As Integer
dyadlist = getalldyadsforxlimit(Integer.Parse(LimitList.SelectedItem))
dyadlist.Sort()
For index = 0 To dyadlist.Count - 1
listofdyads.Items.Add(dyadlist(index))
Next index
End Sub

Private Sub listofdyads_KeyDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles listofdyads.KeyDown
If e.KeyCode = Keys.Delete Then
While listofdyads.SelectedItems.Count > 0
listofdyads.Items.Remove(listofdyads.SelectedItem)
End While
End If
End Sub

Private Sub indexloop(ByVal minnumber As Integer, ByVal maxnumber As
Integer, ByVal tone As Integer)
Dim index As Integer
tone = tone - 1
If tone = 1 Then
Else
For index = minnumber To maxnumber
indexloop(index, maxnumber - tone, tone)
Next
End If
total += 1

End Sub

Function Combination(ByVal n As Long, ByVal r As Long) As Long
If (n = r Or r = 0) Then Return 1
Return n / (r * Combination(n - 1, r - 1))
End Function

End Class

[Non-text portions of this message have been removed]

🔗Michael <djtrancendance@...>

1/16/2011 2:52:16 AM

Gene,

One thing just hit me....nCr might NOT give the right number of
combinations...since nCr does not seem to consider......

The same scale in a different rotation as unique IE nCr gives the result
of 6 trying to find sets of dyads in 4TET gives 6 and looking at it visually

1 2 (#1)
1 3 (#2)
1 4 (#3)
2 4 (#4)
3 4 (#5)
2 3 (#6)

....note that 5,6, and 1 are the same (just rotated)....and #2 and #4 are the
same (just rotated). So there appear to be 3, and not 6, unique "modes" in this
example.

The question then becomes...what mathematical formula would give the correct
number of combinations...and would such a number be small enough not to
overshoot my computers memory while storing the scale hash tables?

[Non-text portions of this message have been removed]

🔗genewardsmith <genewardsmith@...>

1/16/2011 5:02:26 AM

--- In MakeMicroMusic@yahoogroups.com, Michael <djtrancendance@...> wrote:

> A) You still have to store 84,672,315 of such numbers (as I understand it) to
> make the compare list of hashes...

Not at all. All you need to store are the hashes with the largest count of dyads; the list can be pruned as you go along and run into larger maxima, but that will stabilize.

> B) How do you compare 6836 to 5482 (IE equality for different modes)? They are
> not equal, so this seems to assume you have to have a clever way to find the
> lowest mode for each new scale you come up with...preferably a quick
> one...before running the compare.

There are only twelve circular permutations of a twelve note scale; find them all and pick the smallest hash value. I wouldn't call that clever, but it will work and should be quick.

🔗Michael <djtrancendance@...>

1/16/2011 8:11:48 AM

Gene>"Not at all. All you need to store are the hashes with the largest count of
dyads; the list can be pruned as you go along and run into larger maxima, but
that will stabilize."

Ah, so you only compare against the one to few scales/hashes you've found
with the largest number of dyads so far...rather than keep all lists and order
them largest to smallest (IE what I was trying to do)?
In that case....I definitely won't run out of memory..... :-)

>"There are only twelve circular permutations of a twelve note scale; find them
>all and pick the smallest hash value. I wouldn't call that clever, but it will
>work and should be quick."

Only twelve and not 31 in 31TET...how's that possible (there are 31 possible
roots for the 12-tone scale, right)?

------------------------------------------------------------------

Anyhow...I understand the overall method as follows...

--------do the following 12 (or 31?!) times---------------
A) Increment the index of every other number in the scale
B) Take a number from the end of the scale and move it to the beginning if it is
over 12 (do a check)
C) Get the hash
D) See if the hash matches any of the hashes from the existing "best scale so
far" hash (binary list search), if so, GIVE UP...otherwise keep adding hashes to
a temporary hash list for all the scale's possible MODES
---------------------------------------------------
.....if you haven't given up, continue and.......
F) Get the number of dyads in this "new lowest" scale (check all possible dyads)
G) If your new dyad number is the lowest...store the scale, ALL possible hash
modes, and number of dyads in a "best scale so far" record, overwriting the last
one
..........repeat entire process and your best scale and number of dyads should
be in the "best scale so far" record.............

A major question is what to do first....so far as singling out scales that
either have more dyads than the best scale or the same hash as the best scale.
I figure singling new scales out by hashes (IE calculating that by necessity for
every scale) is faster than having to calculate all dyads for every
scale....opinion(s)?

[Non-text portions of this message have been removed]

🔗genewardsmith <genewardsmith@...>

1/16/2011 12:12:57 PM

--- In MakeMicroMusic@yahoogroups.com, Michael <djtrancendance@...> wrote:

> >"There are only twelve circular permutations of a twelve note scale; find them
> >all and pick the smallest hash value. I wouldn't call that clever, but it will
> >work and should be quick."
>
> Only twelve and not 31 in 31TET...how's that possible

Because you want to start the scale on a note of the scale, and there are 12 of those in an octave.

> A major question is what to do first....

First figure out how to make it work with 12 notes and not 31. Then, check all the various cyclic permutations, and see if this one has the lowest hash number. If it does, do the dyad count. If it equals or exceeds the maximum, store.