Val: Difference between revisions

m Shorthand notation: group the temperament finder's features together
Godtone (talk | contribs)
massive rework
Line 6: Line 6:
}}
}}
{{Beginner|Vals and tuning space}}
{{Beginner|Vals and tuning space}}
A '''val''' is a [[wikipedia: Linear map|linear map]] representing how to view the intervals on a generator chain, i.e. in a [[equal-step tuning]] such as an edo, as approximate versions of intervals in [[just intonation]] (JI). They form the link between things like EDOs and JI, and by doing so form the basis for all of [[regular temperament theory]]. It's very common for vals to refer to EDOs specifically, although they also show us how to relate larger chains of [[generator]]s to JI as well (such as a stack of meantone fifths).
(Note this description will omit certain details to make the basic idea easier to understand for beginners, then explain them later for correctness and completeness; the details are mainly footnotes to and applications of these core ideas.)


== Definition ==
A [[val]] — short for ''valuation'' — is like an algorithm/procedure for finding out how to approximate frequency ratios ([[interval]]s of [[just intonation]]) with the intervals/intervals of an [[edo]]. Note that this therefore assumes either that you want to use an edo to approximate specific harmonies or that you have some other more indirect use in mind.
A val accomplishes the goal of mapping all intervals in some [[harmonic limit]] by simply notating how many steps in the chain it takes to get to each of the primes within the limit. Since every positive rational number can be described as a product of primes, any mapping for the primes hence implies a mapping for all of the positive rational numbers within the prime limit. By mapping the primes and letting the composite rationals fall where they may, a val tells us which interval in the chain represents the tempered 3/2, which interval represents the tempered 5/4, and so forth.


Vals are usually written in the notation {{val| ''a b c d e f'' … }}, where each successive column represents a successive prime, such as 2, 3, 5, 7, 11, 13… etc, in that order, up to some [[Harmonic Limit|prime limit]] ''p''.
''The immediate question is:'' why would you need an algorithm instead of just looking at the nearest approximation possible in the edo? The answer is ''to avoid contradictions''.


Vals are important in regular temperament theory because they provide a way to mathematically formalize how, specifically, the intervals in a random chain of generators are viewed as the tempered versions of more fundamental just intonation intervals. They can also be viewed as a way to map JI "onto" the chain, imbuing it with a harmonic context. Vals will enable you to figure out what commas your temperament eliminates, what [[comma pump]]s are available in the temperament, what the most consonant chords in the temperament are, how to optimize the octave stretch of the temperament to minimize tuning error, what EDOs support your temperament, and other operations as of yet undiscovered.
For example, it might not be true that 6/5 * 5/4 = 3/2 or that 9/1 * 5/1 = 45/1 if you are just always using the ''nearest approximation'' of each of these frequency ratios (6:5, 5:4, 3:2, etc.) in the edo. Why? Because of something called ''inconsistency'', which means (read carefully):


For a more mathematically intensive introduction to vals, see [[Vals and tuning space]]. For the characterization of higher-rank temperaments, see [[Mapping]].
If you know what intervals (frequency ratios) that you want to combine (multiply) are, then ''combining their approximations'' (in the edo) '''''does not''''' give you the same result as ''multiplying their ratios first'' and ''then'' using the nearest approximation of ''that'' in the edo. When this happens, we say that the arithmetic is ''inconsistent''. (Therefore when this doesn't happen, we say that the result is [[consistent]].) (We will work through an example in a moment in [[#What is a val exactly and how do we use it]] to help understanding.)
 
Unfortunately, when this happens, it is not possible to fix the inconsistency, except by using a different edo that approximates the intervals in question better so that the multiplication (or division) of their approximations is consistent, but that isn't actually necessary, and plus, even if you did that, then more complex ratios (or just ''different'' ratios) will be inconsistent still, and so on (because an approximation can't be perfect), so you can't truly eliminate the inconsistency completely. Rather than giving up and saying that we can't guarantee that 6/5 * 5/4 = 3/2 or 9/1 * 5/1 = 45/1 or 135/128 * 24/25 = 81/80, etc. in our chosen edo, we ''can'' guarantee this, if we are willing to allow one or more of these ratios  to '''not''' use the closest approximation. (This may seem strange in this example, as one likely wants at least 6/5 * 5/4 = 3/2, but in principle we probably don't mind if something more complex is inconsistent, like 11 * 11 * 75 = 9075, if we can guarantee that the arithmetic never fails us.) How? By using a val! So, [[#What is a val exactly and how do we use it|what is a val exactly and how do we use it]]?
 
== What is a val exactly and how do we use it ==
A [[val]] is a list of [[Wikipedia:Integer|integer]]s telling you the ''approximation of each prime used'' in an edo, where by "each prime" we mean each frequency ratio ''p''/1 (where ''p'' is a [[Wikipedia:Prime number|prime number]]). This list of integers by convention corresponds to all primes up to some largest prime (the [[limit]]) so that we can tell what number represents the ''mapping'' of what prime by its place in the list (1st place is prime 2's mapping (a.k.a. the edo), 2nd place is prime 3's mapping, 3rd place is prime 5's mapping, 4th is prime 7's, etc.). The val is used to understand the edo's approximations to ratios involving those primes, like 2 * 5 / 3 / 3 = [[10/9]] for primes {2, 3, 5}. (This list [[#Warts|doesn't ''have'' to be the closest approximation]] for each prime, but it usually is.) Thus a val is essentially just a list of integers that we are interpreting as having a certain meaning.
 
=== For example, in [[26edo]]: ===
* prime 2 is ''mapped'' to 26 steps (by definition, as we are equally dividing [[2/1]] into 26 steps, each representing an interval with frequency ratio 2<sup>1/26</sup>/1)
* prime 3 is ''mapped '' to log(3)/log(2) * 26 = 41.209... steps, which we round to 41 steps (because otherwise we are using frequency ratios not present in 26edo), meaning 2<sup>41/26</sup> = 2.983.../1 is the frequency ratio of 26edo that we use to approximate the [[3/1]] frequency ratio, so the correct statement is prime 3 is ''mapped to 41 steps'' (not a fractional amount)
* by the same procedure, prime 5 is ''mapped'' to 60 steps, as a result of rounding log(5)/log(2) * 26 = 60.370..., meaning 2<sup>60/26</sup> = 4.950.../1 is the frequency ratio of 26edo that we use to approximate the [[5/1]] frequency ratio
Note that when we take the closest approximation of each prime (corresponding to rounding rather than (EG) using the second-best approximation possible) we call it a ''patent val'', therefore, the "5-limit patent val" of 26edo is {{val| 26 41 60}} (where the limit is 5 because that's the highest prime we are considering).
=== So how do we use a val? ===
Using the 26edo val {{val| 26 41 60}} as our example, say we want to figure out how [[9/8]], [[5/4]] and 9/8 * 5/4 = [[45/32]] are mapped.
 
First we have to find the [[Wikipedia:Integer factorization|prime factorization]] of our intervals (then we deduce the mapping from the prime factorization and the val):
* 9/8 = (3 * 3)/(2 * 2 * 2)
* 5/4 = 5/(2 * 2)
* 45/32 = (3 * 3 * 5)/(2 * 2 * 2 * 2 * 2)
Now all we do is substitute each occurrence of each prime with adding (or subtracting if we're dividing) the corresponding number of ''steps'' for that prime given by our val:
* 9/8 is mapped to (41 + 41) - (26 + 26 + 26) = 82 - 78 = 4 steps (so represented by a frequency ratio of 2<sup>4/26</sup> = 1.112.../1 = ''4\26'')
* 5/4 is mapped to 60 - (26 + 26) = 60 - 52 = 8 steps (so represented by a frequency ratio of 2<sup>8/26</sup> = 1.237.../1 = ''8\26'')
* 45/32 is mapped to (41 + 41 + 60) - (26 + 26 + 26 + 26 + 26) = 142 - 130 = 12 steps (so represented by a frequency ratio of 2<sup>12/26</sup> = 1.377.../1 = ''12\26'')
That's it! You've successfully used a val. The arithmetic works out nicely: the approximation of 5/4 times the approximation of 9/8 is the approximation of 45/32. What about that funny ''backslash'' notation? That's just a shorthand: ''k''\''N'' = 2<sup>''k''/''N''</sup> (the ''N''th root of 2, to the ''k''th power). Note that it can also be used ambiguously, as 2<sup>4/26</sup> + 2<sup>8/26</sup> = 2<sup>12/26</sup> is clearly invalid (the correct statement is 2<sup>4/26</sup> * 2<sup>8/26</sup> = 2<sup>12/26</sup>) but 4\26 + 8\26 = 12\26 need not be. It is used a lot in the xen community so is provided here for familiarization.
 
Now let's compare to the closest approximations:
* log(9/8)/log(2) * 26 = 4.418... which rounds to 4 steps
* log(5/4)/log(2) * 26 = 8.370... which rounds to 8 steps
* log(45/32)/log(2) * 26 = 12.788... which rounds to 13 steps
So here we can see that 9/8 * 5/4 = 45/32 is inconsistent because 4 + 8 is not equal to 13, in other words, 4 + 8 = 12 fails. So we can see that the val "fixes" the 13 to 12 by obeying an ''internal'' logic provided by the val; in different contexts it may be different intervals that are fixed; not necessarily the more complex one, though usually that's how it works for edos of interest.
 
So you may have noticed that there was quite a bit of repeated addition we can simplify, so let's note how we can simplify it exactly. Specifically, using exponent notation and not omitting implicit "to the power of 0"'s, the prime factorizations we worked out above are equivalent to:
* 9/8 = 2<sup>-3</sup> * 3<sup>2</sup> * 5<sup>0</sup> which we can notate as {{monzo| -3 2 0 }}
* 5/4 = 2<sup>-2</sup> * 3<sup>0</sup> * 5<sup>1</sup> which we can notate as {{monzo| -2 0 1 }}
* 45/32 = 2<sup>-5</sup> * 3<sup>2</sup> * 5<sup>1</sup> which we can notate as {{monzo| -5 2 1 }}
These notations are called [[monzo]]s; in other words, all a monzo really is is a shorthand for the prime factorization of an interval! Notice that the angle bracket on a monzo is on the right while on a val it's on the left, to indicate the naturalness of combining vals with monzos and to distinguish them, though often you can just use only square brackets if it's clear from context.
 
Did you notice that {{monzo| -3 2 0 }} + {{monzo| -2 0 1 }} = {{monzo| -5 2 1 }}? Specifically, try adding corresponding numbers in the lists; -3 with -2 gives -5, 2 with 0 gives 2, 0 with 1 gives 1. That's not a coincidence! That's the same thing as multiplication except we're doing it with an "additive" notation.
 
Now equipped with our funny notation for a val and a monzo, we can do the exact same thing we did before — calculating the mappings — but using this very dense but efficient notation, where we express "mapping the interval described by the monzo by a val" as simple juxtaposition (with angle brackets on the outskirts), where we ''multiply'' corresponding numbers in the list and then add them together, like so:
* mapping of 9/8: {{val| 26 41 60}}{{monzo| -3 2 0 }} = 26 * -3 + 41 * 2 + 60 * 0 = -78 + 82 + 0 = 4 (steps of 26edo)
* mapping of 5/4: {{val| 26 41 60}}{{monzo| -2 0 1 }} = 26 * -2 + 41 * 0 + 60 * 1 = -52 + 0 + 60 = 8 (steps of 26edo)
* mapping of 45/32: {{val| 26 41 60}}{{monzo| -5 2 1 }} = 26 * -5 + 41 * 2 + 60 * 1 = -130 + 82 + 60 = 12 (steps of 26edo)
This is all very tedious, but in practice using a val is much simpler, because you don't need to do this, all you need to know is [[5/4]] is mapped to 8\12 and [[3/2]] is mapped to 15\26, therefore [[9/4]] is mapped to 30\26, therefore [[9/8]] is mapped to (30-26=4)\26, so that since we know 9/8 * 5/4 = 45/32, the mapped version of 45/32 will just be 4 + 8 = 12. This method guarantees that you never contradict yourself, even if you are technically using suspicious approximations.
 
(For the mathematically inclined, note that this operation is the same as taking the {{Wikipedia:dot product|dot product}} between the monzo and val interpreted as ordinary vectors.)
 
=== Is this really that valuable/important? ===
The guarantee that there are no "contradictions" comes with an interesting feature: somehow, you've managed to approximate [[just intonation]] (JI) in an internally-consistent way despite the fact that the approximations get worse the more you combine the errors (so can get arbitrarily inconsistent). Mathematics out of scope for this page tells us that this corresponds to ''tempering'' an infinite set of ''commas'' (though there's a finite amount of musically relevant/simple commas); that set is simply the set of all intervals that are mapped to 0 steps ([[1/1]]) by the val. This explains where the additional "structure" went — if there is two or more primes, then don't you need to specify two or more integers in the exponents of the prime factorization (a.k.a. in the monzo)? The answer is yes, so we've lost information and structure by simplifying everything to a single integer coordinate; exactly the information that corresponds to ''equating'' any two intervals whose difference is one of the commas tempered, so we've found a precise sense in which we can ''equate'' two nearby intervals (frequency ratios) that are not actually equal — by mapping according to a val that maps the difference to zero! In fact, you don't have to use an [[edo]] tuning as you could use multiple vals ''simultaneously'' to map a single interval if you want to preserve more of the information in JI (rather than just increasing the size of the edo); this corresponds to [[regular temperaments]] generally rather than just the 1-dimensional ("rank 1") case that vals correspond to. Therefore, a ''val'' specifies a ''rank 1 temperament'' a.k.a. an ''equal temperament''.
 
Furthermore, there is actually a lot of applications of vals and monzos that are not necessarily about approximating things in edos (or even regular temperaments for that matter), discussed in [[#Applications]], though all of them do still use the idea of the ''mapping'' provided by the val, so really, a val is a ''mapping'' from [[just intonation]] (JI) to the integers with certain properties... which brings us to:
 
=== Mathematically, what is a val? ===
Mathematically, a val is a type of function that inputs a [[Wikipedia: Rational number|rational number]] (ratio) and outputs an integer (whole number) that represents what interval of the edo we use to approximate that frequency ratio. If ''a''/''b'' is our ratio and ''k'' is the output of the function, then the interval* of ''N'' edo is 2<sup>''k''/''N''</sup> (if we [[#Warts and generalized patent vals|assume a pure octave tuning]]) which is often written with the shorthand ''k''\''N'' and pronounced "''k'' steps of ''N'' edo", so that ''k'' is how many [[step]]s the interval is mapped to.
 
It is not just any such function though; it is a function with a special property called {{Wikipedia: Linearity|Linearity}} that allows our arithmetic to be "internally consistent" (having an "internal logic") in the way described above; here "internally consistent" is meant in the English sense, so shouldn't be confused with [[consistency]] in the aforediscussed technical sense. The most obvious use of a val (the one discussed in the example) is to algorithmically determine ''JI interpretations'' of intervals in edo, which is called using the edo as an ''equal temperament'' or ''rank 1 temperament'', where "rank 1" means that it corresponds to a 1 dimensional grid of notes related by the same (usually [[Wikipedia: Irrational number|irrational]]) frequency ratios.
 
Also note that in practice vals are ''very far'' from just any list of positive integers; rather, they are generally equal to or one off from the lists of integers that correspond to a ''patent val'', which [[#For example, in 26edo:|as a reminder,]] is "when we take the closest approximation of each prime (corresponding to rounding rather than (EG) using the second-best approximation possible)".
 
=== Warts and generalized patent vals ===
The algorithm/process for producing a val does not actually require us to use a purely-tuned 2/1 (octave); instead we can stretch or compress the octave, resulting in potentially different mappings for primes, which is more common the more off the prime is and the more we alter the octave. This can give us a sense in which certain vals which are not "patent vals" are "patent" in a more broad sense, hence "generalized".


== Example EDO ==
This works by instead of doing log(''p'')/log(2) (where ''p'' is prime) we use log(''p'')/log(2.01...) or something to that effect, where 2.01/1 is our altered version of 2/1. The ''val'' produced by a slight alteration is usually the same, so there are actually continuous ranges where the val produced is the same.


Consider the 5-limit val {{val| 12 19 28 }}. This val tells us that you should view 12 generator steps as mapping to the octave 2/1. Since the temperament which maps 12 generator steps to the octave is 12edo, this means you're describing 12edo.
{{todo | add 17edo example}}


The val {{val| 12 19 28 }}, in addition to saying that 12 steps of 12-equal represents 2/1, also states explicitly that 19 steps of 12-equal represents a tempered 3/1, and 28 steps of 12-equal represents a tempered 5/1.
== Applications ==
{{todo | cleanup/accessibility}}
As discussed, vals are important in regular temperament theory because they provide a way to mathematically formalize how, specifically, the intervals in some set of equally spaced pitches are viewed as the tempered versions of more fundamental just intonation intervals. They can also be viewed as a way to map JI "onto" the chain, imbuing it with a harmonic context. Vals will enable you to figure out what commas your temperament eliminates, what [[comma pump]]s are available in the temperament, what the most consonant chords in the temperament are, how to optimize the octave stretch of the temperament to minimize tuning error, what EDOs support your temperament, and other operations as of yet undiscovered.


Now assume you'd like to extend 12edo into the 7-limit. If you would like to assume the perspective that the 10 step interval in 12-equal (representing 1000 cents) is a very tempered 7/4, then that means that 7/1, which is 7/4 with two octaves stacked on top, is equal to 10 steps + 12 steps + 12 steps = 34 steps. This decision can hence be represented by using the 7-limit {{val| 12 19 28 34 }} val.
For a more mathematically intensive introduction to vals, see [[Vals and tuning space]]. For the characterization of higher-rank temperaments, see [[Mapping]].


If for some strange reason you'd instead like to say that 900 cents is 7/4, then that would be represented by the {{val| 12 19 28 33 }} val, and if you'd like to say that 123000 cents is 7/4, that would be represented by the {{val| 12 19 28 1254 }} val.
=== Another example (12edo) ===
Consider the 5-limit patent val {{val| 12 19 28 }}. This val tells us that you should view 12 generator steps as mapping to the octave 2/1. Since the temperament which maps 12 generator steps to the octave is 12edo, this means you're describing a val for 12edo.


== Shorthand notation ==
The val {{val| 12 19 28 }}, in addition to saying that 12 steps of 12-equal represents 2/1, also states explicitly that 19 steps of 12-equal represents a tempered 3/1, and 28 steps of 12-equal represents a tempered 5/1.
This is also known as '''warts''' or '''wart notation'''. It was developed by [[Herman Miller]] and [[Graham Breed]].


Given an explicit or assumed limit, any [[patent val]] can simply be represented by stating its first coefficient – the digit representing how many generators map to 2/1. For example, the 5-limit patent val for 17edo, {{val| 17 27 39 }}, can be called simply, "17".
Now assume you'd like to extend 12edo into the 7-limit. If you would like to assume the perspective that the 10 step interval in 12-equal (representing 1000 cents) is a very tempered 7/4, then that means that 7/1, which is 7/4 with two octaves stacked on top, is equal to 10 steps + 12 steps + 12 steps = 34 steps. This decision can hence be represented by using the 7-limit patent val for 12edo: {{val| 12 19 28 34 }}.


The patent val for any edo will use the most accurate mapping for each individual prime when pure octaves are assumed. However, it may often be the case that one wants to refer to vals other than the patent val. For example, the 5-limit val {{val| 17 27 40 }}, which maps the 5/4 to the 424-cent interval rather than the 353-cent interval, is not the patent val for 17edo but may be preferred because it is lower in overall error. Nonpatent vals are specified by adding a ''wart'' to the end of their name which specifies their deviation from the patent val. In this case, we want to specify that the 5/1 has been changed to use its second-most accurate mapping. Since 5 is the third prime number, we add the third letter of the alphabet to the end of the edo number, to form "17c".  
If for some strange reason you'd instead like to say that 900 cents is 7/4, then that would be represented by the {{val| 12 19 28 33 }} val (notated 12d), and if you'd like to say that 1100 cents is 7/4, that would be represented by the {{val| 12 19 28 35 }} (12dd) val.


If we wanted to use the third-most accurate mapping for 5, {{val| 17 27 38 }}, we would write "17cc". In [[17edo]], the approximation of the prime-5 component is raised for an odd, and lowered for an even, amount of c letters: <code></code> = 39, <code>c</code> = 40, <code>cc</code> = 38, <code>ccc</code> = 41, <code>cccc</code> = 37.
== Warts explanation ==
{{ todo | rework }}


The general rules:
The general rules:
Line 43: Line 105:
* In Graham Breed's temperament finder, the wart letter "p" is used to make explicit that the number refers to the patent val (though the letter originally was intended to stand for "prime"). Note that "p" is logically the letter for prime 53.
* In Graham Breed's temperament finder, the wart letter "p" is used to make explicit that the number refers to the patent val (though the letter originally was intended to stand for "prime"). Note that "p" is logically the letter for prime 53.
* In Graham Breed's temperament finder, the wart letter "q" and after refers each non-prime basis of composite/fractional subgroup, respectively and temporarily.
* In Graham Breed's temperament finder, the wart letter "q" and after refers each non-prime basis of composite/fractional subgroup, respectively and temporarily.
* To be less ambiguous than Graham Breed's verson, [[User:CompactStar|CompactStar]] has suggested using a number enclosed in square brackets for composite/fractional subgroups, such as [9] for a wart representing 9, although this is not a widely-accepted notation.
 
=== Sparse Offset Val notation ===
=== Sparse Offset Val notation ===
In 2022 [[User:Mike Battaglia|Mike Battaglia]] proposed '''SOV notation''' as a way to be explicit about which primes are being affected and in which direction. In 2024 it was further refined by him and [[User:Frostburn|Lumi Pakkanen]] to be more analogous to [[Ups and downs notation]].
In 2022 [[User:Mike Battaglia|Mike Battaglia]] proposed '''SOV notation''' as a way to be explicit about which primes are being affected and in which direction. In 2024 it was further refined by him and [[User:Frostburn|Lumi Pakkanen]] to be more analogous to [[Ups and downs notation]].


Line 69: Line 130:


== Vals in JI subgroups ==
== Vals in JI subgroups ==
We can generalize the concept of monzos and vals from the ''p''-limit to other [[JI subgroup]]s. This can be useful when considering different edo tunings of [[subgroup temperaments]]. [[Gene Ward Smith]] called these "[[sval]]s" for short.
We can generalize the concept of monzos and vals from the ''p''-limit (for some prime ''p'') to other [[JI subgroup]]s. This can be useful when considering different edo tunings of [[subgroup temperaments]]. [[Gene Ward Smith]] called these "[[sval]]s", short for "[[subgroup val]]s", and correspondingly "[[smonzo]]s" as short for "[[subgroup monzo]]s".


To notate a subgroup val, we typically precede the "bra" notation with an indicator regarding the subgroup (and choice of basis). For instance, the patent val for 12 equal on the 2.3.7 subgroup is often notated "2.3.7 {{val|12 19 34}}". If the subgroup indicator isn't present, the subgroup can be inferred from context. It is very typical for a val with no explicit subgroup indicator to be interpreted as representing some prime limit, e.g. {{val| a b c }} would represent a 5-limit val.
To notate a subgroup val, we typically precede the "bra" (angle bracket) notation with an indicator regarding the subgroup (and choice of basis, as we don't have to use only ascending primes). For instance, the patent val for 12 equal on the 2.3.7 subgroup is often notated "2.3.7 {{val|12 19 34}}". If the subgroup indicator isn't present, the subgroup can be inferred from context. It is very typical for a val with no explicit subgroup indicator to be interpreted as representing some prime limit, e.g. {{val| a b c }} would represent a 5-limit val.


Note that we could, for instance, use a different basis for the same subgroup - for instance, we could instead write "2.3.21 {{val| 12 19 53 }}", which is the 12 equal patent val in the "2.3.21" subgroup. Since the "2.3.21" subgroup is the same as the "2.3.7" subgroup, just written with a different basis, these two apparently "different" svals represent the same map from this subgroup to a rank-1 generator chain. (It is a matter of semantics if these are thought of as "different" svals or "the same sval" written using a different basis.)
Note that we could, for instance, use a different basis for the same subgroup - for instance, we could instead write "2.3.21 {{val| 12 19 53 }}", which is the 12 equal patent val in the "2.3.21" subgroup. Since the "2.3.21" subgroup is the same as the "2.3.7" subgroup, just written with a different basis, these two apparently "different" svals represent the same map from this subgroup to a rank-1 generator chain. (It is a matter of semantics if these are thought of as "different" svals or "the same sval" written using a different basis.)
Retrieved from "https://en.xen.wiki/w/Val"