Using Scala to transform just intonation

From Xenharmonic Wiki
Revision as of 13:17, 5 September 2011 by Wikispaces>genewardsmith (**Imported revision 250883122 - Original comment: **)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

IMPORTED REVISION FROM WIKISPACES

This is an imported revision from Wikispaces. The revision metadata is included below for reference:

This revision was by author genewardsmith and made on 2011-09-05 13:17:20 UTC.
The original revision id was 250883122.
The revision comment was:

The revision contents are below, presented both in the original Wikispaces Wikitext format, and in HTML exactly as Wikispaces rendered it.

Original Wikitext content:

[[toc|flat]]

=Scala seq files=
Suppose we have a piece in [[Just intonation]] which we want to put into the [[http://www.huygens-fokker.org/scala/seq_format.html|Scala seq file]] format, which is Scala's musical score format. We can enclose the pitch values in parenthesis, so that they have the form (5/4) for a major third or (7/6) for a subminor third. Another form is monzo format, where (|-2 0 1>) can be used in place of (5/4), and (|-1 -1 0 1>) in place of (7/6). An alternative is to use Scala degree numbers. This involves using lines like "4564 note 61 47" in the seq file, where the number right after "note" is the degree or note number. Scala needs additional information in the form of a scale or a declaration of what equal division is being used to interpret the note number, but one of the advantages is that by changing the scale, you can change the music Scala outputs in the form of a midi file.

=Transformations=
Suppose we have a scale in 5-limit JI. One of the most basic transformations we can apply to such a scale is the major-minor involution. This changes major triads such as 1-5/4-3/2 to minor triads such as 1-6/5-3/2, and vice-versa. Suppose, for example, our scale is the Ellis duodene: 16/15 9/8 6/5 5/4 4/3 45/32 3/2 8/5 5/3 9/5 15/8 2. If we go to "Project" under the "Modify" pull-down menu, we may put "5 24/5" into the box called "Factor pair(s)", then the resulting scale will be 10/9 9/8 5/4 6/5 4/3 27/20 3/2 5/3 8/5 15/8 9/5 2. If we use this scale in place of the duodene (be sure **not** to change the ordering!) using the "Tools" pull-down menu at "Transform sequence to midi file", we will get our original 5-limit duodene piece, only with major and minor switched about. If we put "5 24/5" in the Project command again, we get the duodene back again, which is why this transformation is called an involution.

An alternative method of accomplishing basically the same thing is to use monzo notation for the notes, only //without// parenthesis. That is, a major third is represented, not by (|-2 0 1>), but by |-2 0 1> with no parentheses. To get this seq file to produce a midi, you need to put both a val command and a corresponding equal command at the top of the file, such as "0 val <612 970 1421|" together with "0 equal 612". This has the advantage of not requiring a scale file. To produce a midi file with the majpr-minor involution, replace the mapping for 5 with one for 24/5 in [[612edo]] or whatever equal division you choose to use; in this case "0 val <612 970 1385|".

Original HTML content:

<html><head><title>Using Scala to transform just intonation</title></head><body><!-- ws:start:WikiTextTocRule:4:&lt;img id=&quot;wikitext@@toc@@flat&quot; class=&quot;WikiMedia WikiMediaTocFlat&quot; title=&quot;Table of Contents&quot; src=&quot;/site/embedthumbnail/toc/flat?w=100&amp;h=16&quot;/&gt; --><!-- ws:end:WikiTextTocRule:4 --><!-- ws:start:WikiTextTocRule:5: --><a href="#Scala seq files">Scala seq files</a><!-- ws:end:WikiTextTocRule:5 --><!-- ws:start:WikiTextTocRule:6: --> | <a href="#Transformations">Transformations</a><!-- ws:end:WikiTextTocRule:6 --><!-- ws:start:WikiTextTocRule:7: -->
<!-- ws:end:WikiTextTocRule:7 --><br />
<!-- ws:start:WikiTextHeadingRule:0:&lt;h1&gt; --><h1 id="toc0"><a name="Scala seq files"></a><!-- ws:end:WikiTextHeadingRule:0 -->Scala seq files</h1>
Suppose we have a piece in <a class="wiki_link" href="/Just%20intonation">Just intonation</a> which we want to put into the <a class="wiki_link_ext" href="http://www.huygens-fokker.org/scala/seq_format.html" rel="nofollow">Scala seq file</a> format, which is Scala's musical score format. We can enclose the pitch values in parenthesis, so that they have the form (5/4) for a major third or (7/6) for a subminor third. Another form is monzo format, where (|-2 0 1&gt;) can be used in place of (5/4), and (|-1 -1 0 1&gt;) in place of (7/6). An alternative is to use Scala degree numbers. This involves using lines like &quot;4564 note 61 47&quot; in the seq file, where the number right after &quot;note&quot; is the degree or note number. Scala needs additional information in the form of a scale or a declaration of what equal division is being used to interpret the note number, but one of the advantages is that by changing the scale, you can change the music Scala outputs in the form of a midi file.<br />
<br />
<!-- ws:start:WikiTextHeadingRule:2:&lt;h1&gt; --><h1 id="toc1"><a name="Transformations"></a><!-- ws:end:WikiTextHeadingRule:2 -->Transformations</h1>
Suppose we have a scale in 5-limit JI. One of the most basic transformations we can apply to such a scale is the major-minor involution. This changes major triads such as 1-5/4-3/2 to minor triads such as 1-6/5-3/2, and vice-versa. Suppose, for example, our scale is the Ellis duodene: 16/15 9/8 6/5 5/4 4/3 45/32 3/2 8/5 5/3 9/5 15/8 2. If we go to &quot;Project&quot; under the &quot;Modify&quot; pull-down menu, we may put &quot;5 24/5&quot; into the box called &quot;Factor pair(s)&quot;, then the resulting scale will be 10/9 9/8 5/4 6/5 4/3 27/20 3/2 5/3 8/5 15/8 9/5 2. If we use this scale in place of the duodene (be sure <strong>not</strong> to change the ordering!) using the &quot;Tools&quot; pull-down menu at &quot;Transform sequence to midi file&quot;, we will get our original 5-limit duodene piece, only with major and minor switched about. If we put &quot;5 24/5&quot; in the Project command again, we get the duodene back again, which is why this transformation is called an involution.<br />
<br />
An alternative method of accomplishing basically the same thing is to use monzo notation for the notes, only <em>without</em> parenthesis. That is, a major third is represented, not by (|-2 0 1&gt;), but by |-2 0 1&gt; with no parentheses. To get this seq file to produce a midi, you need to put both a val command and a corresponding equal command at the top of the file, such as &quot;0 val &lt;612 970 1421|&quot; together with &quot;0 equal 612&quot;. This has the advantage of not requiring a scale file. To produce a midi file with the majpr-minor involution, replace the mapping for 5 with one for 24/5 in <a class="wiki_link" href="/612edo">612edo</a> or whatever equal division you choose to use; in this case &quot;0 val &lt;612 970 1385|&quot;.</body></html>