-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make tagged template argument handling less janky
Add workarounds to JavaScript's poor handling of backslashes inside tagged template literals.
- Loading branch information
Showing
7 changed files
with
155 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,9 +25,9 @@ You can read more about domains and echelons [below](#interval-type-system). | |
| Integer | `2`, `5` | Linear | Relative | Same as `2/1` or `5/1`. | | ||
| Decimal | `1,2`, `1.4e0` | Linear | Relative | Decimal commas only work in isolation. | | ||
| Fraction | `4/3`, `10/7` | Linear | Relative | | | ||
| N-of-EDO | `1\5`, `7\12` | Logarithmic | Relative | `n\m` means `n` steps of `m` equal divisions of the octave `2/1`. | | ||
| N-of-EDO | `1\5`, `7\12`, `7°12` | Logarithmic | Relative | `n\m` means `n` steps of `m` equal divisions of the octave `2/1`. | | ||
| N-of-EDJI | `9\13<3>`, `2\5<3/2>` | Logarithmic | Relative | `n\m<p/q>` means `n` steps of `m` equal divisions of the ratio `p/q`. | | ||
| Step | `7\`, `13\` | Logarithmic | Relative | Correspond to edo-steps after tempering is applied. | | ||
| Step | `7\`, `13\`, `13°` | Logarithmic | Relative | Correspond to edo-steps after tempering is applied. | | ||
| Cents | `701.955`, `100c` | Logarithmic | Relative | One centisemitone `1.0` is equal to `1\1200`. | | ||
| Monzo | `[-4 4 -1>`, `[1,-1/2>` | Logarithmic | Relative | Also known as prime count vectors. Each component is an exponent of a prime number factor. | | ||
| FJS | `P5`, `M3^5` | Logarithmic | Relative | [Functional Just System](https://en.xen.wiki/w/Functional_Just_System) | | ||
|
@@ -37,6 +37,8 @@ You can read more about domains and echelons [below](#interval-type-system). | |
| Val | `<12, 19, 28]` | Cologarithmic | Relative | Used to temper scales. | | ||
| Warts | `12@`, `[email protected]/5` | Cologarithmic | Relative | [Shorthand](https://en.xen.wiki/w/Val#Shorthand_notation) for vals. | | ||
|
||
The `n°m` (n degrees of m edo) alternative exists to avoid using the backslash inside tagged template literals. | ||
|
||
#### Numeric separators | ||
It is possible to separate numbers into groups using underscores for readability e.g. `1_000_000` is one million as an integer and `123_201/123_200` is the [chalmerisia](https://en.xen.wiki/w/Chalmersia) as a fraction. | ||
|
||
|
@@ -115,6 +117,8 @@ SonicWeave comes with some operators. | |
|
||
Down-shimmer sometimes requires curly brackets due to `v` colliding with the Latin alphabet. | ||
|
||
Drop `\` can be spelled `drop` to avoid using the backslash inside template literals. Lift `/` may be spelled `lift` for minor grammatical reasons. | ||
|
||
Increment/decrement assumes that you've declared `let i = 2` originally. | ||
### Coalescing | ||
| Name | Example | Result | | ||
|
@@ -186,6 +190,7 @@ Outer product a.k.a. tensoring expands all possible products in two arrays into | |
| Logarithm (in base of) | `9 /_ 3` | `2` | `M23 % P12` | `2` | | ||
| Round (to power of) | `5 by 2` | `4` | `M17^5 to P8` | `P15` | | ||
| N of EDO | `(5+2)\12` | `7\12` | _N/A_ | | | ||
| N of EDO | `(5+2)°12` | `7\12` | _N/A_ | | | ||
| NEDJI Projection | `sqrt(2) ed 3` | `1\2<3>` | `2\3 ed S3` | `2\3<9/8>` | | ||
| Val product | `12@ · 3/2` | `7` | `<12 19] dot P5` | `7` | | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.