Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Music project suggestion

Status
Not open for further replies.

Greyhound1

Technical User
Dec 3, 2001
7
0
0
US
There are 792 ways to select any seven non-repeating musical scale
sequences from the given twelve tone music system. The actual 12-tone
values are as follows:
twlvtones("Ab","A","Bb","B","C","Db","D","Eb","E","F","Gb","G",)

Proposed project: Write an algorithm for generating the 792
combinations of scale sequences and display them in a single column.

There can be many applications adapted from this project. Hopefully,
some folks with much more expertise than I possess can achieve the
goal.

Good luck,

Stephen
 
A few months(?) ago I did something similar with 6 non-repeating numbers.

If anyone can point me to the thread, I'll be happy to expand to 7 non-repeating numbers.

I looked for it but . . . . :-(
 
Hi JV,

Welcome back. I noticed you were away for awhile, as I was. I just returned from a 5-week vacation in Australia.

The thread you are looking for is thread68-125633.

Your response to this thread was on August 24, 2001. It was obviously a great response and one that I saved. Thanks once again.

I'm anxious to see the result of your modification for this "Music project suggestion".

Regards, ...Dale Watson dwatson@bsi.gov.mb.ca
 
Hello, Greyhound1.

This is what I would do based on the use of a straightforward pigeonhole principle to enumerate all the scales with seven notes. It looks possible to rewrite it in the form of recursion to make it more clever. But I leave it to you for the improvement.

regards - tsuji

Sub EnumTonal()

Const tonal = 7
Const atonal = 12

ReDim musscale(atonal - 1) As Variant
ReDim choice(tonal - 1) As Variant

musscale(0) = "Ab"
musscale(1) = "A"
musscale(2) = "Bb"
musscale(3) = "B"
musscale(4) = "C"
musscale(5) = "Db"
musscale(6) = "D"
musscale(7) = "Eb"
musscale(8) = "E"
musscale(9) = "F"
musscale(10) = "Gb"
musscale(11) = "G"

Range("A1").Select 'Make your choice on the position

For i1 = 0 To atonal - tonal
choice(0) = musscale(i1)
For i2 = i1 + 1 To atonal - tonal + 1
choice(1) = musscale(i2)
For i3 = i2 + 1 To atonal - tonal + 2
choice(2) = musscale(i3)
For i4 = i3 + 1 To atonal - tonal + 3
choice(3) = musscale(i4)
For i5 = i4 + 1 To atonal - tonal + 4
choice(4) = musscale(i5)
For i6 = i5 + 1 To atonal - tonal + 5
choice(5) = musscale(i6)
For i7 = i6 + 1 To atonal - tonal + 6
choice(6) = musscale(i7)
For j = 0 To tonal - 1
ActiveCell.Offset(0, j).Value = choice(j)
Next
ActiveCell.Offset(1, 0).Select
Next i7
Next i6
Next i5
Next i4
Next i3
Next i2
Next i1

End Sub

 
Thanks,
I entered a few dim statements and it worked fine...
'code follows
Sub EnumTonal()

Const tonal = 7
Const atonal = 12

ReDim musscale(atonal - 1) As Variant
ReDim choice(tonal - 1) As Variant

musscale(0) = "Ab"
musscale(1) = "A"
musscale(2) = "Bb"
musscale(3) = "B"
musscale(4) = "C"
musscale(5) = "Db"
musscale(6) = "D"
musscale(7) = "Eb"
musscale(8) = "E"
musscale(9) = "F"
musscale(10) = "Gb"
musscale(11) = "G"

Range("A1").Select 'Make your choice on the position
Dim i1 As Variant
Dim i2 As Variant
Dim i3 As Variant
Dim i4 As Variant
Dim i5 As Variant
Dim i6 As Variant
Dim i7 As Variant
Dim j As Variant
For i1 = 0 To atonal - tonal
choice(0) = musscale(i1)
For i2 = i1 + 1 To atonal - tonal + 1
choice(1) = musscale(i2)
For i3 = i2 + 1 To atonal - tonal + 2
choice(2) = musscale(i3)
For i4 = i3 + 1 To atonal - tonal + 3
choice(3) = musscale(i4)
For i5 = i4 + 1 To atonal - tonal + 4
choice(4) = musscale(i5)
For i6 = i5 + 1 To atonal - tonal + 5
choice(5) = musscale(i6)
For i7 = i6 + 1 To atonal - tonal + 6
choice(6) = musscale(i7)
For j = 0 To tonal - 1
ActiveCell.Offset(0, j).Value = choice(j)
Next
ActiveCell.Offset(1, 0).Select
Next i7
Next i6
Next i5
Next i4
Next i3
Next i2
Next i1

End Sub

 
Looks done to me !!

Yes, I've been out in the hills the past 2 months implementing a project. Not as glamorous as Oz but it keeps paying the bills!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top