diff --git a/src/documentation/ziffers.ts b/src/documentation/ziffers.ts index b031731..4fb01cd 100644 --- a/src/documentation/ziffers.ts +++ b/src/documentation/ziffers.ts @@ -35,13 +35,13 @@ The basic Ziffer notation is entirely written in JavaScript strings (_e.g_ " | Syntax | Symbol | Description | |------------ |--------|------------------------| | **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 | +| **Duration** | 0.25, 0.5 | Floating point numbers can also be used as durations | +| **Duration** | 1/4, 1/16 | Fractions can 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 | +| **Repeat** | !1-9 | Repeat the item 1 to 9 times | | **Chords** | [1-9]+ / [iv]+ / [AG]+name | Multiple pitches grouped together, roman numerals or named chords | | **Samples** | [a-z0-9_]+ | Samples can be used pitched or unpitched | | **Index/Channel** | [a-z0-9]+:[0-9]* | Samples or midi channel can be changed using a colon | @@ -50,26 +50,25 @@ The basic Ziffer notation is entirely written in JavaScript strings (_e.g_ " ${makeExample( "Pitches from 0 to 9", - ` -z1('s 0 1 2 3 4 5 6 7 8 9').sound('pluck').release(0.1).sustain(0.25).out() -`, + `z1('s 0 1 2 3 4 5 6 7 8 9').sound('wt_stereo').adsr(0, .1, 0, 0).out()`, true )} ${makeExample( "Escaped pitches using curly brackets", - ` -let pattern = flip(4) ? z1('s _ _ 0 0 {9 11}') : z1('s _ 0 0 {10 12}'); -pattern.sound('pluck').sustain(0.1).room(0.9).out(); -`, + `z1('_ _ 0 {9 10 11} 4 {12 13 14}') + .sound('wt_05').pan(r(0,1)) + .cutoff(usaw(1/2) * 4000) + .room(0.9).size(0.9).out()`, false )} ${makeExample( - "Durations using letters and floating point numbers", + "Durations using fractions and floating point numbers", ` -flip(8) ? z1('s 0 e 1 q 2 h 3 w 4').sound('sine').scale("locrian").out() - : z1('0.125 0 0.25 2').sound('sine').scale("locrian").out() +z1('1/8 0 2 4 0 2 4 1/4 0 3 5 0.25 _ 0 7 0 7') + .sound('square').delay(0.5).delayt(1/8) + .adsr(0, .1, 0, 0).delayfb(0.45).out() `, false )} @@ -87,11 +86,11 @@ beat(3) :: snd('cp').room(0.5).size(0.5).orbit(2).out() ${makeExample( "Accidentals and rests for nice melodies", ` -z1('e 0 s 1 b2 3 e 0 s 1 b2 4') - .scale('major').sound('sine') - .fmi(usine(.5)).fmh(2) - .delay(0.5).delayt(1.25) - .sustain(0.1).out() +z1('^ 1/8 0 1 b2 3 4 _ 4 b5 4 3 b2 1 0') + .scale('major').sound('triangle') + .cutoff(500).lpadsr(5, 0, 1/12, 0, 0) + .fmi(0.5).fmh(2).delay(0.5).delayt(1/3) + .adsr(0, .1, 0, 0).out() `, false )} @@ -99,11 +98,12 @@ z1('e 0 s 1 b2 3 e 0 s 1 b2 4') ${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() +z1('1/8 _ _ 0!4 3!4 4!4 3!4') + .scale('major').sound('wt_oboe') + .shape(0.2).sustain(0.1).out() +z2('1/8 _ 0!4 5!4 4!2 7!2') + .scale('major').sound('wt_oboe') + .shape(0.2).sustain(0.1).out() `, false )} diff --git a/src/examples/excerpts.ts b/src/examples/excerpts.ts index 731afa1..9165b63 100644 --- a/src/examples/excerpts.ts +++ b/src/examples/excerpts.ts @@ -194,8 +194,7 @@ beat([.25,.125, .5].beat(4))::snd('arpy:4') .cutoff(100 + usine(1/8) * 800).lpadsr(5, 0, [1/8, 1.16].beat(), 0, 0) .resonance(5).gain(0.4).end(0.8).room(0.9).size(0.9).n(3).out(); beat(.5) :: snd('arpy').note([30, 33, 35].repeatAll(4).beat(1) - [24,12].beat(0.5)) - .cutoff(500).lpadsr(8, 0.05, .125, 0, 0).out()`, ` -// Naïf et agréable -- Bubobubobubo + .cutoff(500).lpadsr(8, 0.05, .125, 0, 0).out()`, `// Naïf et agréable -- Bubobubobubo z1('1/8 024!3 035 024 0124').sound('wt_stereo') .adsr(0, .4, 0.5, .4).gain(0.1) .lpadsr(4, 0, .2, 0, 0)