diff --git a/src/Documentation.ts b/src/Documentation.ts index 39c90dd..2097e90 100644 --- a/src/Documentation.ts +++ b/src/Documentation.ts @@ -147,7 +147,6 @@ Press ${key_shortcut( ${makeExample( "Obscure shenanigans", ` - mod([1/4,1/8,1/16].div(8)):: sound('sine') .freq([100,50].div(16) + 50 * ($(1)%10)) .gain(0.5).room(0.9).size(0.9) @@ -265,15 +264,17 @@ Let's study two very simple rhythmic functions, mod(n: ...number[]) {return sound('sine').sustain(0.1).freq(freq)}; + ` +let blip = (freq) => {return sound('sine').sustain(0.1).freq(freq)}; mod(1) :: blip(200).out(); mod(1/3) :: blip(400).out(); div(3) :: mod(1/6) :: blip(800).out(); @@ -286,7 +287,8 @@ mod([1,0.75].div(2)) :: blip([50, 100].div(2)).out(); ${makeExample( "Some simple yet detailed rhythms", - `onbeat(1,2,3,4)::snd('kick').out() // Bassdrum on each beat + ` +onbeat(1,2,3,4)::snd('kick').out() // Bassdrum on each beat onbeat(2,4)::snd('snare').out() // Snare on acccentuated beats onbeat(1.5,2.5,3.5, 3.75)::snd('hat').out() // Cool high-hats `, @@ -295,7 +297,8 @@ onbeat(1.5,2.5,3.5, 3.75)::snd('hat').out() // Cool high-hats ${makeExample( "Let's do something more complex", - `onbeat(0.5, 1.5, 2, 3, 3.75)::snd('kick').n(2).out() + ` +onbeat(0.5, 1.5, 2, 3, 3.75)::snd('kick').n(2).out() onbeat(2, [1.5, 3].pick(), 4)::snd('snare').n(7).out() mod([.25, 1/8].div(1.5))::snd('hat').n(2) .gain(rand(0.4, 0.7)) @@ -323,8 +326,10 @@ mod(.5) && euclid($(2), 2, 8) && snd('sd').out() ${makeExample( "And now for more interesting rhythmic constructions", ` -mod(.5) && euclid($(1), 5, 9) && snd('kick').out() -mod(.5) && euclid($(2), 2, 3, 1) && snd('pluck').end(0.5).n(5).out() +bpm(145); // Setting a faster BPM +mod(.5) && euclid($(1), 5, 8) :: sound('bd').out() +mod(.5) && euclid($(2), [1,0].div(8), 8) :: sound('sd').out() +mod(.5) && euclid($(6), [6,7].div(8), 8) :: sound('hh').out() `, false )} @@ -333,8 +338,8 @@ ${makeExample( "Adding more rhythmic density", ` mod(.5) && euclid($(1), 5, 9) && snd('kick').out() -mod(.5) && euclid($(2), 2, 3, 1) && snd('pluck').end(0.5).n(5).out() -mod(.5) && euclid($(3), 6, 9, 1) && snd('pluck').end(0.5).n(5).freq(200).out() +mod(.5) && euclid($(2), 2, 3, 1) && snd('east').end(0.5).n(5).out() +mod(.5) && euclid($(3), 6, 9, 1) && snd('east').end(0.5).n(5).freq(200).out() mod(.25) && euclid($(4), 7, 9, 1) && snd('hh').out() `, false @@ -355,15 +360,17 @@ mod(.5) && bin($(2), 48) && snd('sd').out() ${makeExample( "Calling 911", - `mod(.5) && bin($(1), 911) && snd('pluck').n(4).delay(0.5).delayt(0.25).out() -mod(1) && sound('kick').shape(0.5).out() + ` +mod(.5) && bin($(1), 911) && snd('subroc3d').n($(2)).delay(0.5).delayt(0.25).end(0.5).out() +mod(.5) && sound('less').n(irand(1, 10)).out() `, false )} ${makeExample( "Playing around with simple numbers", - `mod(.5) && bin($(1), [123, 456, 789].div(4)) + ` +mod(.5) && bin($(1), [123, 456, 789].div(4)) && snd('tabla').n($(2)).delay(0.5).delayt(0.25).out() mod(1) && sound('kick').shape(0.5).out() `, diff --git a/src/examples/excerpts.ts b/src/examples/excerpts.ts new file mode 100644 index 0000000..cd6d854 --- /dev/null +++ b/src/examples/excerpts.ts @@ -0,0 +1,35 @@ +export const examples = [ +` +bpm(110) +mod(0.125) && sound('sawtooth') + .note([60, 62, 63, 67, 70].div(.125) + + [-12,0,12].beat() + [0, 0, 5, 7].bar()) + .sustain(0.1).fmi(0.25).fmh(2).room(0.9) + .gain(0.75).cutoff(500 + usine(8) * [500, 1000, 2000].bar()) + .delay(0.5).delayt(0.25).delayfb(0.25) + .out(); +mod(1) && snd('kick').out(); +mod(2) && snd('snare').out(); +mod(.5) && snd('hat').out(); +`, ` +mod([1/4,1/8,1/16].div(8)):: sound('sine') + .freq([100,50].div(16) + 50 * ($(1)%10)) + .gain(0.5).room(0.9).size(0.9) + .sustain(0.1).out() +mod(1) :: sound('kick').out() +mod(2) :: sound('dr').n(5).out() +div(3) :: mod([.25,.5].div(.5)) :: sound('dr') + .n([8,9].pick()).gain([.8,.5,.25,.1,.0].div(.25)).out() +`, ` +mod(.25)::snd('arpy') + .note(30 + [0,3,7,10].beat()) + .cutoff(usine(.5) * 5000).resonance(10).gain(0.3) + .end(0.8).room(0.9).size(0.9).n(0).out(); +mod([.25,.125].div(2))::snd('arpy') + .note(30 + [0,3,7,10].beat()) + .cutoff(usine(.5) * 5000).resonance(20).gain(0.3) + .end(0.8).room(0.9).size(0.9).n(3).out(); +mod(.5) :: snd('arpy').note( + [30, 33, 35].repeatAll(4).div(1) - [12,0].div(0.5)).out() +` +]