Cross-domain temperament merging: Difference between revisions

Cmloegcmluin (talk | contribs)
better to assume, even at this advanced level of RTT, that formal primes are rational, and so their basis elements are simply primes; no need to abstract to the point of generic "basis elements"
Cmloegcmluin (talk | contribs)
"formal primes matrix" is a clearer name for this object than "interval basis" (which can be reserved for the simple numeric list) and less likely to be confused with "comma basis"; in other places, "interval subspace" remains a good choice
Line 5: Line 5:
== 1. Determine the interval basis for the output temperament ==
== 1. Determine the interval basis for the output temperament ==


A guiding principle when performing a cross-interval basis temperament merge is [[Temperament_merging#Application|described on the main page for temperament merging]]:
A guiding principle when performing a temperament merge across interval subspaces is [[Temperament_merging#Application|described on the main page for temperament merging]]:


<blockquote style="background-color: #fbfbfb; border: 1px solid #eeeeee; padding: 10px 20px;">
<blockquote style="background-color: #fbfbfb; border: 1px solid #eeeeee; padding: 10px 20px;">
Line 13: Line 13:
</blockquote>
</blockquote>


From this, we can make some helpful statements about cross-interval basis temperament merges.
From this, we can make some helpful statements:


''For a comma-merge'', because the output temperament deals with every comma, then its interval basis must be capable of supporting this: specifically, it must include every formal prime from any of the input temperaments' interval bases. Think of it this way: for any given temperament, its interval basis's formal primes are the building blocks for its commas, and so in order to express every comma in the merged temperament, we will need every input temperament's building blocks gathered in one place. In other words, we must find the merge of all the input interval bases.
''For a comma-merge'', because the output temperament deals with every comma, then its interval basis must be capable of supporting this: specifically, it must include every formal prime from any of the input temperaments' interval bases. Think of it this way: for any given temperament, its interval basis's formal primes are the building blocks for its commas, and so in order to express every comma in the merged temperament, we will need every input temperament's building blocks gathered in one place. In other words, we must find the merge of all the input interval bases.


''For a map-merge'', then, because the output temperament will deal only with tempered commas shared by every input temperament, then its interval basis only needs to include the formal primes that are present in all of the input interval bases. Here's why: a comma built using a formal prime that isn't shared by all input temperaments couldn't even be ''built'' in all input temperaments, yet alone tempered out by all of them. And so, to build the set of commas that are tempered out by all temperaments, we only need the building blocks that can be found in all of them. In mathematical terms, we must find the intersection of the input interval bases.
''For a map-merge'', then, because the output temperament will deal only with tempered commas shared by every input temperament, then its interval basis only needs to include the formal primes that are present in all of the input interval bases. Here's why: a comma built using a formal prime that isn't shared by all input temperaments couldn't even be ''built'' in all input temperaments, let alone tempered out by all of them. And so, to build the set of commas that are tempered out by all temperaments, we only need the building blocks that can be found in all of them. In mathematical terms, we must find the intersection of the input interval bases.


<gallery heights=450px widths=450px>
<gallery heights=450px widths=450px>
Line 67: Line 67:
[[Temperament merging across interval bases#Examples|A couple subsections ago]], we provided a couple examples where we used natural language to explain — between two interval subspaces — which one was a subspace of the other. But we still need to describe a method to determine this in general. Let's do that next.
[[Temperament merging across interval bases#Examples|A couple subsections ago]], we provided a couple examples where we used natural language to explain — between two interval subspaces — which one was a subspace of the other. But we still need to describe a method to determine this in general. Let's do that next.


We can say that an interval subspace <math>B_1</math> is a subspace of another interval subspace <math>B_2</math> if when we merge <math>B_1</math> and <math>B_2</math> we just get <math>B_2</math> again. In layperson's terms, if <math>B_1</math> brings nothing to the table that <math>B_2</math> hasn't already brought, then it is completely contained by <math>B_2</math> and therefore is a subspace of it.
We can say that an interval subspace <math>\textbf{b}_1</math> is a subspace of another interval subspace <math>\textbf{b}_2</math> if when we merge <math>\textbf{b}_1</math> and <math>\textbf{b}_2</math> we just get <math>\textbf{b}_2</math> again. In layperson's terms, if <math>\textbf{b}_1</math> brings nothing to the table that <math>\textbf{b}_2</math> hasn't already brought, then it is completely contained by <math>\textbf{b}_2</math> and therefore is a subspace of it.


For more information on merging interval bases, see [[Temperament merging across interval bases#Merging]].
For more information on merging interval bases, see [[Temperament merging across interval bases#Merging]].
Line 77: Line 77:
So, first, we do the first step of merging interval bases: concatenate them. That gets us 2.25/9.11/7.2.5/3.7.11.
So, first, we do the first step of merging interval bases: concatenate them. That gets us 2.25/9.11/7.2.5/3.7.11.


The next step of merging is to canonicalize. To begin that, we convert our interval basis to a matrix <math>B</math>. Here, we've labeled the columns with the number-list representation of the formal primes of this interval basis, to help show the correspondence, as well as the rows with the primes these formal primes factor into:
The next step of merging is to canonicalize. To begin that, we convert our interval basis to a formal primes matrix <math>F</math>. Here, we've labeled the columns with the number-list representation of the formal primes of this interval basis, to help show the correspondence, as well as the rows with the primes these formal primes factor into:




Line 182: Line 182:
=== Notation ===
=== Notation ===


The notation used for merging here is the same as comma-merge: <math>B_1|B_2</math><ref>Using ∩ for intersection, which seems obvious. But the merge notation is tricky. We could use ∪, of course. But technically speaking, it's not a union, but a sumset, and the notation for that is unfortunately just the plus sign +, which could be confusing. Furthermore, in the context of merging temperaments, we don't use either of those symbols. Actually, we use two different symbols there, depending on what we're merging! We use & if it's maps, and | if it's commas. At least, that's the notation used on the [[Meet and join]] and [[Temperament merging]] pages. And because intersections also arise for temperament matrices like mappings and comma bases, this article has gone with consistent notation for interval bases. Interval bases concatenate horizontally, like comma bases, so we use | and consider it a "basis-merge" symbol, i.e. it works on both comma bases and interval bases.</ref>.
The notation used for merging here is the same as comma-merge: <math>\textbf{b}_1|\textbf{b}_2</math><ref>Using ∩ for intersection, which seems obvious. But the merge notation is tricky. We could use ∪, of course. But technically speaking, it's not a union, but a sumset, and the notation for that is unfortunately just the plus sign +, which could be confusing. Furthermore, in the context of merging temperaments, we don't use either of those symbols. Actually, we use two different symbols there, depending on what we're merging! We use & if it's maps, and | if it's commas. At least, that's the notation used on the [[Meet and join]] and [[Temperament merging]] pages. And because intersections also arise for temperament matrices like mappings and comma bases, this article has gone with consistent notation for interval bases. Interval bases concatenate horizontally, like comma bases, so we use | and consider it a "basis-merge" symbol, i.e. it works on both comma bases and interval bases.</ref>.


=== Applications ===
=== Applications ===


Interval basis merging comes up in two key situations:  
Interval basis merging comes up in two key situations:  
# Determining whether one interval subspace is a subspace of another: <math>B_1</math> is a subspace of <math>B_2</math> if <math>B_1|B_2 = B_2</math>. For more details, see: [[Temperament merging across interval bases#General method to determine whether an interval subspace is a subspace of another]].
# Determining whether one interval subspace is a subspace of another: <math>\textbf{b}_1</math> is a subspace of <math>\textbf{b}_2</math> if <math>\textbf{b}_1|\textbf{b}_2 = \textbf{b}_2</math>. For more details, see: [[Temperament merging across interval bases#General method to determine whether an interval subspace is a subspace of another]].
# Comma-merging temperaments with different interval bases, in which case the comma-merged temperament's interval basis will be the merge of the all the input interval bases.
# Comma-merging temperaments across interval bases, in which case the comma-merged temperament's interval basis will be the merge of the all the input interval bases.


== Intersecting ==
== Intersecting ==
Line 194: Line 194:
Finding the intersection of interval bases is surprisingly tricky<ref>This approach was found by Sintel here: https://math.stackexchange.com/questions/1560411/basis-for-the-intersection-of-two-integer-lattices/2472784#2472784</ref>:
Finding the intersection of interval bases is surprisingly tricky<ref>This approach was found by Sintel here: https://math.stackexchange.com/questions/1560411/basis-for-the-intersection-of-two-integer-lattices/2472784#2472784</ref>:


# Convert the interval bases to matrices, as with a merge.
# Convert the interval bases to formal prime matrices, as with a merge.
# Create a [[Wikipedia:Block_matrix|block matrix]] by stacking two copies of one interval basis on the left side, and then setting one copy of the other interval basis on the right side, with the bottom-right quadrant of this block matrix filled in with all zeros.
# Create a [[Wikipedia:Block_matrix|block matrix]] by stacking two copies of one formal prime matrix on the left side, and then setting one copy of the other formal prime matrix on the right side, with the bottom-right quadrant of this block matrix filled in with all zeros.
# HNF this.
# HNF this.
# The results we want are in the bottom-right. We take only half-columns, from the bottom half, and only half-columns where their corresponding top-half are all zeros (which will only happen to columns that are sorted to the right side).
# The results we want are in the bottom-right. We take only half-columns, from the bottom half, and only half-columns where their corresponding top-half are all zeros (which will only happen to columns that are sorted to the right side).
# Canonicalize.
# Canonicalize.


The reason this works is that wherever the corresponding top-half columns are all zeros, this was achieved through linear combinations of vectors from both interval bases, which means the information below them represents vectors that are in both of them. In other words, if <math>(x, x) + (y, 0) = (0, z)</math> and <math>x</math> is in <math>B_1</math> and <math>y</math> is in <math>B_2</math>, then we must have <math>x + y = 0</math> and <math>z = x</math><ref>credit this explanation to Tom Price on Discord</ref>. We're sort of abusing HNF as a way to solve a system, kind of like [[Douglas Blumeyer's RTT How-To#Null-space|when we calculate the null-space]]<ref>Credit this explanation to Sintel on Discord</ref>.
The reason this works is that wherever the corresponding top-half columns are all zeros, this was achieved through linear combinations of vectors from both interval bases, which means the information below them represents vectors that are in both of them. In other words, if <math>(x, x) + (y, 0) = (0, z)</math> and <math>x</math> is in <math>\textbf{b}_1</math> and <math>y</math> is in <math>\textbf{b}_2</math>, then we must have <math>x + y = 0</math> and <math>z = x</math><ref>credit this explanation to Tom Price on Discord</ref>. We're sort of abusing HNF as a way to solve a system, kind of like [[Douglas Blumeyer's RTT How-To#Null-space|when we calculate the null-space]]<ref>Credit this explanation to Sintel on Discord</ref>.


=== But first: a gentle introduction ===
=== But first: a gentle introduction ===
Line 210: Line 210:
Let's find the intersection of 2.5/3 and 2.9.5.
Let's find the intersection of 2.5/3 and 2.9.5.


First, the two interval bases as matrices:
First, the two interval bases as formal prime matrices:




Line 359: Line 359:
=== Notation ===
=== Notation ===


The notation for interval basis intersecting we'll use here is just the intersection symbol: <math>B_1∩B_2</math>.
The notation for interval basis intersecting we'll use here is just the intersection symbol: <math>\textbf{b}_1∩\textbf{b}_2</math>.


=== Applications ===
=== Applications ===
Line 367: Line 367:
= Changing interval basis =
= Changing interval basis =


[[File:Two-way bridge.png|400px|right|thumb|An interval rebase forms a two-way bridge between a superspace basis <math>B_L</math> and a subspace basis <math>B_s</math>. But mappings can only use it to go from the superspace to the subspace, and comma bases can only use it to go from the subspace to the superspace.]]
[[File:Two-way bridge.png|400px|right|thumb|An interval rebase forms a two-way bridge between an interval superspace basis <math>\textbf{b}_L</math> and an interval subspace basis <math>\textbf{b}_s</math>. But mappings can only use it to go from the superspace to the subspace, and comma bases can only use it to go from the subspace to the superspace.]]


Given an interval, comma basis, or mapping — anything that has an associated interval basis — it is possible to change it from one interval basis to another. We can accomplish this using an '''interval rebase''', an object that works like a two-way bridge between two interval bases.  
Given an interval, comma basis, or mapping — anything that has an associated interval basis — it is possible to change it from one interval basis to another. We can accomplish this using an '''interval rebase''', an object that works like a two-way bridge between two interval bases.  


Elsewhere, these have been called [[subgroup basis matrices]], but that terminology will not be used here, for the same reasons as are described in the last section of this article (here: [[Interval basis#Terminology: interval basis vs. subgroup]]) as well as the additional reason that such a name can easily be conflated with the interval basis itself. Sometimes the superspace interval basis is an identity matrix, in which case the interval rebase will be the same as the subspace interval basis, but this is not always the case.
Elsewhere, these have been called [[subgroup basis matrices]], but that terminology will not be used here, for the same reasons as are described in the last section of this article (here: [[Interval basis#Terminology: interval basis vs. subgroup]]) as well as the additional reason that such a name can easily be conflated with the interval basis itself. Sometimes the interval superspace's formal prime matrix is an identity matrix, in which case the interval rebase will be the same as the interval subspace's formal prime matrix, but this is not always the case.


As discussed earlier, only certain interval basis changes are possible: (here: [[Temperament merging across interval bases#Application: determining whether it is possible to change the interval subspace]]). To quickly recap here, it is only possible to change between interval subspaces where one is a subspace of the other. So when we say a given interval rebase works like a two-way bridge, there's a more specific way to say what we mean: an interval rebase allows us to change either ''from the subspace to the superspace'', or ''from the superspace to the subspace''. Which direction we go just depends on which side we enter the bridge from: the right side or the left side.
As discussed earlier, only certain interval basis changes are possible: (here: [[Temperament merging across interval bases#Application: determining whether it is possible to change the interval subspace]]). To quickly recap here, it is only possible to change between interval subspaces where one is a subspace of the other. So when we say a given interval rebase works like a two-way bridge, there's a more specific way to say what we mean: an interval rebase allows us to change either ''from the subspace to the superspace'', or ''from the superspace to the subspace''. Which direction we go just depends on which side we enter the bridge from: the right side or the left side.
Line 379: Line 379:
Here are the steps:
Here are the steps:
# Set up a matrix with <math>d_L</math> rows, where <math>d_L</math> is the dimensionality of the superspace, and <math>d_s</math> columns, where <math>d_s</math> is the dimensionality of the subspace<ref>We're borrowing <math>L</math> and <math>s</math> from [[MOS]] scale theory; there's no direct conceptual connection here, nor any need to understand anything about such scale theory at this moment, but if you happen to be familiar with the conventional use of <math>L</math> for "Large" and <math>s</math> for "small" in that other xenharmonic topic, then this variable choice may be particularly helpful for you.</ref>.
# Set up a matrix with <math>d_L</math> rows, where <math>d_L</math> is the dimensionality of the superspace, and <math>d_s</math> columns, where <math>d_s</math> is the dimensionality of the subspace<ref>We're borrowing <math>L</math> and <math>s</math> from [[MOS]] scale theory; there's no direct conceptual connection here, nor any need to understand anything about such scale theory at this moment, but if you happen to be familiar with the conventional use of <math>L</math> for "Large" and <math>s</math> for "small" in that other xenharmonic topic, then this variable choice may be particularly helpful for you.</ref>.
# Label the rows with the superspace interval basis.
# Label the rows with the superspace formal primes.
# Label the columns with the subspace interval basis.
# Label the columns with the subspace formal primes.
# Fill in each entry with the count of formal primes from the superspace basis for this row that could be used to build the formal primes in the subspace interval basis for this column.
# Fill in each entry with the count of formal primes from the interval superspace basis for this row that could be used to build the formal primes in the interval subspace basis for this column.


=== Example ===  
=== Example ===  


Let's construct the interval rebase <math>R</math> between 2.25/9.11/7 and 2.5/3.7.11. [[Temperament merging across interval bases#Example|As we proved earlier]], the former is a subspace of the latter. So this will be a 4×3 matrix.  
Let's construct the interval rebase <math>R</math> between 2.25/9.11/7 and 2.5/3.7.11. [[Temperament merging in different interval subspaces#Example|As we proved earlier]], the former is a subspace of the latter. So this will be a 4×3 matrix.  


* The first column is easy. There's no change to prime 2 between these two interval bases.  
* The first column is easy. There's no change to prime 2 between these two interval bases.  
Line 438: Line 438:
=== Examples ===
=== Examples ===


Suppose we have the interval rebase <math>R_{L↔s}</math> between 2.3.5.7 <math>B_L</math> and 2.9/7.5/3 <math>B_s</math>. The superspace is 2.3.5.7, so that's the rows, and 2.9/7.5/3 is the subspace, so that's the columns. And so here's our <math>R_{L↔s}</math>:
Suppose we have the interval rebase <math>R_{L↔s}</math> between 2.3.5.7 <math>\textbf{b}_L</math> and 2.9/7.5/3 <math>\textbf{b}_s</math>. The superspace is 2.3.5.7, so that's the rows, and 2.9/7.5/3 is the subspace, so that's the columns. And so here's our <math>R_{L↔s}</math>:




Line 477: Line 477:




First, let's use this to convert a comma basis <math>C_s</math> (that's in the <math>B_s</math> interval subspace) to the <math>B_L</math>interval subspace, by doing <math>R_{L↔s}.C</math>:
First, let's use this to convert a comma basis <math>C_s</math> (that's in the <math>\textbf{b}_s</math> interval subspace) to the <math>\textbf{b}_L</math>interval subspace, by doing <math>R_{L↔s}.C</math>:




Line 605: Line 605:




And now let's use <math>R_{L↔s}</math> to convert a mapping the other way, from <math>B_L</math> to <math>B_s</math>, by doing <math>M_L.R_{L↔s}</math>:
And now let's use <math>R_{L↔s}</math> to convert a mapping the other way, from <math>\textbf{b}_L</math> to <math>\textbf{b}_s</math>, by doing <math>M_L.R_{L↔s}</math>:




Line 699: Line 699:
== Comma-merge ==
== Comma-merge ==


First, let's work through an example of a cross-interval basis comma-merge: meantone <math>T_1</math> with archytas <math>T_2</math>, where meantone is in the 5-limit standard interval basis 2.3.5, which we'll call <math>B_1</math>, and archytas is in the 2.3.7 interval basis, which we'll call <math>B_2</math>.
First, let's work through an example of a comma-merge across interval bases: meantone <math>T_1</math> with archytas <math>T_2</math>, where meantone is in the 5-limit standard interval basis 2.3.5, which we'll call <math>\textbf{b}_1</math>, and archytas is in the 2.3.7 interval basis, which we'll call <math>\textbf{b}_2</math>.


First we must merge these two temperaments' interval bases. Concatenate them to 2.3.5.2.3.7, then convert to matrix:
First we must merge these two temperaments' interval bases. Concatenate them to 2.3.5.2.3.7, then convert to matrix:
Line 747: Line 747:




Then remove the columns of all zeros, go back to number list form, and make sure everything's greater than 1, which it is already. And so the merged interval basis <math>B_1|B_2</math> is 2.3.5.7.
Then remove the columns of all zeros, go back to number list form, and make sure everything's greater than 1, which it is already. And so the merged formal prime matrix <math>F_1|F_2</math> is 2.3.5.7.


Now we change the interval basis for each comma basis to <math>B_1|B_2</math>. Let's do meantone first. First we need to find our interval rebase <math>R_{B_1|B_2↔B_1}</math>.
Now we change the formal prime matrix for each comma basis to <math>F_1|F_2</math>. Let's do meantone first. First we need to find our interval rebase <math>R_{F_1|F_2↔F_1}</math>.


Actually, <math>R_{1|2↔1}</math> is easier enough to read, and still clear enough, so we'll use that notation moving forward. And here it is itself:
Actually, <math>R_{1|2↔1}</math> is easier enough to read, and still clear enough, so we'll use that notation moving forward. And here it is itself:
Line 1,143: Line 1,143:
== Map-merge ==
== Map-merge ==


Now, let's work through an example of a cross-interval basis map-merge: 22 equal temperament <math>T_1</math> with 17 equal temperament <math>T_2</math>, where 22-ET is in the interval basis 2.3.5.11, which we'll call <math>B_1</math>, and 17-ET is in the 2.9.7.11 interval basis, which we'll call <math>B_2</math>.
Now, let's work through an example of a map-merge of temperaments with different formal primes: 22 equal temperament <math>T_1</math> with 17 equal temperament <math>T_2</math>, where 22-ET has interval basis 2.3.5.11, which we'll call <math>\textbf{b}_1</math>, and 17-ET has interval basis 2.9.7.11, which we'll call <math>\textbf{b}_2</math>.


First we must intersect these two temperaments' interval bases. The first step of that is to convert them to matrices which have formal primes as columns and the merged set of the primes they factor into as the rows:
First we must intersect these two temperaments' interval bases. The first step of that is to convert them to formal prime matrices which have the formal primes as columns and the merged set of the primes they factor into as the rows:




Line 1,289: Line 1,289:




Canonicalize (HNF, remove all-zero columns, back to number list form, and make super). So that tells us that the intersected interval basis <math>B1∩B2</math> is 2.9.11.
Canonicalize (HNF, remove all-zero columns, back to number list form, and make super). So that tells us that the intersected interval basis <math>\textbf{b}_1∩\textbf{b}_2</math> is 2.9.11.


Now we change the interval basis for each mapping to <math>B1∩B2</math>. Let's do 22-ET first. First we need to find our interval rebase <math>R_{1↔1∩2}</math>:
Now we change the interval basis for each mapping to <math>\textbf{b}_1∩\textbf{b}_2</math>. Let's do 22-ET first. First we need to find our interval rebase <math>R_{1↔1∩2}</math>: