Safe Haskell | None |
---|---|
Language | Haskell2010 |
Non-realtime score generation.
Synopsis
- oscWithSize :: Bundle -> ByteString
- newtype NRT = NRT {
- nrt_bundles :: [Bundle]
- type NRT_STAT = ((String, Time), (String, Int), (String, Int), (String, [(String, Int)]))
- nrt_stat_param :: (String, String, String, String)
- nrt_stat :: NRT -> NRT_STAT
- nrt_span :: (Time -> Bool) -> NRT -> ([Bundle], [Bundle])
- encodeNRT :: NRT -> ByteString
- writeNRT :: FilePath -> NRT -> IO ()
- putNRT :: Handle -> NRT -> IO ()
- decode_nrt_bundles :: ByteString -> [Bundle]
- decodeNRT :: ByteString -> NRT
- readNRT :: FilePath -> IO NRT
- type NRT_Param_Plain = (FilePath, (FilePath, Int), (FilePath, Int), Int, SampleFormat, [String])
- nrt_param_plain_to_arg :: NRT_Param_Plain -> [String]
- nrt_exec_plain :: NRT_Param_Plain -> IO ()
- nrt_proc_plain :: NRT_Param_Plain -> NRT -> IO ()
- type NRT_Render_Plain = (FilePath, FilePath, Int, Int, SampleFormat, [String])
- nrt_render_plain :: NRT_Render_Plain -> NRT -> IO ()
- nrt_non_ascending :: NRT -> [(Bundle, Bundle)]
Documentation
oscWithSize :: Bundle -> ByteString Source #
Encode and prefix with encoded length.
NRT | |
|
type NRT_STAT = ((String, Time), (String, Int), (String, Int), (String, [(String, Int)])) Source #
Trivial NRT statistics.
nrt_span :: (Time -> Bool) -> NRT -> ([Bundle], [Bundle]) Source #
span
of f
of bundleTime
. Can be used to separate the
initialisation and remainder parts of a score.
writeNRT :: FilePath -> NRT -> IO () Source #
Write an NRT
score.
import Sound.OSC import Sound.SC3 m1 = g_new [(1, AddToTail, 0)] m2 = d_recv (synthdef "sin" (out 0 (sinOsc AR 660 0 * 0.15))) m3 = s_new "sin" 100 AddToTail 1 [] m4 = n_free [100] m5 = nrt_end sc = NRT [bundle 0 [m1,m2],bundle 1 [m3],bundle 10 [m4],bundle 15 [m5]] writeNRT "tmpt.osc" sc
decode_nrt_bundles :: ByteString -> [Bundle] Source #
Decode an NRT
ByteString
to a list of Bundle
s.
decodeNRT :: ByteString -> NRT Source #
Decode an NRT
ByteString
.
Render
type NRT_Param_Plain = (FilePath, (FilePath, Int), (FilePath, Int), Int, SampleFormat, [String]) Source #
Minimal NRT rendering parameters.
The sound file type is inferred from the file name extension. Structure is: OSC file name, input audio file name and input number of channels, output audio file name and output number of channels, sample rate (int), sample format, further parameters (ie. ["-m","32768"]) to be inserted before the NRT -N option.
nrt_param_plain_to_arg :: NRT_Param_Plain -> [String] Source #
Compile argument list from NRT_Param_Plain.
let opt = ("/tmp/t.osc",("_",0),("/tmp/t.wav",1),48000,PcmInt16,[]) let r = ["-i","0","-o","1","-N","/tmp/t.osc","_","/tmp/t.wav","48000","wav","int16"] nrt_param_plain_to_arg opt == r
nrt_exec_plain :: NRT_Param_Plain -> IO () Source #
Compile argument list from NRT_Param_Plain and run scynth.
nrt_exec_plain opt
nrt_proc_plain :: NRT_Param_Plain -> NRT -> IO () Source #
Minimal NRT rendering, for more control see Stefan Kersten's hsc3-process package at: https://github.com/kaoskorobase/hsc3-process.
type NRT_Render_Plain = (FilePath, FilePath, Int, Int, SampleFormat, [String]) Source #
Variant for no input case.
(osc-file-name,audio-file-name,number-of-channels,sample-rate,sample-format,param)
nrt_render_plain :: NRT_Render_Plain -> NRT -> IO () Source #
Add ("-",0) as input parameters and run nrt_proc_plain
.
nrt_render_plain opt sc