[Haskell-cafe] Precise timing

Rohan Drape rohan.drape at gmail.com
Thu Oct 23 00:07:18 UTC 2014


> The following test [...]

perhaps note that each withTransport creates a new connection.
so you may want to group activities under one connection.
in which case IO actions can be "lifted" into the transport action.

also, hosc has pauseThread, a real-valued (in seconds) threadDelay.

also, that OSC message layout, with everything in the address, is a little odd?
more traditional would be either (Message "/sin0/frq" [float 100]) or as below?

best,
rohan

main = withMax $ mapM_ note (cycle [1,1,2])
withMax = withTransport (openUDP "127.0.0.1" 9000)
sin0 param val = sendMessage (Message "/sin0" [string param,float val])
pause = liftIO . pauseThread . (* 0.6)
note n = do
    sin0 "frq" 100
    sin0 "amp" 1
    pause n
    sin0 "amp" 0
    pause n



More information about the Haskell-Cafe mailing list