hsc3-rw-0.15: hsc3 re-writing

Safe HaskellSafe-Inferred

Sound.SC3.RW.PSynth

Contents

Description

Rewriter for psynth directives and related functions.

Synopsis

Types

type Param = (String, Double)Source

A SynthDef parameter.

type PSynth = (String, [Param])Source

Name of SynthDef and associated Param.

Pretty printer

param_pp :: Param -> StringSource

Printer for control and trigger parameters.

 map param_pp [("freq",440),("t_gate",1)]

add_braces :: String -> StringSource

params_pp :: [Param] -> StringSource

uparam_pp :: [Param] -> StringSource

psynth_pp :: PSynth -> StringSource

Parser

type P a = ParsecT String () Identity aSource

promote :: Either Integer Double -> DoubleSource

parse_psynth :: String -> PSynthSource

Parse PSynth pre-amble.

 parse_psynth "gr = psynth {freq = 440,phase = 0,amp = 0.1,loc = 0} where"

rewrite_psynth :: String -> StringSource

Rewrite PSynth pre-amble.

 rewrite_psynth "gr = psynth {freq = 440,phase = 0,amp = 0.1,loc = 0} where"

rewrite_param_list :: String -> StringSource

Rewrite plaine Param list, ie. SC3 argument list.

 rewrite_param_list "freq=440,amp=0.1,t_gate=1"

parse_uparam :: String -> [Param]Source

rewrite_uparam :: String -> StringSource

braces :: P a -> P aSource

symbol :: String -> P StringSource

naturalOrFloat :: P (Either Integer Double)Source

equals :: P StringSource

comma :: P StringSource

semi :: P StringSource

Re-write processor

begins_psynth :: String -> BoolSource

ends_psynth :: String -> BoolSource

psynth_rewrite :: [String] -> [String]Source

psynth_rewrite_ghcF :: IO ()Source

Arguments as required by ghc -F -pgmF.

uparam_rewrite :: String -> StringSource

Rewrite uparam pre-amble.

 uparam_rewrite "    let uparam = {amp = 0.1, freq = 129.897, rise = 0.1, fall = 0.5}"

uparam_rewrite_ghcF :: IO ()Source

Arguments as required by ghc -F -pgmF.