From ba24a980fe0fa3aab3b80d84c43771791abec672 Mon Sep 17 00:00:00 2001 From: Miika Alonen Date: Sat, 2 Sep 2023 22:23:04 +0300 Subject: [PATCH 1/2] Document repeats --- src/documentation/ziffers.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/documentation/ziffers.ts b/src/documentation/ziffers.ts index 7210b28..fcddd53 100644 --- a/src/documentation/ziffers.ts +++ b/src/documentation/ziffers.ts @@ -26,6 +26,7 @@ The basic Ziffer notation is entirely written in JavaScript strings (_e.g_ " | **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. @@ -78,6 +79,17 @@ 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 +)} ## Algorithmic operations From abb916a77c3c85f1a82de44f6ee8af16ab5f97fd Mon Sep 17 00:00:00 2001 From: Miika Alonen Date: Sat, 2 Sep 2023 22:37:33 +0300 Subject: [PATCH 2/2] Document subdivisions --- package.json | 2 +- src/documentation/ziffers.ts | 12 +++++++++++- yarn.lock | 8 ++++---- 3 files changed, 16 insertions(+), 6 deletions(-) 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 fcddd53..83d3974 100644 --- a/src/documentation/ziffers.ts +++ b/src/documentation/ziffers.ts @@ -23,6 +23,7 @@ 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 | @@ -30,7 +31,6 @@ The basic Ziffer notation is entirely written in JavaScript strings (_e.g_ " **Note:** Some features are still unsupported. For full syntax see article about Ziffers. - ${makeExample( "Pitches from 0 to 9", ` @@ -91,6 +91,16 @@ z1('e 0:4 2:2 4:2 (0 4):2') 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 Ziffers provides shorthands for **many** numeric and algorithimic operations such as evaluating random numbers and creating sequences using list 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"