@hackage vivid-osc0.5.0.0

Open Sound Control encode/decode

Small, simple, and well-tested implementation of the Open Sound Control message format.

Example usage:

>>>>>>>>>>>>>>>

Sending it over UDP (e.g. to TidalCycles), using the network package:

{-# LANGUAGE OverloadedStrings #-}
import Network.Socket
import Network.Socket.ByteString as SB

import Vivid.OSC

main = do
   -- Boring Network.Socket setup:
   (a:_) <- getAddrInfo Nothing (Just "127.0.0.1") (Just "57120")
   s <- socket (addrFamily a) Datagram defaultProtocol
   connect s (addrAddress a)

   -- The interesting part:
   SB.send s $ encodeOSC $
      OSC "/play2" [OSC_S "cps", OSC_F 1.2, OSC_S "s", OSC_S "bd"]