Skip to content

Instantly share code, notes, and snippets.

@kindohm
Created August 7, 2017 13:11
Show Gist options
  • Save kindohm/2608262aeb44ae0fb47d4bf1d52c27f8 to your computer and use it in GitHub Desktop.
Save kindohm/2608262aeb44ae0fb47d4bf1d52c27f8 to your computer and use it in GitHub Desktop.
let _stut' n t f p = unwrap $ (\a b -> stut' a b f p) <$> n <*> t
durPattern p = Pattern $ \a -> map eventLengthEvent $ arc p a
where eventLengthEvent (a1@(s1,e1), a2, x) = (a1, a2, e1-s1)
stutx n t f p = _stut' (liftA2 min n (fmap floor $ durPattern p / (t+0.001))) t f p
cps 2
d1 $ stutx "32 32" "0.1 0.1" (|*| gain "0.95") $ sound "k cp"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment