From daf22757997a0a9db7334f4400905f45b49c4dfa Mon Sep 17 00:00:00 2001 From: Lumi Pakkanen Date: Mon, 29 Apr 2024 18:46:02 +0300 Subject: [PATCH] Golf presets and generated code a bit --- src/components/modals/generation/HistoricalScale.vue | 4 ++-- src/components/modals/generation/RankTwo.vue | 2 +- src/presets.json | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/modals/generation/HistoricalScale.vue b/src/components/modals/generation/HistoricalScale.vue index 4619cb00..7e3b6c7e 100644 --- a/src/components/modals/generation/HistoricalScale.vue +++ b/src/components/modals/generation/HistoricalScale.vue @@ -153,14 +153,14 @@ function generate(expand = true) { ) { emit('update:baseFrequency', FREQUENCY_C) emit('update:baseMidiNote', MIDI_NOTE_C) - source += `\nlabel([${KEY_COLORS_C.join(', ')}])` + source += `\n[${KEY_COLORS_C.join(', ')}]` const labels: string[] = [] for (let i = 0; i < historical.size; ++i) { labels[mmod(7 * (i - historical.down) - 1, historical.size)] = JSON.stringify( spineLabel(i - historical.down) ) } - source += `\nlabel([${labels.join(', ')}])` + source += `\n[${labels.join(', ')}]` } if (expand) { source = expandCode(source) diff --git a/src/components/modals/generation/RankTwo.vue b/src/components/modals/generation/RankTwo.vue index d6c72f79..16a5aeb6 100644 --- a/src/components/modals/generation/RankTwo.vue +++ b/src/components/modals/generation/RankTwo.vue @@ -148,7 +148,7 @@ function generate(expand = true) { } else { up = size - n - rank2.down } - labelString = `\nlabel([${colors.join(', ')}])` + labelString = `\n[${colors.join(', ')}]` } const source = `rank2(${rank2.generator.toString()}, ${up}, ${down}, ${rank2.period.toString()}, ${n})${labelString}` emit('update:scaleName', `Rank 2 temperament (${rank2.generatorString}, ${rank2.periodString})`) diff --git a/src/presets.json b/src/presets.json index eb762bf6..3c814c84 100644 --- a/src/presets.json +++ b/src/presets.json @@ -18,7 +18,7 @@ }, "ragabhairavi": { "name": "Raga Bhairavi", - "source": "eulerGenus(135, 5)\n$[5] = 16/15\nsort()\nlabel([black, white, black, black, white, black, black, white])\n", + "source": "eulerGenus(135, 5)\n$[5] = 16/15\nsort()\n[black, white, black, black, white, black, black, white]\n", "categories": ["traditional", "just intonation"] }, "ragakafi": { @@ -134,7 +134,7 @@ }, "pythagorean": { "name": "Pythagorean", - "source": "[3^i rdc 2 white for i of [-2..4]] ['F', 'C', 'G', 'D', 'A', 'E', 'B']\n[3^i rdc 2 black for i of [-7..-3]] ['G♭', 'D♭', 'A♭', 'E♭', 'B♭']\nsort()\n", + "source": "(3^[-2..4] rdc 2) white ['F', 'C', 'G', 'D', 'A', 'E', 'B']\n(3^[-7..-3] rdc 2) black ['G♭', 'D♭', 'A♭', 'E♭', 'B♭']\nsort()\n", "categories": ["traditional", "just intonation"], "baseMidiNote": 67, "baseFrequency": 391 @@ -238,7 +238,7 @@ }, "22orwell9": { "name": "22edo orwell[9]", - "source": "rank2(7/6, 4, 4)\nlabel([black, white, black, white, white, black, white, black, white])\n22@\n", + "source": "rank2(7/6, 4, 4)\n[black, white, black, white, white, black, white, black, white]\n22@\n", "categories": ["MOS", "equal temperament"] }, "22pajara12": {