-- megalet for juliese.tidal
let every' n o f = when ((== (o-1)) . (`mod` n)) f
    d'drum = d1
    d'perc = d2
    d'bass = d3
    d'eg = d4
    d'gt = d5
    d'udu = d6
    d'pc = d7
    d'pcl = d8
    d'wbass = d9
    bassbass = s "[[vb vb:1] ~]/2"
               # end (slow 1.4 "0.2 0.4")
               # vowel "e o"
    bassbass' = bassbass # speed (slow 2.5 "1 -1")
    morek = every' 8 8 (overlay $ (0.32 ~>) $ s "k*2")
    drum1'f = overlay ((0.5 ~>) $ s "sn/2") $ every' 12 2 (density 3) $ morek $ s "k"
    hhb m = smash 16 [0.25, 0.5] $
            (if m then (every 3 (append $ s "hh:1 hh")) else id) $
            s "hh hh:2"
            # gain "0.6"
    ududu = slow 4 . chop 128 $
            s (samples "udu" (slow 4 $ irand 4))
            # gain "0.8"
            # cut "6"
    eg = gap 128 $ s "eg*2"
         # cut "4"
    gt = every 2 (within (0, 0.5) (0.07 <~)) $ (0.07 ~>) $
         chop 128 $
         s "[gt [~ gt] ! ~]/2"
         # cut "5"
    pcbeep = slow 16 $ gap 48 $ s "pc:1"
             # gain "0.7"
             # cut "7"
             # speed "[1 0.7]"
    ju'drum2 = stack [
               every' 8 7 (overlay $ (0.32 ~>) $ s "k") $ s "[k ~ k*2 ~]/4",
               every' 16 16 (overlay $ (0.82 ~>) $ s "sn") $ (1 ~>) $ s "sn/2"
               ]
