Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Binary encoders and decoders.
Synopsis
- get_pstr :: Get Name
- binary_get_f :: Get_Functions Get
- read_graphdef_file :: FilePath -> IO Graphdef
- scsyndef_stat :: FilePath -> IO String
- enc_bytestring :: Encode_Functions ByteString
- encode_pstr :: Name -> ByteString
- encode_input :: Input -> ByteString
- encode_control :: Control -> ByteString
- encode_ugen :: Ugen -> ByteString
- encode_sample :: Sample -> ByteString
- encode_graphdef :: Graphdef -> ByteString
- graphdefWrite :: FilePath -> Graphdef -> IO ()
- graphdefWrite_dir :: FilePath -> Graphdef -> IO ()
Binary Get (version 0|1 or 2)
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
scsyndef_stat :: FilePath -> IO String Source #
read_graphdef_file
and run graphdef_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_input :: Input -> ByteString Source #
Byte-encode Input
.
encode_control :: Control -> ByteString Source #
Byte-encode Control
.
encode_ugen :: Ugen -> ByteString Source #
Byte-encode Ugen
.
encode_sample :: Sample -> ByteString Source #
Encode Sample
as 32-bit IEEE float.
encode_graphdef :: Graphdef -> ByteString Source #
Encode Graphdef
.
IO
graphdefWrite_dir :: FilePath -> Graphdef -> IO () Source #
Write Graphdef
to indicated directory. The filename is the
graphdef_name
with the appropriate extension (scsyndef
).