vivid-supercollider 0.3.0.0 → 0.4.1.0
raw patch · 3 files changed
+77/−32 lines, 3 filesdep ~vivid-oscPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: vivid-osc
API changes (from Hackage documentation)
+ Vivid.SC.Server.Commands: b_query :: [BufferId] -> OSC
Files
- Vivid/SC/Server/Commands.hs +33/−21
- Vivid/SC/SynthDef/Literally.hs +42/−9
- vivid-supercollider.cabal +2/−2
Vivid/SC/Server/Commands.hs view
@@ -35,6 +35,7 @@ , b_zero , b_free , b_close+ , b_query , b_write ) where @@ -67,7 +68,7 @@ section:: Master Controls -} -{-+{-| subsection:: /quit Quit program. Exits the synthesis server.@@ -125,14 +126,16 @@ Commands are defined by plug-ins. -} -{-+{-| subsection:: /dumpOSC Display incoming OSC messages. table:: ## strong::int:: || code :: Turns on and off printing of the contents of incoming Open Sound Control messages. This is useful when debugging your command stream.+-} +{- The values for the code are as follows: table:: ## 0 || turn dumping OFF.@@ -158,7 +161,7 @@ DumpOSC_Hex -> 2 DumpOSC_ParsedAndHex -> 3 -{-+{-| subsection:: /sync Notify when async commands have completed. table::@@ -175,7 +178,7 @@ sync :: SyncId -> OSC sync (SyncId syncId) = OSC "/sync" [OSC_I syncId] -{-+{-| subsection:: /clearSched Clear all scheduled bundles. Removes all bundles from the scheduling queue.@@ -231,7 +234,7 @@ section:: Synth Definition Commands -} -{-+{-| subsection:: /d_recv Receive a synth definition file. table::@@ -263,7 +266,7 @@ Right osc -> encodeOSC osc -} -{-+{-| subsection:: /d_load Load synth definition. table::@@ -282,7 +285,7 @@ Nothing -> OSC "/d_load" [path] Just c -> OSC "/d_load" [path, OSC_B (encodeOSC c)] -{-+{-| subsection:: /d_loadDir Load a directory of synth definitions. table::@@ -314,7 +317,7 @@ section:: Node Commands -} -{-+{-| subsection:: /n_free Delete a node. table::@@ -328,7 +331,7 @@ n_free (NodeId nId) = OSC "/n_free" [OSC_I nId] -{-+{-| subsection:: /n_run Turn node on or off. table::@@ -348,7 +351,7 @@ n_run (NodeId nId) shouldRun = OSC "/n_run" [OSC_I nId, OSC_I $ case shouldRun of { True -> 1 ; False -> 0 }] -{-+{-| subsection:: /n_set Set a node's control value(s). table::@@ -526,7 +529,7 @@ :: -} -{-+{-| section:: Synth Commands subsection:: /s_new@@ -621,7 +624,7 @@ -} -{-+{-| section:: Group Commands subsection:: /g_new@@ -657,7 +660,7 @@ , OSC_I targetNodeId ] -{-+{-| subsection:: /p_new Create a new parallel group. table::@@ -714,7 +717,7 @@ Adds the node to the tail (last to be executed) of the group. -} -{-+{-| subsection:: /g_freeAll Delete all nodes in a group. table::@@ -788,7 +791,7 @@ Sends all arguments following the command name to the unit generator to be performed. Commands are defined by unit generator plug ins. -} -{-+{-| section:: Buffer Commands Buffers are stored in a global array, indexed by integers starting at zero.@@ -823,7 +826,7 @@ Nothing -> [] Just cmd -> [OSC_B (encodeOSC cmd)] -{-+{-| subsection:: /b_allocRead Allocate buffer space and read a sound file. table::@@ -919,7 +922,7 @@ -} -{-+{-| subsection:: /b_write Write sound file data. table::@@ -965,7 +968,7 @@ , OSC_I $ case keepOpen of { True -> 1 ; False -> 0 } ] `addMaybeComplete` completionMaybe -{-+{-| subsection:: /b_free Free buffer data. table::@@ -984,7 +987,7 @@ OSC_I bufId ] `addMaybeComplete` completionMaybe -{-+{-| subsection:: /b_zero Zero sample data. table::@@ -1054,7 +1057,7 @@ :: -} -{-+{-| subsection:: /b_close Close soundfile. table::@@ -1073,7 +1076,7 @@ OSC_I bufId ] `addMaybeComplete` completionMaybe -{-+{-| subsection:: /b_query Get buffer info. table::@@ -1090,6 +1093,15 @@ :: :: +Since: vivid-0.4.1+-}++b_query :: [BufferId] -> OSC+b_query bufIds =+ OSC "/b_query" [ OSC_I bufId | (BufferId bufId) <- bufIds ]+++{- subsection:: /b_get Get sample value(s). table::
Vivid/SC/SynthDef/Literally.hs view
@@ -7,14 +7,17 @@ {-# OPTIONS_HADDOCK show-extensions #-} -{-# LANGUAGE NoRebindableSyntax #-}-{-# LANGUAGE ScopedTypeVariables #-} -- todo-{-# LANGUAGE LambdaCase #-}-{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE+ NoRebindableSyntax+ , ScopedTypeVariables+ , LambdaCase+ , OverloadedStrings -{-# LANGUAGE NoIncoherentInstances #-}-{-# LANGUAGE NoMonomorphismRestriction #-}-{-# LANGUAGE NoUndecidableInstances #-}+ , NoIncoherentInstances+ , NoMonomorphismRestriction+ , NoUndecidableInstances+ #-}+ -- TODO: remove ScopedTypeVariables? module Vivid.SC.SynthDef.Literally ( LiteralSynthDef(..)@@ -75,7 +78,7 @@ ) where import Vivid.SC.SynthDef.Types (BinaryOp(..), UnaryOp(..), CalculationRate(..))-import Vivid.OSC.Old.Util (floatToWord, wordToFloat)+-- import Vivid.OSC.Old.Util (floatToWord, wordToFloat) import Control.Arrow (first) import Control.Monad@@ -97,6 +100,10 @@ -- import Data.Serialize.IEEE754 +-- TODO: temporary:+import Data.Bits ((.&.), complement, Bits)+import qualified Foreign as F+import System.IO.Unsafe (unsafePerformIO) data LiteralSynthDef = LiteralSynthDef { _synthDefName :: ByteString -- pstring: "a pascal format string: a byte giving the length followed by that many bytes"@@ -212,10 +219,36 @@ , mconcat $ map encodeVariantSpec variants ] ++-- TODO: temporary:+-- from hosc:+align :: (Num i,Bits i) => i -> i+{-# INLINE align #-}+align n = ((n + 3) .&. complement 3) - n++-- from data-binary-ieee754:+floatToWord :: Float -> F.Word32+floatToWord = coercionThing++wordToFloat :: F.Word32 -> Float+wordToFloat = coercionThing++doubleToWord :: Double -> F.Word64+doubleToWord = coercionThing++wordToDouble :: F.Word64 -> Double+wordToDouble = coercionThing+++coercionThing :: (F.Storable a, F.Storable b) => a -> b+coercionThing x = unsafePerformIO $ F.alloca $ \buf -> do+ F.poke (F.castPtr buf) x+ F.peek buf++ putLiteralSynthDef' :: LiteralSynthDef -> Put putLiteralSynthDef' (LiteralSynthDef name constants params paramNames ugenSpecs variants) = do putPString' name- putListWLenPrefix32 putFloat32be constants putListWLenPrefix32 putFloat32be params putListWLenPrefix32 putParamName' paramNames
vivid-supercollider.cabal view
@@ -1,5 +1,5 @@ name: vivid-supercollider-version: 0.3.0.0+version: 0.4.1.0 synopsis: Implementation of SuperCollider server specifications description:@@ -34,7 +34,7 @@ , ViewPatterns build-depends: base >3 && <5- , vivid-osc >=0.3 && <0.4+ , vivid-osc >=0.4 && <0.6 -- todo: replace completely with cereal: , binary -- >=0.8 && <0.9