Given a root and a key, create eight variables to hold each note in the key.
In key-generator.orca, use the code between # set key #
and # end #
to generate the variables that store the notes in a key.
The r
variable holds the value to the root note that will be generated. Assigning a value of 0
to this variable will generate a A
key. Values for all keys below:
r |
note |
---|---|
0 | A |
1 | a |
2 | B |
3 | C |
4 | c |
5 | D |
6 | d |
7 | E |
8 | F |
9 | f |
a | G |
b | g |
The value set in the k
variable will determine if the key is major or minor. 1
sets the key to major and 0
sets it to minor.
k |
key |
---|---|
0 | major |
1 | minor |
2 | harmonic minor |
3 | melodic minor |
The code below will set the key to E minor.
rV7.#.root.#
kV1.#.key..#
Eight variables are created with the names 0
, 1
, 2
, 3
, 4
, 5
, 6
, 7
. Each of these holds a value that is a "universal position", or the number of half steps
the note is above the note A.
Position | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | a | b | c | d | e | f | g | h | i | j | k | l | m | n |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Note | A | a | B | C | c | D | d | E | F | f | G | g | A | a | B | C | c | D | d | E | F | f | G | g |
The following block of code will set the key to G major and play a scale of all of the notes generated.
rV3.#.root.#.............................................
kV0.#.key..#......Vk...Vr................................
..................0L3..3Lb...............................
.................kV0..rV3................................
.........................................................
.............Vk................Vk......Vk................
...........1L0...............1L0.....1L0.................
............0B1...............0B1.....0B1................
..........Vr.1..............Vr.1....Vr.1.................
.Vr...Vr..3A3J...Vr...Vr....3A8J....3AaJ....Vr...........
.3A0..3A2..6A1...3A5..3A7....bA1.....dA1....3Ac..........
0V3..1V5..2V7...3V8..4Va....5Vc.....6Ve....7Vf...........
.........................................................
............................Vk.......Vk..................
............................0L3......0L2.................
...........................3F0..V5..2F0..V6..............
..............................1Ac......1Ae...............
............................J5vd.....J6vf................
.............................Y........Y..................
.........................................................
#.generate.scale.positions.#.............................
.........................................................
.4C8.#.scale.#...........................................
pV3......................................................
.........................................................
#.convert.universal.values.to.notes.and.octaves.#........
.........................................................
..Vp...........................Vp........................
.V3...........................V3.........................
.8oTAaBCcDdEFfGgAaBCcDdEFfGg..8oT111222222222222333333333
.nVF..........................oV2........................
.........................................................
#.send.note.to.midi.channel.2.#..........................
.........................................................
5K...on..................................................
.....2F..................................................
..D43JJ..................................................
...%12F8f................................................