<commit_before><html><body>
<canvas id="myc" width="2400" height="600"></canvas>
<br />
<div id="loudestfreq"></div>
<br />
<label for="mode">Mode</label>
<select name="mode" id="mode" >
  <option value="lydian">Lydian (church Ionian, mesopotamian nīd qabli)</option>
  <option value="phrygian">Phrygian (church Dorian, mesopotamian embūbu)</option>
  <option selected="selected" value="dorian">Dorian (church Phyrgian, mesopotamian išartu)</option>
  <option value="hypolydian">Hypolydian (church Lydian, mesopotamian nīš gabarî)</option>
  <option value="hypophrygian">Hypophrygian (church Mixolydian, mesopotamian pūtu)</option>
  <option value="hypodorian">Hypodorian/Locrian (church Aeolian, mesopotamian kitmu)</option>
  <option value="mixolydian">Mixolydian (church Locrian, mesopotamian qablītu)</option>
  <option value="just">Just intonation (5-limit from C, Ptolemy intense diatonic)</option>
  <option value="pythagorean">Pythagorean FCGDAEB</option>
  <option value="pentatonic_c">Pentatonic CDEGAC (Major, gong, Bhupali, Mohanam, MullaitheemPaaNi)</option>
  <option value="pentatonic_d">Pentatonic DEGACD (Suspended, shang, Megh, Madhyamavati, Sendhurutti)</option>
  <option value="pentatonic_e">Pentatonic EGACDE (Blues minor, jue, Malkauns, Hindolam, Indhalam)</option>
  <option value="pentatonic_g">Pentatonic GACDEG (Blues major, zhi, Durga, Shuddha Saveri, Konrai)</option>
  <option value="pentatonic_a">Pentatonic ACDEGA (Minor, yu, Dhani, Udayaravichandrika, Aambal)</option>
</select>

<label for="basenote">Set note </label>
<select name="basenote" id="basenote" >
  <option selected="selected" value="0">A</option>
  <option value="1">B</option>
  <option value="2">C</option>
  <option value="3">D</option>
  <option value="4">E</option>
  <option value="5">F</option>
  <option value="6">G</option>
</select>
<label for="basenotehz">to Hz</label>
<input type="text" name="basenotehz" id="basenotehz" value="432" size=5 ></input>
<label for="octave">Add octaves</label>
<select name="octave" id="octave" >
  <option value="-2">-2</option>
  <option value="-1">-1</option>
  <option selected="selected" value="0">0</option>
  <option value="1">1</option>
  <option value="2">2</option>
</select>
<br/>
<button onclick='javascript:changemode();'>Update frequencies:</button>
<label id="freqs"></label>


<script>
const WIDTH=2400;
const HEIGHT=600;


// Tuning 7 string lyre for Ancient Greek modes by alternating ascending or descending fifths and fourths:
// https://www.reddit.com/r/lyres/comments/kntcxl/method_for_tuning_a_sevenstring_lyre_by_ear_a/
// https://youtu.be/Yk6bLMe2Uak?t=318
// https://pages.mtu.edu/~suits/fifths.html

// https://en.wikipedia.org/wiki/Just_intonation
// https://en.wikipedia.org/wiki/Pythagorean_tuning
// https://en.wikipedia.org/wiki/Pentatonic_scale


// This program will help do it visually instead of by ear.

// Mesopotamian names:
// https://en.wikipedia.org/wiki/Music_of_Mesopotamia
// https://www.flutopedia.com/mesopotamian_flutes.htm
// https://books.google.com/books?id=eliIDwAAQBAJ&lpg=PA30&ots=41IchPISlq&dq=qabl%C4%ABtu&pg=PA40#v=onepage&q&f=false



var magnify = 10;
var num_add_octaves_to_mode_lines = 0;

// 440 HZ is conventional for A above middle C.  432 may be preferred for just intonation. 11 is largest prime factor for 440, while 3 is largest for 432.
// Standard middle C is 261.63 Hz

var middle_c = 261.63;

var base_note = 0; 
var base_note_hz = 1;
var adj_base_note_hz = base_note_hz;


const unison = 1.0;
const octave = 2.0;

const fifth = 3.0/2.0;
const fourth = 4.0/3.0;
const desc_fifth = 2.0/3.0;
const desc_fourth = 3.0/4.0;

const tn = [[desc_fourth,fifth],[desc_fifth,fourth]];


// Names per above reddit chart.
const modes = new Map();
modes.set('lydian', [[0,1,0,1,0,1],5,0,0]);
modes.set('phrygian', [[1,0,0,1,0,1],4,0,0]);
modes.set('dorian', [[1,0,1,0,0,1],3,0,0]);
modes.set('hypolydian', [[1,0,1,0,1,0],2,0,0]);
modes.set('hypophrygian', [[1,0,1,0,1,1],1,1,0]);
modes.set('hypodorian', [[1,0,1,1,0,1],0,1,0]);
modes.set('mixolydian', [[1,1,0,1,0,1],6,1,0]);

modes.set('just', [[1.0,9/8,5/4,4/3,3/2,5/3,15/8],5,0,1]);

modes.set('pythagorean', [[32/27,16/9,4/3,1.0,3/2,9/8,27/16],4,0,2]);

modes.set('pentatonic_c', [[1.0,27/24,30/24,36/24,40/24,48/24],4,0,2]);
modes.set('pentatonic_d', [[1.0,27/24,32/24,36/24,42/24,48/24],3,0,2]);<commit_msg>justs<commit_after><html><body>
<canvas id="myc" width="2400" height="600"></canvas>
<br />
<div id="loudestfreq"></div>
<br />
<label for="mode">Mode</label>
<select name="mode" id="mode" >
  <option value="just_c">Just intonation, 5-limit (from C, Greek Lydian, church Ionian, Ptolemy intense diatonic)</option>
  <option value="just_d">Just intonation, 5-limit (from D, Greek Phrygian, church Dorian)</option>
  <option selected="selected" value="just_e">Just intonation, 5-limit (from E, Greek Dorian, church Phyrgian)</option>
  <option value="just_f">Just intonation, 5-limit (from F, Greek Hypolydian, church Lydian)</option>
  <option value="just_g">Just intonation, 5-limit (from G, Greek Hypophrygian, church Mixolydian)</option>
  <option value="just_a">Just intonation, 5-limit (from A, Greek Hypodorian/Locrian, church Aeolian)</option>
  <option value="just_b">Just intonation, 5-limit (from B, Greek Mixolydian, church Locrian)</option>
  <option value="fifths_c">All-fifths Lydian (mesopotamian nīd qabli)</option>
  <option value="fifths_d">All-fifths Phrygian (mesopotamian embūbu)</option>
  <option value="fifths_e">All-fifths Dorian (mesopotamian išartu)</option>
  <option value="fifths_f">All-fifths Hypolydian (mesopotamian nīš gabarî)</option>
  <option value="fifths_g">All-fifths Hypophrygian (mesopotamian pūtu)</option>
  <option value="fifths_a">All-fifths Hypodorian/Locrian (mesopotamian kitmu)</option>
  <option value="fifths_b">All-fifths Mixolydian (mesopotamian qablītu)</option>
  <option value="pythagorean">Pythagorean FCGDAEB</option>
  <option value="pentatonic_c">Pentatonic CDEGAC (Major, gong, Bhupali, Mohanam, MullaitheemPaaNi)</option>
  <option value="pentatonic_d">Pentatonic DEGACD (Suspended, shang, Megh, Madhyamavati, Sendhurutti)</option>
  <option value="pentatonic_e">Pentatonic EGACDE (Blues minor, jue, Malkauns, Hindolam, Indhalam)</option>
  <option value="pentatonic_g">Pentatonic GACDEG (Blues major, zhi, Durga, Shuddha Saveri, Konrai)</option>
  <option value="pentatonic_a">Pentatonic ACDEGA (Minor, yu, Dhani, Udayaravichandrika, Aambal)</option>
</select>

<label for="basenote">Set note </label>
<select name="basenote" id="basenote" >
  <option selected="selected" value="0">A</option>
  <option value="1">B</option>
  <option value="2">C</option>
  <option value="3">D</option>
  <option value="4">E</option>
  <option value="5">F</option>
  <option value="6">G</option>
</select>
<label for="basenotehz">to Hz</label>
<input type="text" name="basenotehz" id="basenotehz" value="432" size=5 ></input>
<label for="octave">Add octaves</label>
<select name="octave" id="octave" >
  <option value="-2">-2</option>
  <option value="-1">-1</option>
  <option selected="selected" value="0">0</option>
  <option value="1">1</option>
  <option value="2">2</option>
</select>
<br />
<button onclick='javascript:changemode();'>Update frequencies:</button>
<label id="freqs"></label>
<br /><br />
[Sample Hz values: A4 = 432, 434, 436, 440, 442, 444, or 446 Hz or C4 = 261.63 Hz]


<script>
const WIDTH=2400;
const HEIGHT=600;


// Tuning 7 string lyre for Ancient Greek modes by alternating ascending or descending fifths and fourths:
// https://www.reddit.com/r/lyres/comments/kntcxl/method_for_tuning_a_sevenstring_lyre_by_ear_a/
// https://youtu.be/Yk6bLMe2Uak?t=318
// https://pages.mtu.edu/~suits/fifths.html

// https://en.wikipedia.org/wiki/Just_intonation
// http://www.tonalsoft.com/enc/j/just.aspx
// https://en.wikipedia.org/wiki/Pythagorean_tuning
// https://en.wikipedia.org/wiki/Pentatonic_scale



// This program will help do it visually instead of by ear.

// Mesopotamian names:
// https://en.wikipedia.org/wiki/Music_of_Mesopotamia
// https://www.flutopedia.com/mesopotamian_flutes.htm
// https://books.google.com/books?id=eliIDwAAQBAJ&lpg=PA30&ots=41IchPISlq&dq=qabl%C4%ABtu&pg=PA40#v=onepage&q&f=false



var magnify = 10;
var num_add_octaves_to_mode_lines = 0;

// 440 HZ is conventional for A above middle C.  432 may be preferred for just intonation. 11 is largest prime factor for 440, while 3 is largest for 432.
// Standard middle C is 261.63 Hz

var middle_c = 261.63;

var base_note = 0; 
var base_note_hz = 1;
var adj_base_note_hz = base_note_hz;


const unison = 1.0;
const octave = 2.0;

const fifth = 3.0/2.0;
const fourth = 4.0/3.0;
const desc_fifth = 2.0/3.0;
const desc_fourth = 3.0/4.0;

const tn = [[desc_fourth,fifth],[desc_fifth,fourth]];

var just_c = [1.0,9/8,5/4,4/3,3/2,5/3,15/8];
var justs = [];
for (let m = 0; m < 7; m++) {
   var just = [];
   for (let n = 0; n < 7; n++) {
     var r = just_c[n];
     if (n < m) {r = r * 2;}
     just.push(r);
   }
   justs.push(just);
}
console.log(justs);

// Names per above reddit chart.
const modes = new Map();
modes.set('fifths_c', [[0,1,0,1,0,1],5,0,0]);
modes.set('fifths_d', [[1,0,0,1,0,1],4,0,0]);
modes.set('fifths_e', [[1,0,1,0,0,1],3,0,0]);
modes.set('fifths_f', [[1,0,1,0,1,0],2,0,0]);
modes.set('fifths_g', [[1,0,1,0,1,1],1,1,0]);
modes.set('fifths_a', [[1,0,1,1,0,1],0,1,0]);
modes.set('fifths_b', [[1,1,0,1,0,1],6,1,0]);

modes.set('just_c', [justs[0],5,0,1]);
modes.set('just_d', [justs[1],4,0,1]);
modes.set('just_e', [justs[2],3,0,1]);
modes.set('just_f', [justs[3],2,0,1]);
modes.set('just_g', [justs[4],1,0,1]);
modes.set('just_a', [justs[5],0,0,1]);
modes.set('just_b', [justs[6],6,0,1]);

modes.set('pythagorean', [[32/27,16/9,4/3,1.0,3/2,9/8,27/16],4,0,2]);

modes.set('pentatonic_c', [[1.0,27/24,30/24,36/24,40/24,48/24],4,0,2]);
modes.set('pentatonic_d', [[1.0,27/24,32/24,36/24,42/24,48/24],3,0,2]);
{'fraction_non_alphanumeric': 0.1950261780104712, 'fraction_numerical': 0.057188884414015304, 'mean_word_length': 5.752549286199864, 'pattern_counts': {'":': 0, '<': 184, '<?xml version=': 0, '>': 181, 'https://': 18, 'lorem ipsum': 0, 'www.': 5, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4578110', 'n_tokens_mistral': 4472, 'n_tokens_neox': 4098, 'n_words': 761}