vivid-osc 0.4.0.0 → 0.5.0.0
raw patch · 3 files changed
+37/−81 lines, 3 filesdep −binaryPVP ok
version bump matches the API change (PVP)
Dependencies removed: binary
API changes (from Hackage documentation)
- Vivid.OSC: toTypeChar :: OSCDatum -> ByteString
Files
- README.md +0/−56
- Vivid/OSC.hs +14/−9
- vivid-osc.cabal +23/−16
− README.md
@@ -1,56 +0,0 @@-# vivid-osc--Example usage:--## Sending it over UDP--E.g. to TidalCycles, using the 'network' package:--```haskell-{-# 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"]-```--## Receiving via UDP:--```haskell-{-# LANGUAGE OverloadedStrings #-}---import Control.Monad (forever)-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- bind s (addrAddress a)-- forever $ do- o <- decodeOSC <$> SB.recv s 4096- case o of- Right (OSC "/play2" [_, OSC_F vel, _, OSC_S "bd"]) ->- putStrLn $ if vel < 1- then "boom"- else "BOOM!"- _ -> putStrLn $ "Unexpected input: "++show o-```-
Vivid/OSC.hs view
@@ -2,15 +2,17 @@ {-# OPTIONS_HADDOCK show-extensions #-} -{-# LANGUAGE LambdaCase #-}-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE ViewPatterns #-}-{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE+ LambdaCase+ , OverloadedStrings+ , ViewPatterns+ , ScopedTypeVariables -{-# LANGUAGE NoRebindableSyntax #-}-{-# LANGUAGE NoIncoherentInstances #-}-{-# LANGUAGE NoMonomorphismRestriction #-}-{-# LANGUAGE NoUndecidableInstances #-}+ , NoRebindableSyntax+ , NoIncoherentInstances+ , NoMonomorphismRestriction+ , NoUndecidableInstances+ #-} module Vivid.OSC ( OSC(..)@@ -56,9 +58,12 @@ , runGetWithNoLeftover -- Only need for testing old<->new- , toTypeChar , alignTo4' ) where++-- For GHC 7.8 and older+-- (Eventually remove):+import Control.Applicative -- import Control.DeepSeq (NFData, rnf) import Control.Monad
vivid-osc.cabal view
@@ -1,5 +1,5 @@ name: vivid-osc-version: 0.4.0.0+version: 0.5.0.0 synopsis: Open Sound Control encode/decode description: Small, simple, and well-tested implementation of the Open Sound Control@@ -8,7 +8,7 @@ Example usage: . >>> :set -XOverloadedStrings - >>> msg = OSC "/foo" [OSC_S "bar", OSC_I 9, OSC_F 0.25, OSC_B "this-is-binary"]+ >>> msg = OSC "/foo" [OSC_S "bar", OSC_I 9, OSC_F 0.1, OSC_B "this-is-binary"] >>> :t msg > msg :: OSC >>> :t encodeOSC msg@@ -16,19 +16,37 @@ >>> decodeOSC (encodeOSC msg) == Right msg > True .- See the README.md file for examples of sending and receiving with UDP+ 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"] license: GPL license-file: LICENSE author: Tom Murphy maintainer: Tom Murphy category: Audio, Codec, Music, Sound-extra-source-files:- README.md build-type: Simple cabal-version: >=1.10 + library exposed-modules: Vivid.OSC@@ -44,17 +62,6 @@ build-depends: base >3 && <5-- -- TODO: can remove when we remove .Old:- -- Lower bound:- -- Just a guess -- 0.5.0.2 is >5 years old- -- I don't have a reason to think it needs a lower bound- -- 0.2 is the oldest version on Hackage- -- Upper bound:- -- 0.9 doesn't exist yet- -- Try: "> 0.5.0.2 && < 0.9"- , binary- -- Lower bound: -- Just a guess -- 0.9.1.8 is >5 years old