ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAP
1
12(improv)
LookupTable
2
A2.toplineHelper

It's a helper to the A2.topline column. It's job is to provide something the highest nn of the previous harmony right when the harmony changes.
3
to be pasted below the initialization row (into 9)
EXPLANATIONS of each step of the formula on this side
4
5
=IFerror(
Starting with iferror, in case we are deailing with "-" instead of numbers in cells, in which case all would be ignored, and "-" returned
6
if(IF
7
AND(
All the statements below are true (to be able to choose the very first urlinie note in the piece)
8
index( currMidiNn, row(), 1 ) >= botNnUrlinieCutOff,
*the note in currMidiNn is greater or less than botNnUrlinieCutOff
9
NOT( iserror(
*That there is an actual mention of the "deg<currdegreenumber>" text in the A2.toplineHelper2, same row
10
FIND(
11
"deg" & TEXT( index( currNnAsDegAboveTonic, row(), 1 ), "0" ),
12
index( A2.toplineHelper2, row(), 1 )
13
)
14
) ),
15
OR(
*And that the current note is one of the stable degrees (1,3,5) within the currently sounding harmony
16
index( degAboveHarmRoot, row(), 1 ) = 1,
17
index( degAboveHarmRoot, row(), 1 ) = 3,
18
index( degAboveHarmRoot, row(), 1 ) = 5
19
),
20
Index( A2.toplineHelper, row() - 1, 1 ) = "-"
*We want to only deal here with the very first schenkerian urlinie member - so, the above entry in this column should be "-"
21
)
(afterwards we will be looking at the previous row's entry in this column and making decisions based upon that
22
,THEN
(Set the current cells value to the needed string:)
23
MID( index( A2.toplineHelper2, row(), 1 ), 1, 2 ) & ";deg" & TEXT( index( currNnAsDegAboveTonic, row(), 1 ), "0" ) &
<index from the curr row helper2>;deg<currDegAboveTonic>
& "01;<currNn-3digits>;<currmeasure-4digits>
24
";01;" & "nn" & TEXT( index( currMidiNn, row(), 1 ), "000" ) & "m" & TEXT( index( currMeasure, row(), 1 ), "000" )
25
,
Otherwise,
We are likely dealing with an ongoing Schenkerian line, so analyze the previous entry in this column
26
IF(IF
27
index( A2.toplineHelper, row() - 1, 1 ) = "-"
the previous row's cell in this column = "-",
28
,THEN
29
index( A2.toplineHelper, row() - 1, 1 )
Return the same
30
,
Otherwise,
31
IF(IF
we are dealing with second or greater occurence of the 3rd urlinie degree - do we want to repeat it for the third time, fourth time etc?
32
AND(
ALL statements below are true:
33
VALUE( MID( index( A2.toplineHelper, row() - 1, 1 ), 9, 2 ) ) >= 1,
prev row A2.toplineHelper index of the current schenkerian degree is greater than 1 (we have already had at least two occurences of this note as an "urlinie degree")
34
index( currMidiNn, row(), 1 ) = VALUE( MID( index( A2.toplineHelper, row() - 1, 1 ), 14, 3 ) ),
curr Nn = prev row of A2.toplineHelper
35
OR(
We want it to be one of the stable degrees of the currently sounding harmony
36
index( degAboveHarmRoot, row(), 1 ) = 1,
37
index( degAboveHarmRoot, row(), 1 ) = 3,
38
index( degAboveHarmRoot, row(), 1 ) = 5
39
),
40
VALUE( MID( index( A2.toplineHelper, row() - 1, 1 ), 18, 3 ) ) <> index( currMeasure, row(), 1 ),
and we want to make sure that it occurs in a different measure from before
41
VALUE( MID( index( A2.toplineHelper, row() - 1, 1 ), 7, 1 ) ) = 3,
Dealing with the case when the current degree is "3" (getting close to the end)
42
( index( currMeasure, row(), 1 ) / finalMeasureNum ) < VALUE( MID( fraction_2_1_urlinie_motion, 1, 4 ) )
Given that we want to have some control over how long our improv is going to be, we will only allow 3rd degree to linger for not more than half the piece
43
)
44
,THEN
45
MID( index( A2.toplineHelper, row() - 1, 1 ), 1, 8 ) &
Return everything the same, except increment the index for the occurence of this urlinie degree
46
TEXT( MID( index( A2.toplineHelper, row() - 1, 1 ), 9, 2 ) + 1, "00" ) &
47
";nn" & TEXT( index( currMidiNn, row(), 1 ), "000" ) & "m" & TEXT( index( currMeasure, row(), 1 ), "000" )
48
,
Otherwise
we are dealing with second or greater occurence of the 2nd urlinie degree - do we want to repeat it for the third time, fourth time etc?
49
IF(IF
50
AND(
ALL statements below are true:
51
VALUE( MID( index( A2.toplineHelper, row() - 1, 1 ), 9, 2 ) ) >= 1,
prev row A2.toplineHelper index of the current schenkerian degree is greater than 1 (we have already had at least two occurences of this note as an "urlinie degree")
52
index( currMidiNn, row(), 1 ) = VALUE( MID( index( A2.toplineHelper, row() -1, 1 ), 14, 3 ) ),
curr Nn = prev row of A2.toplineHelper (because we want to repeat it
53
OR(
We want it to be one of the stable degrees of the currently sounding harmony
54
index( degAboveHarmRoot, row(), 1 ) = 1,
55
index( degAboveHarmRoot, row(), 1 ) = 3,
56
index( degAboveHarmRoot, row(), 1 ) = 5
57
),
58
VALUE( MID( index( A2.toplineHelper, row() - 1, 1 ), 18, 3 ) ) <> index( currMeasure, row(), 1 ),
and we want to make sure that it occurs in a different measure from before
59
VALUE( MID( index( A2.toplineHelper, row() - 1, 1 ), 7, 1 ) ) = 2,
Dealing with the case when the current degree is "2" (getting close to the end)
60
( index( currMeasure, row(), 1 ) / finalMeasureNum ) < VALUE( MID( fraction_2_1_urlinie_motion, 6, 4 ) )
Given that we want to have some control over how long our improv is going to be, we will only allow 3rd degree to linger for not more than 7/10th of the piece duration
61
),THEN
62
MID( index( A2.toplineHelper, row() - 1, 1 ), 1, 8 ) &
Return everything the same, except increment the index for the occurence of this urlinie degree
63
TEXT( MID( index( A2.toplineHelper, row() - 1, 1 ), 9, 2 ) + 1, "00" ) &
64
";nn" & TEXT( index( currMidiNn, row(), 1 ), "000" ) & "m" & TEXT( index( currMeasure, row(), 1 ), "000" )
65
,
Otherwise
We are dealing with all other cases (not 3rd and 2nd degrees)
66
IF(IF
67
AND(
ALL Statement below are true
68
index( currMidiNn, row(), 1 ) = VALUE( MID( index( A2.toplineHelper, row() - 1, 1 ), 14, 3 ) ),
whatever note is specified in helper2 is matched by currMidiNn
69
OR(
which is also a stable degree within the current harmony
70
index( degAboveHarmRoot, row(), 1 ) = 1,
71
index( degAboveHarmRoot, row(), 1 ) = 3,
72
index( degAboveHarmRoot, row(), 1 ) = 5
73
),
74
NOT( AND( VALUE( MID( index( A2.toplineHelper, row() - 1, 1 ), 7, 1 ) ) = 2, ( index( currMeasure, row(), 1 ) / finalMeasureNum ) < VALUE( MID( fraction_2_1_urlinie_motion, 6, 4 ) ) ) ),
it's not the 2nd degree with current position in the piece that happened before (or whatever is specified by the user in the user settable field - second number )
75
NOT( AND( VALUE( MID( index( A2.toplineHelper, row() - 1, 1 ), 7, 1 ) ) = 3, ( index( currMeasure, row(), 1 ) / finalMeasureNum ) < VALUE( MID( fraction_2_1_urlinie_motion, 1, 4 ) ) ) )
it's not the 3rd degree with current position in the piece that happened before (or whatever is specified by the user in the user settable field - first number )
76
),THEN
77
MID( index( A2.toplineHelper, row() - 1, 1 ), 1, 8 ) &
Return everything the same, except increment the index for the occurence of this urlinie degree
78
TEXT( MID( index( A2.toplineHelper, row() - 1, 1 ), 9, 2 ) + 1, "00" ) &
79
";nn" & TEXT( index( currMidiNn, row(), 1 ), "000" ) & "m" & TEXT( index( currMeasure, row(), 1 ), "000" )
80
81
,
Otherwise
82
IF(IF
dealing with the same as above, but checking for the occurence of the note from Helper2 (the next important note
83
AND(
all statements below must be true
84
index( currMidiNn, row(), 1 ) = VALUE( MID( index( A2.toplineHelper2, row(), 1 ), 11, 3 ) ),
the nn value in Helper2 = currMidiNn
85
OR(
it's a stable degree
86
index( degAboveHarmRoot, row(), 1 ) = 1,
87
index( degAboveHarmRoot, row(), 1 ) = 3,
88
index( degAboveHarmRoot, row(), 1 ) = 5
89
),
90
NOT( AND( VALUE( MID( index( A2.toplineHelper, row() - 1, 1 ), 7, 1 ) ) = 2, ( index( currMeasure, row(), 1 ) / finalMeasureNum ) < VALUE( MID( fraction_2_1_urlinie_motion, 6, 4 ) ) ) ),
it's not the 2nd degree with current position in the piece that happened before 70% (or whatever is specified by the user in the user settable field - second number )
91
NOT( AND( VALUE( MID( index( A2.toplineHelper, row() - 1, 1 ), 7, 1 ) ) = 3, ( index( currMeasure, row(), 1 ) / finalMeasureNum ) < VALUE( MID( fraction_2_1_urlinie_motion, 1, 4 ) ) ) )
it's not the 3rd degree with current position in the piece that happened before 50% (or whatever is specified by the user in the user settable field - first number )
92
),THEN
93
MID( index( A2.toplineHelper2, row(), 1 ), 1, 8 ) & "01" &
Return the string that matches that which is in the Helper2 column - we found this note
94
";nn" & TEXT( index( currMidiNn, row(), 1 ), "000" ) & "m" & TEXT( index( currMeasure, row(), 1 ), "000" )
95
,
Otherwise
96
Index( A2.toplineHelper, row() - 1, 1 )
Just return the row above
97
)
98
)
99
)
100
)