Skip to content

Instantly share code, notes, and snippets.

@mikesol
Last active October 25, 2021 13:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikesol/8c36674568c1d9b86c61a9cb19c7fd43 to your computer and use it in GitHub Desktop.
Save mikesol/8c36674568c1d9b86c61a9cb19c7fd43 to your computer and use it in GitHub Desktop.
Tablas and lighters
module Main where
import Prelude
import Effect (Effect)
import WAGS.Lib.Learn (play)
import WAGS.Lib.Tidal (AFuture, tdl)
import Data.Lens (_Just, set, traversed)
import Data.Profunctor (lcmap)
import WAGS.Math (calcSlope)
import WAGS.Lib.Tidal.Samples (class SampleTime, sampleTime)
import WAGS.Lib.Tidal.Tidal (betwixt, lnv, make, onTag, parse_, s)
m2 = 4.0 * 1.0 * 60.0/111.0 :: Number
fadeDown ::forall r. SampleTime r => r -> Number
fadeDown = lcmap sampleTime (betwixt 0.0 1.0 <<< calcSlope 0.4 1.0 1.2 0.0)
wag :: AFuture
wag =
make (m2 * 4.0)
{ -- lows
earth: s $ set (traversed <<< _Just <<< lnv) fadeDown $ parse_ "tabla:23 tabla2:21 tabla2:28 tabla2:41"
, wind: s """~ [tabla:3 tabla2:37] ~ tabla2:11
~ tabla:3 ~ tabla2:40
~ tabla:3 ~ ~
~ tabla:3 ~ tabla2:31"""
, fire: s $
onTag "str" (set (_Just <<< lnv) (lcmap sampleTime \t -> betwixt 0.0 1.0 $ 1.0 - t*0.2))
$ parse_ """~ [chin*4 lighter] ~ ~
~ [lighter:4 lighter:3 ] ~ [~ lighter:6]
~ ~ ~ [~ lighter:13]
~ ~ ~ [~ lighter:12] ,
~ sitar:3;str ~ ~
~ ~ ~ ~
sitar:4;str ~ ~
~ ~ ~ ~ , ~ tink ~ ~ ~ tink ~ ~ ~ tink ~ ~ ~ tink ~ ~
"""
, title: "tablas and lighters"
}
main :: Effect Unit
main = play $ tdl $ wag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment