10 ifReadyDo :: Handle -> IO a -> IO (Maybe a)
11 ifReadyDo hnd x = hReady hnd >>= f
12 where f True = x >>= return . Just
16 main = reactimate initInput sensing output arpeggiated
18 initInput = return (110, NoEvent)
20 sensing _ = do c <- stdin `ifReadyDo` getChar
22 then Event (NoteOn (toPitch 60) (toVelocity 100))
24 return (1, Just (110,c'))
26 output _ x = print x >> return False