diff --git a/package.json b/package.json index febbc56..d8a3703 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "tone": "^14.8.49", "unique-names-generator": "^4.7.1", "vite-plugin-markdown": "^2.1.0", - "zifferjs": "^0.0.18", + "zifferjs": "^0.0.19", "zzfx": "^1.2.0" } } diff --git a/src/documentation/ziffers.ts b/src/documentation/ziffers.ts index 7210b28..83d3974 100644 --- a/src/documentation/ziffers.ts +++ b/src/documentation/ziffers.ts @@ -23,13 +23,14 @@ The basic Ziffer notation is entirely written in JavaScript strings (_e.g_ " | **Pitches** | 0-9 {10 11 21} | Numbers or escaped numbers in curly brackets | | **Duration** | a b c to z | Each letter of the alphabet is a rhythm (see table) | | **Duration** | 0.25 = q, 0.5 = h | Floating point numbers can also be used as durations | +| **Subdivision** | [1 [2 3]] | Durations can be subdivided using square brackets | | **Octave** | ^ _ | ^ for octave up and _ for octave down | | **Accidentals** | # b | Sharp and flats, just like with regular music notation :smile: | | **Rest** | r | Rest / silences | +| **Repeat** | :1-9 | Repeat the item 1-9 times | **Note:** Some features are still unsupported. For full syntax see article about Ziffers. - ${makeExample( "Pitches from 0 to 9", ` @@ -78,6 +79,27 @@ z1('e 0 s 1 b2 3 e 0 s 1 b2 4') false )} +${makeExample( + "Repeat items n-times", + ` +z1('e 0:4 2:2 4:2 (0 4):2') + .scale('major').sound('sine') + .fmi(usine(.5)).fmh(2) + .delay(0.5).delayt(1.25) + .sustain(0.1).out() +`, + false +)} + +${makeExample( + "Subdivided durations", + ` +z1('w [0 [5 [3 7]]] h [0 4]') + .scale('major').sound('sine') + .fmi(usine(.5)).fmh(2).out() +`, + false +)} ## Algorithmic operations diff --git a/yarn.lock b/yarn.lock index 6fa3a8e..a0c2402 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1451,10 +1451,10 @@ yaml@^2.1.1: resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.1.tgz#02fe0975d23cd441242aa7204e09fc28ac2ac33b" integrity sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ== -zifferjs@^0.0.18: - version "0.0.18" - resolved "https://registry.yarnpkg.com/zifferjs/-/zifferjs-0.0.18.tgz#e8a5cb5cfef77c098899a12450380b04f0100841" - integrity sha512-qixh6tb6wpMx/iFM1uGeDQVi6oaURPwP553Gc75pgZLIvapoXnnJIn23f8fAEgxwTdI+EkqLEZZLa57sDxj0PA== +zifferjs@^0.0.19: + version "0.0.19" + resolved "https://registry.yarnpkg.com/zifferjs/-/zifferjs-0.0.19.tgz#a3e1fc04b12cef1f59a78f3d23229b072d9f0a60" + integrity sha512-mdrfac/ryDF1MEC1iMCV9KTj36AXNVsiDoYiDEA5ZCYFuHqfzS5s2aCh2iK6teyRKTIagE2IvZCrsTacB5GBBg== zzfx@^1.2.0: version "1.2.0"