Help find the right code to create musical scale generator in excel

Tgv10

New Member
Joined
Feb 5, 2023
Messages
4
Office Version
  1. 2013
Platform
  1. Windows
Hello.
I need help choosing the type of VBA code to use to create a musical scale generator in Excel. I want to define the musical notes and the intervals between the notes and I want Excel to automatically generate the notes using the first note and the intervals of that scale. For example I want to define these rules:1-T=C (C, C#, D, D#, E ...)2-musical intervals (T, 2m, 2M, 3m, 3M...), and the 3-intervals of the "Major" scale ( T, 2M, 3M)I ask for the C Major scale and the result will be (C, D, E)Basically I want to define the cases in relation to the intervals between the notes and this way I don't need to create 12 cases but only 1. What's the best way to do this? Should I go through the "arrays"? Thanks.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
You may have to use index,match instead of xlookup, not sure the excel version it was added.

scratchbook excel testing.xlsm
ABCDEFGHIJK
1SharpsFlatsStepNoteMajor stepMajorSharpsFlats
2CC010ScaleFBb
3C#Db0.521Notes1FBb
4DD1312GC
5D#Eb1.540.53AD
6EE2514A#Eb
7FF2.5615CF
8F#Gb3716DG
9GG3.5817EA
10G#Ab48F#B
11AA4.5
12A#Bb5
13BB5.5
14CC6
15C#Db6.5
16DD7
17D#Eb7.5
18EE8
19FF8.5
20F#Gb9
21GG9.5
22G#Ab10
23AA10.5
24A#Bb11
25BB11.5
26CC12
Sheet26
Cell Formulas
RangeFormula
J3:K3J3=J2
J4:J10J4=XLOOKUP( XLOOKUP(J3,Table36[Sharps],Table36[Step],,0,1)+ XLOOKUP(I4,Table37[Note],Table37[Major step],,0),Table36[Step],Table36[Sharps],,0)
K4:K10K4=XLOOKUP( XLOOKUP(K3,Table36[Flats],Table36[Step],,0,1)+ XLOOKUP(I4,Table37[Note],Table37[Major step],,0),Table36[Step],Table36[Flats],,0)
Cells with Data Validation
CellAllowCriteria
J2List=$A$2:$A$13
K2List=$B$2:$B$13
 
Upvote 0

Forum statistics

Threads
1,215,212
Messages
6,123,655
Members
449,113
Latest member
Hochanz

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top