1 {-# LANGUAGE Arrows #-}
3 module Arpeggiated where
10 arpeggiated :: SF (ControllerValue, Event Note) (Event Note)
11 arpeggiated = proc (c,n) -> do
12 non <- uncurry gate ^<< identity &&& arr (event False isOn) -< n
13 non' <- fmap majorThird ^<< delayEvent t -< non
14 non'' <- fmap perfectFifth ^<< delayEvent t -< non'
16 nof'') <- makeOff *** makeOff -< (non',non'')
17 -- It's assumed that the NoteOff event corresponding to n will be
19 returnA -< mergeEvents [n, non, non', nof', non'', nof'']
20 where onoffGap = 0.9*t
22 makeOff = delayEvent onoffGap <<^ fmap switchOnOff