deploy: f364018223
This commit is contained in:
@ -126,7 +126,6 @@ Topos is deeply inspired by the [Monome Teletype](https://monome.org/). The Tele
|
||||
Press ${_t("Ctrl + G")} to switch to the global file. This is where everything starts! Evaluate the following script there by pasting and pressing ${_t("Ctrl + Enter")}. You are now making music:
|
||||
|
||||
${t("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)
|
||||
@ -208,11 +207,13 @@ Let's study two very simple rhythmic functions, <icode>mod(n: ...number[])</icod
|
||||
|
||||
- <icode>mod(...n: number[])</icode>: this function will return true every _n_ pulsations. The value <icode>1</icode> will return <icode>true</icode> at the beginning of each beat. Floating point numbers like <icode>0.5</icode> or <icode>0.25</icode> are also accepted. Multiple values can be passed to <icode>mod</icode> to generate more complex rhythms.
|
||||
|
||||
${t("Using different mod values",`// This code is alternating between different mod values
|
||||
mod([1,1/2,1/4,1/8,1/16].div(4)) :: sound('kick').out()
|
||||
${t("Using different mod values",`
|
||||
// This code is alternating between different mod values
|
||||
mod([1,1/2,1/4,1/8].div(2)) :: sound('bd').n(0).out()
|
||||
`,!0)}
|
||||
|
||||
${t("Some sort of ringtone",`let blip = (freq) => {return sound('sine').sustain(0.1).freq(freq)};
|
||||
${t("Some sort of ringtone",`
|
||||
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();
|
||||
@ -221,12 +222,14 @@ mod([1,0.75].div(2)) :: blip([50, 100].div(2)).out();
|
||||
|
||||
- <icode>onbeat(...n: number[])</icode>: By default, the bar is set in <icode>4/4</icode> with four beats per bar. The <icode>onbeat</icode> function allows you to lock on to a specific beat to execute some code. It can accept multiple arguments. It's usage is very straightforward and not hard to understand. You can pass integers or floating point numbers.
|
||||
|
||||
${t("Some simple yet detailed rhythms",`onbeat(1,2,3,4)::snd('kick').out() // Bassdrum on each beat
|
||||
${t("Some simple yet detailed rhythms",`
|
||||
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
|
||||
`,!0)}
|
||||
|
||||
${t("Let's do something more complex",`onbeat(0.5, 1.5, 2, 3, 3.75)::snd('kick').n(2).out()
|
||||
${t("Let's do something more complex",`
|
||||
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))
|
||||
@ -246,14 +249,16 @@ mod(.5) && euclid($(2), 2, 8) && snd('sd').out()
|
||||
`,!0)}
|
||||
|
||||
${t("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()
|
||||
`,!1)}
|
||||
|
||||
${t("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()
|
||||
`,!1)}
|
||||
|
||||
@ -266,11 +271,13 @@ mod(.5) && bin($(1), 34) && snd('kick').out()
|
||||
mod(.5) && bin($(2), 48) && snd('sd').out()
|
||||
`,!0)}
|
||||
|
||||
${t("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()
|
||||
${t("Calling 911",`
|
||||
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()
|
||||
`,!1)}
|
||||
|
||||
${t("Playing around with simple numbers",`mod(.5) && bin($(1), [123, 456, 789].div(4))
|
||||
${t("Playing around with simple numbers",`
|
||||
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()
|
||||
`,!1)}
|
||||
Reference in New Issue
Block a user