Adding naïve demo song

This commit is contained in:
2023-09-26 22:34:21 +02:00
parent 11bbe66f33
commit fd1051b799
2 changed files with 188 additions and 159 deletions

View File

@ -12,7 +12,21 @@ Ziffers is a **musical number based notation** tuned for _live coding_. It is a
- exploring **generative / aleatoric / stochastic** melodies and applying them to sounds and synths.
- embracing a different mindset and approach to time and **patterning**.
${makeExample("Super Fancy Ziffers example", ``, true)}
${makeExample("Super Fancy Ziffers example", `
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)
.cutoff(5000 + usine(1/2) * 2000)
.n([1,2,4].beat(4)).out()
z2('<1/8 1/16> __ 0 <(^) (^ ^)> (0,8)').sound('wt_stereo')
.adsr(0, .5, 0.5, .4).gain(0.2)
.lpadsr(4, 0, .2, 0, 0).n(14)
.cutoff(200 + usine(1/2) * 4000)
.n([1,2,4].beat(4)).o(2).room(0.9).out()
let osci = 1500 + usine(1/2) * 2000;
z3('can can:2').sound().gain(1).cutoff(osci).out()
z4('1/4 kick kick snare kick').sound().gain(1).cutoff(osci).out()
`, true)}
## Notation
@ -40,7 +54,7 @@ ${makeExample(
z1('s 0 1 2 3 4 5 6 7 8 9').sound('pluck').release(0.1).sustain(0.25).out()
`,
true
)}
)}
${makeExample(
"Escaped pitches using curly brackets",
@ -49,7 +63,7 @@ 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();
`,
false
)}
)}
${makeExample(
"Durations using letters and floating point numbers",
@ -58,7 +72,7 @@ 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()
`,
false
)}
)}
${makeExample(
"Disco was invented thanks to Ziffers",
@ -68,7 +82,7 @@ beat(1)::snd('bd').out(); beat(2)::snd('sd').out()
beat(3) :: snd('cp').room(0.5).size(0.5).orbit(2).out()
`,
false
)}
)}
${makeExample(
"Accidentals and rests for nice melodies",
@ -80,7 +94,7 @@ z1('e 0 s 1 b2 3 e 0 s 1 b2 4')
.sustain(0.1).out()
`,
false
)}
)}
${makeExample(
"Repeat items n-times",
@ -92,7 +106,7 @@ z1('e 0:4 2:2 4:2 (0 4):2')
.sustain(0.1).out()
`,
false
)}
)}
${makeExample(
"Subdivided durations",
@ -102,7 +116,7 @@ z1('w [0 [5 [3 7]]] h [0 4]')
.fmi(usine(.5)).fmh(2).out()
`,
false
)}
)}
## Chords
@ -113,14 +127,14 @@ ${makeExample(
`
z1('q 024 468').sound('sine').scale("minor").out()
`
)}
)}
${makeExample(
"Chords from roman numerals",
`
z1('i i v vii vi iv iv v').sound("pad").out();
`
)}
)}
${makeExample(
"Named chords with repeats",
@ -128,7 +142,7 @@ ${makeExample(
z1('e C9:4 Emin:4 F7:4 Emaj:4')
.sound("stab").sustain(2.0).out()
`
)}
)}
${makeExample(
"Transposing chords",
@ -137,14 +151,14 @@ ${makeExample(
.key(["F3","E3","D3","E3"].beat(3))
.sound('sawtooth').out()
`
)}
)}
${makeExample(
"Chord transposition with roman numerals",
`
z1('i i v%-4 v%-2 vi%-5 vi%-3 iv%-2 iv%-1').sound('sawtooth').out()
`
)}
)}
${makeExample(
"Chord transposition with named chords",
@ -152,7 +166,7 @@ ${makeExample(
z1('e C9:4 Emin:4 F7%-1:4 Emaj%-1:4')
.sound("stab").out()
`
)}
)}
${makeExample(
"Programmatic inversions",
@ -160,7 +174,7 @@ ${makeExample(
z1('i v vi iv').invert([1,-1,-2,0].beat(4))
.sound("sawtooth").out()
`
)}
)}
## Algorithmic operations
@ -176,7 +190,7 @@ z1("q 0 s (3 2 1)+(2 5) q 0 s (4 5 6)-(2 3)").sound('sine')
.delay(0.5).delay(0.125).delayfb(0.25).out();
`,
true
)}
)}
* **Random numbers:** <ic>(4,6)</ic> Random number between 4 and 6
@ -190,7 +204,7 @@ z1("s (0,8) 0 0 (0,5) 0 0").sound('sine')
beat(.5) :: snd(['kick', 'hat'].beat(.5)).out()
`,
true
)}
)}
## Keys and scales
@ -220,7 +234,7 @@ z1("s (0,8) 0 0 (0,5) 0 0").sound('sine')
beat(.5) :: snd(['kick', 'hat'].beat(.5)).out()
`,
true
)}
)}
@ -253,7 +267,7 @@ z1("s (0,8) 0 0 (0,5) 0 0").sound('sine')
beat(1, 1.75) :: snd(['kick', 'hat'].beat(1)).out()
`,
true
)}
)}
Microtonal scales can be defined using <a href="https://www.huygens-fokker.org/scala/scl_format.html" target="_blank">Scala format</a> or by extended notation defined by Sevish <a href="https://sevish.com/scaleworkshop/" target="_blank">Scale workshop</a>, for example:
@ -271,7 +285,7 @@ z1("s ^ (0,8) 0 0 _ (0,5) 0 0").sound('sine')
beat(1, 1.75) :: snd(['kick', 'hat'].beat(1)).out()
`,
true
)}
)}
## Synchronization
@ -286,7 +300,7 @@ z0('w 0 8').sound('peri').out()
z1('e 0 4 5 9').sound('bell').out()
`,
true
)}
)}
${makeExample(
"Sync with wait",
@ -295,7 +309,7 @@ z1('w 0 5').sound('pluck').release(0.1).sustain(0.25).out()
z2('q 6 3').wait(z1).sound('sine').release(0.16).sustain(0.55).out()
`,
true
)}
)}
${makeExample(
"Sync on first run",
@ -304,7 +318,7 @@ ${makeExample(
z2('q __ 4 2 e 6 3 q 6').sync(z1).sound('east').out()
`,
true
)}
)}
## Examples
@ -317,7 +331,7 @@ z1('0 1 2 3').key('G3')
.scale('minor').sound('sine').out()
`,
true
)}
)}
${makeExample(
"More complex chaining",
@ -325,7 +339,7 @@ ${makeExample(
z1('0 1 2 3 4').key('G3').scale('minor').sound('sine').often(n => n.pitch+=3).rarely(s => s.delay(0.5)).out()
`,
true
)}
)}
${makeExample(
"Simple options",
@ -333,7 +347,7 @@ ${makeExample(
z1('0 3 2 4',{key: 'D3', scale: 'minor pentatonic'}).sound('sine').out()
`,
true
)}
)}
${makeExample(
"Duration chars",
@ -341,7 +355,7 @@ ${makeExample(
z1('q 0 0 4 4 5 5 h4 q 3 3 2 2 1 1 h0').sound('sine').out()
`,
true
)}
)}
${makeExample(
"Fraction durations",
@ -349,7 +363,7 @@ ${makeExample(
z1('1/4 0 0 4 4 5 5 2/4 4 1/4 3 3 2 2 1 1 2/4 0').sound('sine').out()
`,
true
)}
)}
${makeExample(
"Decimal durations",
@ -357,7 +371,7 @@ ${makeExample(
z1('0.25 5 1 2 6 0.125 3 8 0.5 4 1.0 0').sound('sine').scale("ionian").out()
`,
true
)}
)}
${makeExample(
"Rest and octaves",
@ -365,7 +379,7 @@ ${makeExample(
z1('q 0 ^ e0 r _ 0 _ r 4 ^4 4').sound('sine').scale("ionian").out()
`,
true
)}
)}
- Scales
@ -378,7 +392,7 @@ z1('q 0 3 {10 14} e 8 4 {5 10 12 14 7 0}').sound('sine')
.out()
`,
true
)}
)}
${makeExample(
"Scala scale from variable",
@ -396,7 +410,7 @@ ${makeExample(
onbeat(1,1.5,3) :: sound('bd').cutoff(100 + usine(.25) * 1000).out()
`,
true
)}
)}
- Algorithmic operations
@ -408,7 +422,7 @@ z1('q 0 (2,4) 4 (5,9)').sound('sine')
.out()
`,
true
)}
)}
${makeExample(
"List operations",
@ -418,7 +432,7 @@ z1('q (0 3 1 5)+(2 5) e (0 5 2)*(2 3) (0 5 2)>>(2 3) (0 5 2)%(2 3)').sound('sine
.out()
`,
true
)}
)}
## Samples
@ -430,7 +444,7 @@ ${makeExample(
z1('bd [hh hh]').octave(-2).sound('sine').out()
`,
true
)}
)}
${makeExample(
"More complex pattern",
@ -438,7 +452,7 @@ ${makeExample(
z1('bd [hh <hh <cp cp:2>>]').octave(-2).sound('sine').out()
`,
true
)}
)}
${makeExample(
"Pitched samples",
@ -448,7 +462,7 @@ ${makeExample(
.adsr(0.25,0.125,0.125,0.25).out()
`,
true
)}
)}
${makeExample(
"Pitched samples from list operation",
@ -459,7 +473,7 @@ ${makeExample(
.sound().out()
`,
true
)}
)}
${makeExample(
"Pitched samples with list notation",
@ -469,7 +483,7 @@ ${makeExample(
.adsr(0.25,0.125,0.125,0.25).out()
`,
true
)}
)}
${makeExample(
"Sample indices",
@ -478,7 +492,7 @@ ${makeExample(
.octave(-1).sound("east").out()
`,
true
)}
)}
${makeExample(
"Pitched samples with sample indices",
@ -486,7 +500,7 @@ ${makeExample(
z1('_e 1@east:2 4@bd:3 6@arp:2 9@baa').sound().out()
`,
true
)}
)}
@ -502,7 +516,7 @@ ${makeExample(
"q 2 7 8 6".z2({key: "C2", scale: "aeolian"}).sound('sine').scale("minor").out()
`,
true
)}
)}
`;
};

View File

@ -194,7 +194,22 @@ 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()`,
.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)
.cutoff(5000 + usine(1/2) * 2000)
.n([1,2,4].beat(4)).out()
z2('<1/8 1/16> __ 0 <(^) (^ ^)> (0,8)').sound('wt_stereo')
.adsr(0, .5, 0.5, .4).gain(0.2)
.lpadsr(4, 0, .2, 0, 0).n(14)
.cutoff(200 + usine(1/2) * 4000)
.n([1,2,4].beat(4)).o(2).room(0.9).out()
let osci = 2000 + usine(1/2) * 2000;
z3('can can:2').sound().gain(1).cutoff(osci).out()
z4('1/4 kick kick snare kick').sound().gain(1).cutoff(osci).out()`,
/*
`// Numerology - Bubobubobubo
bpm(130);