hsc3-0.19.1: Haskell SuperCollider
Safe HaskellNone
LanguageHaskell2010

Sound.SC3.Server.NRT

Contents

Description

Non-realtime score generation.

Synopsis

Documentation

oscWithSize :: Bundle -> ByteString Source #

Encode and prefix with encoded length.

newtype NRT Source #

An NRT score is a sequence of Bundles.

Constructors

NRT 

Fields

Instances

Instances details
Show NRT Source # 
Instance details

Defined in Sound.SC3.Server.NRT

Methods

showsPrec :: Int -> NRT -> ShowS #

show :: NRT -> String #

showList :: [NRT] -> ShowS #

type NRT_STAT = ((String, Time), (String, Int), (String, Int), (String, [(String, Int)])) Source #

Trivial NRT statistics.

nrt_stat :: NRT -> NRT_STAT 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.

encodeNRT :: NRT -> ByteString Source #

Encode an NRT 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

putNRT :: Handle -> NRT -> IO () Source #

Write an NRT score to a file handle.

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

QUERY

nrt_non_ascending :: NRT -> [(Bundle, Bundle)] Source #

Find any non-ascending sequences.