hsc3-0.20: Haskell SuperCollider
Safe HaskellSafe-Inferred
LanguageHaskell2010

Sound.Sc3.Server.Graphdef.Binary

Description

Binary encoders and decoders.

Synopsis

Binary Get (version 0|1 or 2)

get_pstr :: Get Name Source #

Get a Name (Pascal string).

binary_get_f :: Get_Functions Get Source #

Get_Functions for binary .scsyndef files.

Read

read_graphdef_file :: FilePath -> IO Graphdef Source #

Read Graphdef from .scsyndef file.

dir = "/home/rohan/sw/rsc3-disassembler/scsyndef/"
pp nm = read_graphdef_file (dir ++ nm) >>= putStrLn . graphdef_stat
pp "simple.scsyndef"
pp "with-ctl.scsyndef"
pp "mce.scsyndef"
pp "mrg.scsyndef"

Stat

Encode (version zero)

encode_pstr :: Name -> ByteString Source #

Pascal (length prefixed) encoding of Name.

L.unpack (encode_pstr (ascii "string")) ==  [6, 115, 116, 114, 105, 110, 103]

encode_sample :: Sample -> ByteString Source #

Encode Sample as 32-bit IEEE float.

IO

graphdefWrite :: FilePath -> Graphdef -> IO () Source #

Write Graphdef to indicated file.

graphdefWrite_dir :: FilePath -> Graphdef -> IO () Source #

Write Graphdef to indicated directory. The filename is the graphdef_name with the appropriate extension (scsyndef).