back to list

Translate Between Tunings

🔗Chris Vaisvil <chrisvaisvil@...>

1/7/2013 5:07:47 PM

Hello,

Most of the time when I (and I think most people) re-tune a piece they
change the master tuning and let it go. What would actually be a proper
(and until someone writes software to do this, and tedious) approach is to
shift the original pitch in the composition to the nearest quasi-equivalent
pitch. Doing this would keep intact far more information - such as chord
progressions. As an aid I put together a spreadsheet that attempts to
identify equivalents - this is a first pass. If you don't like my choices -
change them! I figure I'll find out more as I use this tool.

http://micro.soonlabel.com/various/translateBook1.pdf

Chris

🔗gedankenwelt94 <gedankenwelt94@...>

1/9/2013 2:15:30 PM

--- In tuning@yahoogroups.com, Chris Vaisvil wrote:
> What would actually be a proper
> (and until someone writes software to do this, and tedious) approach
is to
> shift the original pitch in the composition to the nearest
quasi-equivalent
> pitch.

...just in case someone is interested, there's a (more costly) procedure
that *I think* does exactly that, but adds some context which makes it
easier to see what happens temperament-wise:

Basically, you look at the higher-numbered edo and determine the
quasi-equal MOS with the same number of notes as the lower-numbered edo.
(with 'quasi-equal MOS', I mean a MOS where the chroma L - s is a single
step)

Then you determine the generator for the quasi-equal MOS, and the
corresponding generator for the lower-numbered edo.

Finally, all notes are represented in terms of stacked generators (most
simple representation), and you simply replace the former generator with
the new one.

Example 1:

We want to translate between 12-edo and 19-edo. The 12-tone quasi-equal
MOS in 19-edo has a generator g = 8\19, and the corresponding generator
in 12-edo is 5\12 (so it's a meantone mapping).

In 19-edo, we represent "1 2 3 4 ..." as "-7g 5g -2g -9g ...", and in
12-edo, "1 2 3 4 ..." become "5g -2g 3g -4g ..." .

So 1\19 = -7g and 2\19 = 5g both become -7g = 5g = 1\12, if g = 8\19 is
replaced by 5\12. Vice-versa, 1\12 = 5g becomes 5g = 2\19 if g = 5\12 is
replaced by 8\19. Note that 6\12 has two most simple representations, 6g
and -6g, so it can be mapped to either 9\19 or 10\19.

All in all, 12-edo is mapped to "0 2 3 5 6 8 {9,10} 11 13 14 16 17 19"
in 19-edo, and "0 {1,2} 3 {4,5} 6 {7,8} {9,10} {11,12} 13 {14,15} 16
{17,18} 19" in 19-edo is mapped to 12-edo.

Example 2:

This time, it's 12-edo and 15-edo. In 15-edo, the 12-tone quasi-equal
MOS has generator g = 1\15 and period P = 1\3, the corresponding
generator for 12-edo is g = 1\12 (also with P = 1\3). The period can be
computed by dividing the octave (1\1) by gcd(12,15) = 3.

Here, "0 1 2 3 4" in 12-edo is mapped to "0 1 {2,3} 4 5" in 15-edo for
each period, and vice-versa. So all in all, 12-edo is mapped to "0 1
{2,3} 4 5 6 {7,8} 9 10 11 {12,13} 14 15", and vice-versa, and the
5-limit temperament associated with the generators and period is
'augmented'.

So, how do we know which generators work?

Well, mathematically speaking, if we have b-edo and d-edo (d > b > 1,
both coprime), we can find generators a\b and c\d which are a farey
pair, i.e. a*d - bc = +-1. That means both generators are "similar in
size", and a\b generates b-edo, while c\d generates d-edo, and a b-tone
quasi-equal MOS in d-edo.
If b and d are not coprime, we can apply a period P = 1\gcd(b,d),
represent the generators as fractions of P, and then it works the same
as above.

To find such a farey pair, I usually use the Stern-Brocot tree (aka
Wilson's scale tree <http://www.anaphoria.com/sctree.PDF> ), but there's
probably a simple algorithm that does the job as well.

I also made a table
<http://f1.grp.yahoofs.com/v1/QMztULTcEJ30waAonIPTeDk2A12o6lQZdNMvU6NrTj\
O1Hab0PxKM02mZl5n9x9PsuFMf4jSiFNB0wK9SWrGeKm001LUz15G4Z7s/Gedankenwelt/E\
DO%20pairs%20-%20farey%20pairs.txt> where you can look up such a
generator (farey) pair for a given pair of edos.
Note that generators in [] are given as fractions of the period, not of
the octave. So if you look up 12- and 15-edo, you'll find [1\4] and
[1\5] which relate to the period 1\3, but as an octave fraction, it's
1\12 and 1\15.

-Gedankenwelt

P.S.: Can someone confirm that this method works appropriately, and
always maps to the nearest pitch, if non-ambiguous?
(assuming both edos share a common pitch)

🔗chrisvaisvil@...

1/9/2013 3:17:39 PM

If I follow what you wrote there should be a family of 12 note scala files for many tunings that can be a "drop in" replacement for 12 equal. Is that right Gene?
*

-----Original Message-----
From: "gedankenwelt94" <gedankenwelt94@yahoo.com>
Sender: tuning@yahoogroups.com
Date: Wed, 09 Jan 2013 22:15:30
To: <tuning@yahoogroups.com>
Reply-To: tuning@yahoogroups.com
Subject: [tuning] Re: Translate Between Tunings

--- In tuning@yahoogroups.com, Chris Vaisvil wrote:
> What would actually be a proper
> (and until someone writes software to do this, and tedious) approach
is to
> shift the original pitch in the composition to the nearest
quasi-equivalent
> pitch.

...just in case someone is interested, there's a (more costly) procedure
that *I think* does exactly that, but adds some context which makes it
easier to see what happens temperament-wise:

Basically, you look at the higher-numbered edo and determine the
quasi-equal MOS with the same number of notes as the lower-numbered edo.
(with 'quasi-equal MOS', I mean a MOS where the chroma L - s is a single
step)

Then you determine the generator for the quasi-equal MOS, and the
corresponding generator for the lower-numbered edo.

Finally, all notes are represented in terms of stacked generators (most
simple representation), and you simply replace the former generator with
the new one.

Example 1:

We want to translate between 12-edo and 19-edo. The 12-tone quasi-equal
MOS in 19-edo has a generator g = 8\19, and the corresponding generator
in 12-edo is 5\12 (so it's a meantone mapping).

In 19-edo, we represent "1 2 3 4 ..." as "-7g 5g -2g -9g ...", and in
12-edo, "1 2 3 4 ..." become "5g -2g 3g -4g ..." .

So 1\19 = -7g and 2\19 = 5g both become -7g = 5g = 1\12, if g = 8\19 is
replaced by 5\12. Vice-versa, 1\12 = 5g becomes 5g = 2\19 if g = 5\12 is
replaced by 8\19. Note that 6\12 has two most simple representations, 6g
and -6g, so it can be mapped to either 9\19 or 10\19.

All in all, 12-edo is mapped to "0 2 3 5 6 8 {9,10} 11 13 14 16 17 19"
in 19-edo, and "0 {1,2} 3 {4,5} 6 {7,8} {9,10} {11,12} 13 {14,15} 16
{17,18} 19" in 19-edo is mapped to 12-edo.

Example 2:

This time, it's 12-edo and 15-edo. In 15-edo, the 12-tone quasi-equal
MOS has generator g = 1\15 and period P = 1\3, the corresponding
generator for 12-edo is g = 1\12 (also with P = 1\3). The period can be
computed by dividing the octave (1\1) by gcd(12,15) = 3.

Here, "0 1 2 3 4" in 12-edo is mapped to "0 1 {2,3} 4 5" in 15-edo for
each period, and vice-versa. So all in all, 12-edo is mapped to "0 1
{2,3} 4 5 6 {7,8} 9 10 11 {12,13} 14 15", and vice-versa, and the
5-limit temperament associated with the generators and period is
'augmented'.

So, how do we know which generators work?

Well, mathematically speaking, if we have b-edo and d-edo (d > b > 1,
both coprime), we can find generators a\b and c\d which are a farey
pair, i.e. a*d - bc = +-1. That means both generators are "similar in
size", and a\b generates b-edo, while c\d generates d-edo, and a b-tone
quasi-equal MOS in d-edo.
If b and d are not coprime, we can apply a period P = 1\gcd(b,d),
represent the generators as fractions of P, and then it works the same
as above.

To find such a farey pair, I usually use the Stern-Brocot tree (aka
Wilson's scale tree <http://www.anaphoria.com/sctree.PDF> ), but there's
probably a simple algorithm that does the job as well.

I also made a table
<http://f1.grp.yahoofs.com/v1/QMztULTcEJ30waAonIPTeDk2A12o6lQZdNMvU6NrTj\
O1Hab0PxKM02mZl5n9x9PsuFMf4jSiFNB0wK9SWrGeKm001LUz15G4Z7s/Gedankenwelt/E\
DO%20pairs%20-%20farey%20pairs.txt> where you can look up such a
generator (farey) pair for a given pair of edos.
Note that generators in [] are given as fractions of the period, not of
the octave. So if you look up 12- and 15-edo, you'll find [1\4] and
[1\5] which relate to the period 1\3, but as an octave fraction, it's
1\12 and 1\15.

-Gedankenwelt

P.S.: Can someone confirm that this method works appropriately, and
always maps to the nearest pitch, if non-ambiguous?
(assuming both edos share a common pitch)

🔗gedankenwelt94 <gedankenwelt94@...>

1/9/2013 5:32:26 PM

--- In tuning@yahoogroups.com, chrisvaisvil@... wrote:
>
> If I follow what you wrote there should be a family of 12 note scala
files for many tunings that can be a "drop in" replacement for 12 equal.
Is that right Gene?
> *

Hi,

first of all, I'm not Gene - I take that as a huge compliment, though.
;)

Yes, you can use the table and look up 12-edo and any higher-numbered
edo, and use the generator from the higher-numbered edo to generate a
12-tone linear temperament in scala. Just make sure that if the
generator is given in [], you have to determine the period and multiply
the generator by it, then you can input the period and generator in
scala using the lineartemp command
<https://xenharmonic.wikispaces.com/Creating+Scala+scl+files+for+rank+tw\
o+temperaments?responseToken=0b5dd058418014f0ccd4c275dcb89cfc7> .

For example, looking up 12- and 22-edo leads to a generator of [2\11]
(related to the period 1\2) for 22-edo. The period is 1\gcd(12,22) =
1\2, so the "real" generator (as an octave fraction) is 2\11 * 1\2 =
1\11.

Maybe it's also possible to use Graham's temperament finder to generate
the same scala file, but its extended application possibilities are
still way over my head. ;)

My main idea, however was not to find a practical way to generate
replacements for 12-edo, but to analyze what happens from a
temperament-related perspective when a piece is retuned from one edo to
another in the way you described it.
This way, one can estimate where adjustments will probably be necessary
after retuning, or if one should opt to choose a different way of
retuning from the start, instead of just going for the nearest pitch.

... oh, and sorry if my writing style is a little confusing (I know it
often is).

🔗genewardsmith <genewardsmith@...>

1/10/2013 7:14:43 AM

--- In tuning@yahoogroups.com, "gedankenwelt94" wrote:

> To find such a farey pair, I usually use the Stern-Brocot tree (aka
> Wilson's scale tree ), but there's
> probably a simple algorithm that does the job as well.

The Euclidean algorithm does the trick. Let's say you want to relate 12 to 19, then the penultimate convergent to 19/12 is 8/5, and the penultimate semiconvergent is 11/7. So you can use 5\12 vs 8\19, or equivalently 7\12 vs 11\19. For 12 and 15 you get 15/12 = 5/4, with 1/1 as penultimate. So you end up with 1/5 vs 1/4 as your Farey pair, which in terms of octaves becomes 1\15 vs 1\12.

🔗chrisvaisvil@...

1/10/2013 8:03:23 AM

How difficult would it be to generate a series of scala files for translation between edos?

Chris
*

-----Original Message-----
From: "genewardsmith" <genewardsmith@sbcglobal.net>
Sender: tuning@yahoogroups.com
Date: Thu, 10 Jan 2013 15:14:43
To: <tuning@yahoogroups.com>
Reply-To: tuning@yahoogroups.com
Subject: [tuning] Re: Translate Between Tunings

--- In tuning@yahoogroups.com, "gedankenwelt94" wrote:

> To find such a farey pair, I usually use the Stern-Brocot tree (aka
> Wilson's scale tree ), but there's
> probably a simple algorithm that does the job as well.

The Euclidean algorithm does the trick. Let's say you want to relate 12 to 19, then the penultimate convergent to 19/12 is 8/5, and the penultimate semiconvergent is 11/7. So you can use 5\12 vs 8\19, or equivalently 7\12 vs 11\19. For 12 and 15 you get 15/12 = 5/4, with 1/1 as penultimate. So you end up with 1/5 vs 1/4 as your Farey pair, which in terms of octaves becomes 1\15 vs 1\12.

------------------------------------

You can configure your subscription by sending an empty email to one
of these addresses (from the address at which you receive the list):
tuning-subscribe@yahoogroups.com - join the tuning group.
tuning-unsubscribe@yahoogroups.com - leave the group.
tuning-nomail@yahoogroups.com - turn off mail from the group.
tuning-digest@yahoogroups.com - set group to send daily digests.
tuning-normal@yahoogroups.com - set group to send individual emails.
tuning-help@yahoogroups.com - receive general help information.
Yahoo! Groups Links

🔗gedankenwelt94 <gedankenwelt94@...>

1/10/2013 7:04:28 PM

--- In tuning@yahoogroups.com, "genewardsmith" wrote:
> The Euclidean algorithm does the trick. Let's say you want to relate 12 to 19, then the penultimate convergent to 19/12 is 8/5, and the penultimate semiconvergent is 11/7. So you can use 5\12 vs 8\19, or equivalently 7\12 vs 11\19. For 12 and 15 you get 15/12 = 5/4, with 1/1 as penultimate. So you end up with 1/5 vs 1/4 as your Farey pair, which in terms of octaves becomes 1\15 vs 1\12.

Hey, thanks for the hint! :)

...and sorry I was too lazy to check it out by myself, it should have been obvious to me:

- use Euclid's algorithm to compute c := b^(-1) mod d
- compute a := (bc-1)/d
-> farey pairs (a\b, c\d) and (1-a\b, 1-c\d)

🔗gedankenwelt94 <gedankenwelt94@...>

1/10/2013 8:11:02 PM

--- In tuning@yahoogroups.com, chrisvaisvil@... wrote:
>
> How difficult would it be to generate a series of scala files for translation between edos?

Very easy when just going for the nearest pitch. Here's some pseudo code for imbedding 12-edo into 19-edo, and printing out the result in cents:

int src_edo := 12
int dst_edo := 19

for (int x := 0 to dst_edo)
{
print 1200 * floor(dst_edo * x/src_edo + 0.5) / dst_edo
}

...the method that I mentioned requires to implement the Euclidean algorithm (gcd, multiplicative inverses mod m), but otherwise it's also not to hard to code. However, I think this will produce the same scale as the simple approach, so it's probably not necessary.

If you want I could write a simple console application in C++ and send you the exe (for Windows) and the source code, but I won't get to it before Sunday.

Btw, I think a nice feature would be if you could opt, for example, to imbed 12-edo first into 31-edo (-> meantone mapping), and then imbed that 12-tone 31-edo scale into 53-edo (-> orwell mapping), instead of directly moving from 12-edo to 53-edo (-> schismatic / pythagorean mapping).

🔗Chris Vaisvil <chrisvaisvil@...>

1/11/2013 8:07:51 PM

If you would not mind doing that I would appreciate it greatly!

Also I like you 12 => 31 => 53[orwell] idea

On Thu, Jan 10, 2013 at 11:11 PM, gedankenwelt94
<gedankenwelt94@...>wrote:

> **
>
>
> --- In tuning@yahoogroups.com, chrisvaisvil@... wrote:
> >
> > How difficult would it be to generate a series of scala files for
> translation between edos?
>
> Very easy when just going for the nearest pitch. Here's some pseudo code
> for imbedding 12-edo into 19-edo, and printing out the result in cents:
>
> int src_edo := 12
> int dst_edo := 19
>
> for (int x := 0 to dst_edo)
> {
> print 1200 * floor(dst_edo * x/src_edo + 0.5) / dst_edo
> }
>
> ...the method that I mentioned requires to implement the Euclidean
> algorithm (gcd, multiplicative inverses mod m), but otherwise it's also not
> to hard to code. However, I think this will produce the same scale as the
> simple approach, so it's probably not necessary.
>
> If you want I could write a simple console application in C++ and send you
> the exe (for Windows) and the source code, but I won't get to it before
> Sunday.
>
> Btw, I think a nice feature would be if you could opt, for example, to
> imbed 12-edo first into 31-edo (-> meantone mapping), and then imbed that
> 12-tone 31-edo scale into 53-edo (-> orwell mapping), instead of directly
> moving from 12-edo to 53-edo (-> schismatic / pythagorean mapping).
>
>
>

🔗gedankenwelt94 <gedankenwelt94@...>

1/18/2013 7:43:10 AM

It took me a bit longer than expected, here
<http://f1.grp.yahoofs.com/v1/YFX5UG6PITYMJwXigjIljFsjLGIaV5ujTVibc8vb6-\
nLC798gMeQ-4rvNw7T8_ND5MHL7fpplvL3FYtlPmol7nxF4rhPsWRojEk/Gedankenwelt/p\
rograms/EDO-translator.zip> it is.

Under Windows you'll just need the .exe file. When saving scale files
for scala, the application will try to create a subfolder in the current
working directory (usually, but not always the directory where you put
the .exe file), so make sure you put it somewhere where it is allowed to
create files. ;)

The 'src' folder is only important if you want to compile it yourself
(e.g. if you use Linux, if you want to modify it, or if you don't trust
me ;). If you want to compile it, make sure the first line is commented
if you use Linux, or uncommented in the case of Windows.

About the application itself:

To navigate through the menus, just type in the appropriate number and
press enter.

If you choose the first mode ("Translate a single EDO into a range of
other EDOs"), you input the EDO that should be translated, and then you
specify the range of EDOs into which it should be translated. For
example, type in 12, 13 and 24 to translate 12-edo into 13-, 14-, 15-,
... and 24-edo. All scales are saved as .scl files automatically.

The second mode ("step-by-step translation mode") allows you to do chain
translations like the one I mentioned (12 -> 31 -> 53). Here, you have
to do each translation manually, and you have to tell the program
explicitely when to save a scale.
Note that when doing chains of two or more translations, the resulting
scale may be "asymmetric" in the sense that it doesn't match any mode
from its mirrored counterpart. When saving such an asymmetric scale, its
mirrored counterpart is saved automatically too, with the addition 'M'
in the file name.

Note that the application currently only allows to translate from
lower-numbered edos to higher-numbered edos.

P.S.: I'll add a README file, and some more comments in the code later,
and probably extend the program by a few features.

🔗gedankenwelt94 <gedankenwelt94@...>

1/18/2013 7:55:11 AM

Oops, dead link.
(sorry, I'm relatively new here, and still have to figure out some stuff)

Anyway, I saved it in the files section in my programs folder, file name is "EDO-translator.zip".

🔗Chris Vaisvil <chrisvaisvil@...>

1/18/2013 3:54:52 PM

Excellent!! Thank you very much! I really appreciate it!

On Fri, Jan 18, 2013 at 10:43 AM, gedankenwelt94
<gedankenwelt94@...>wrote:

> **
>
>
> It took me a bit longer than expected, here<http://f1.grp.yahoofs.com/v1/YFX5UG6PITYMJwXigjIljFsjLGIaV5ujTVibc8vb6-nLC798gMeQ-4rvNw7T8_ND5MHL7fpplvL3FYtlPmol7nxF4rhPsWRojEk/Gedankenwelt/programs/EDO-translator.zip> it
> is.
>
> Under Windows you'll just need the .exe file. When saving scale files for
> scala, the application will try to create a subfolder in the current
> working directory (usually, but not always the directory where you put the
> .exe file), so make sure you put it somewhere where it is allowed to create
> files. ;)
>
> The 'src' folder is only important if you want to compile it yourself
> (e.g. if you use Linux, if you want to modify it, or if you don't trust me
> ;). If you want to compile it, make sure the first line is commented if you
> use Linux, or uncommented in the case of Windows.
>
>
> About the application itself:
>
> To navigate through the menus, just type in the appropriate number and
> press enter.
>
> If you choose the first mode ("Translate a single EDO into a range of
> other EDOs"), you input the EDO that should be translated, and then you
> specify the range of EDOs into which it should be translated. For example,
> type in 12, 13 and 24 to translate 12-edo into 13-, 14-, 15-, ... and
> 24-edo. All scales are saved as .scl files automatically.
>
> The second mode ("step-by-step translation mode") allows you to do chain
> translations like the one I mentioned (12 -> 31 -> 53). Here, you have to
> do each translation manually, and you have to tell the program explicitely
> when to save a scale.
> Note that when doing chains of two or more translations, the resulting
> scale may be "asymmetric" in the sense that it doesn't match any mode from
> its mirrored counterpart. When saving such an asymmetric scale, its
> mirrored counterpart is saved automatically too, with the addition 'M' in
> the file name.
>
> Note that the application currently only allows to translate from
> lower-numbered edos to higher-numbered edos.
>
>
> P.S.: I'll add a README file, and some more comments in the code later,
> and probably extend the program by a few features.
>
>

🔗jdfreivald@...

1/18/2013 3:56:59 PM

gedankenwelt, do you use patent val mappings?

Thanks,
Jake

Sent from my Verizon Wireless BlackBerry

🔗gedankenwelt94 <gedankenwelt94@...>

1/19/2013 2:32:53 AM

--- In tuning@yahoogroups.com, jdfreivald@... wrote:
> gedankenwelt, do you use patent val mappings?

Nope, it's just a simple algorithm that looks at each pitch from the original scale, and translates it to the nearest pitch in the target EDO.

For example, if we have 1\12 (1 step in 12-EDO, or 1/12 octave), and want to translate it to 19-EDO, the algorithm computes 19 * 1/12 = 1.583, which tells us 1\12 is 1.583 steps in 19-EDO, which is rounded to 2 steps in 19-EDO, i.e. 1\12 is translated to 2\19.

However, I *believe* that translating M-EDO to N-EDO (with M<N) this way always results in an N-EDO M-tone MOS with a minimal chroma of 1\N, which would mean the algorithm indirectly "picks" a common linear temperament for both EDOs, and translates the pitches according to this temperament.

Now this temperament could be expressed using vals, but if a val is a patent val in the original EDO, it doesn't have to be a patent val in the target EDO, which means the answer to your question is 'no'.

🔗gedankenwelt94 <gedankenwelt94@...>

1/19/2013 4:24:40 AM

--- In tuning@yahoogroups.com, Chris Vaisvil wrote:
> Excellent!! Thank you very much! I really appreciate it!

I'm glad to hear that! And thanks for having talked about your idea, I found this topic very insightful! :)