Open Sound Control encode/decode

Version on this page:
LTS Haskell 22.30:
Stackage Nightly 2024-07-23:
Latest on Hackage:

See all snapshots vivid-osc appears in

LicenseRef-GPL licensed and maintained by Tom Murphy
This version can be pinned in stack with:vivid-osc-,2841

Module documentation for

Used by 2 packages in lts-12.14(full list with versions):

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

Example usage:

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

import Vivid.OSC

main = do
   -- Boring Network.Socket setup:
   (a:_) <- getAddrInfo Nothing (Just "") (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_I 1, OSC_S "s", OSC_S "bd"]