-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | dynamic core for csound-expression library -- @package csound-expression-dynamic @version 0.1.2 -- | Csound's command line flags. See original documentation for detailed -- overview: -- http://www.csounds.com/manual/html/CommandFlagsCategory.html module Csound.Dynamic.Types.Flags data Flags Flags :: AudioFileOutput -> IdTags -> Maybe Rtaudio -> Maybe PulseAudio -> MidiIO -> MidiRT -> Maybe Rtmidi -> Displays -> Config -> Maybe String -> Flags audioFileOutput :: Flags -> AudioFileOutput idTags :: Flags -> IdTags rtaudio :: Flags -> Maybe Rtaudio pulseAudio :: Flags -> Maybe PulseAudio midiIO :: Flags -> MidiIO midiRT :: Flags -> MidiRT rtmidi :: Flags -> Maybe Rtmidi displays :: Flags -> Displays config :: Flags -> Config flagsVerbatim :: Flags -> Maybe String data AudioFileOutput AudioFileOutput :: Maybe FormatSamples -> Maybe FormatType -> Maybe String -> Maybe String -> Bool -> Bool -> Maybe Dither -> AudioFileOutput formatSamples :: AudioFileOutput -> Maybe FormatSamples formatType :: AudioFileOutput -> Maybe FormatType output :: AudioFileOutput -> Maybe String input :: AudioFileOutput -> Maybe String nosound :: AudioFileOutput -> Bool nopeaks :: AudioFileOutput -> Bool dither :: AudioFileOutput -> Maybe Dither data FormatHeader NoHeader :: FormatHeader RewriteHeader :: FormatHeader data FormatSamples Bit24 :: FormatSamples Alaw :: FormatSamples Uchar :: FormatSamples Schar :: FormatSamples FloatSamples :: FormatSamples Ulaw :: FormatSamples Short :: FormatSamples Long :: FormatSamples data FormatType Aiff :: FormatType Au :: FormatType Avr :: FormatType Caf :: FormatType Flac :: FormatType Htk :: FormatType Ircam :: FormatType Mat4 :: FormatType Mat5 :: FormatType Nis :: FormatType Paf :: FormatType Pvf :: FormatType Raw :: FormatType Sd2 :: FormatType Sds :: FormatType Svx :: FormatType Voc :: FormatType W64 :: FormatType Wav :: FormatType Wavex :: FormatType Xi :: FormatType data Dither Triangular :: Dither Uniform :: Dither data IdTags IdTags :: Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> IdTags idArtist :: IdTags -> Maybe String idComment :: IdTags -> Maybe String idCopyright :: IdTags -> Maybe String idDate :: IdTags -> Maybe String idSoftware :: IdTags -> Maybe String idTitle :: IdTags -> Maybe String data Rtaudio PortAudio :: Rtaudio Alsa :: Rtaudio Jack :: String -> String -> String -> Rtaudio jackClient :: Rtaudio -> String jackInport :: Rtaudio -> String jackOutport :: Rtaudio -> String Mme :: Rtaudio CoreAudio :: Rtaudio NoRtaudio :: Rtaudio data PulseAudio PulseAudio :: String -> String -> String -> PulseAudio paServer :: PulseAudio -> String paOutput :: PulseAudio -> String paInput :: PulseAudio -> String data MidiIO MidiIO :: Maybe String -> Maybe String -> Maybe String -> Bool -> Bool -> MidiIO midiFile :: MidiIO -> Maybe String midiOutFile :: MidiIO -> Maybe String muteTracks :: MidiIO -> Maybe String rawControllerMode :: MidiIO -> Bool terminateOnMidi :: MidiIO -> Bool data MidiRT MidiRT :: Maybe String -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe String -> MidiRT midiDevice :: MidiRT -> Maybe String midiKey :: MidiRT -> Maybe Int midiKeyCps :: MidiRT -> Maybe Int midiKeyOct :: MidiRT -> Maybe Int midiKeyPch :: MidiRT -> Maybe Int midiVelocity :: MidiRT -> Maybe Int midiVelocityAmp :: MidiRT -> Maybe Int midiOutDevice :: MidiRT -> Maybe String data Rtmidi PortMidi :: Rtmidi AlsaMidi :: Rtmidi CoreMidi :: Rtmidi MmeMidi :: Rtmidi WinmmeMidi :: Rtmidi VirtualMidi :: Rtmidi NoRtmidi :: Rtmidi data Displays Displays :: Maybe Int -> Maybe DisplayMode -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> Bool -> Bool -> Maybe Int -> Displays csdLineNums :: Displays -> Maybe Int displayMode :: Displays -> Maybe DisplayMode displayHeartbeat :: Displays -> Maybe Int messageLevel :: Displays -> Maybe Int mAmps :: Displays -> Maybe Int mRange :: Displays -> Maybe Int mWarnings :: Displays -> Maybe Int mDb :: Displays -> Maybe Int mColours :: Displays -> Maybe Int mBenchmarks :: Displays -> Maybe Int msgColor :: Displays -> Bool displayVerbose :: Displays -> Bool listOpcodes :: Displays -> Maybe Int data DisplayMode NoDisplay :: DisplayMode PostScriptDisplay :: DisplayMode AsciiDisplay :: DisplayMode data Config Config :: Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe String -> Maybe (String, String) -> Maybe (String, String) -> Bool -> Maybe Int -> Maybe (Int, String) -> Maybe Double -> Maybe Int -> Config hwBuf :: Config -> Maybe Int ioBuf :: Config -> Maybe Int newKr :: Config -> Maybe Int newSr :: Config -> Maybe Int scoreIn :: Config -> Maybe String omacro :: Config -> Maybe (String, String) smacro :: Config -> Maybe (String, String) setSched :: Config -> Bool schedNum :: Config -> Maybe Int strsetN :: Config -> Maybe (Int, String) skipSeconds :: Config -> Maybe Double setTempo :: Config -> Maybe Int instance Show FormatSamples instance Show Dither instance Show FormatType instance Pretty Config instance Pretty DisplayMode instance Pretty Displays instance Pretty Rtmidi instance Pretty MidiRT instance Pretty MidiIO instance Pretty PulseAudio instance Pretty Rtaudio instance Pretty IdTags instance Pretty Dither instance Pretty AudioFileOutput instance Pretty Flags instance Monoid Config instance Default Config instance Monoid Displays instance Default Displays instance Monoid MidiRT instance Default MidiRT instance Monoid MidiIO instance Default MidiIO instance Monoid IdTags instance Default IdTags instance Monoid AudioFileOutput instance Default AudioFileOutput instance Monoid Flags instance Default Flags module Csound.Dynamic.Types.EventList -- | A class that represents Csound scores. All functions that use score -- are defined in terms of this class. If you want to use your own score -- representation, just define two methods of the class. -- -- The properties: -- --
--   forall a . toCsdEventList (singleCsdEvent a) === CsdEventList 1 [(0, 1, a)]
--   
class Functor f => CsdSco f toCsdEventList :: CsdSco f => f a -> CsdEventList a singleCsdEvent :: CsdSco f => CsdEvent a -> f a -- | The Csound note. It's a triple of -- --
--   (startTime, duration, parameters)
--   
type CsdEvent a = (Double, Double, a) csdEventStart :: CsdEvent a -> Double csdEventDur :: CsdEvent a -> Double csdEventContent :: CsdEvent a -> a -- | CsdEventList is a canonical representation of the Csound -- scores. A scores is a list of events and we should know the total -- duration of the scores. It's not meant to be used directly. We can use -- a better alternative. More convenient type that belongs to -- CsdSco type class (see temporal-csound package). data CsdEventList a CsdEventList :: Double -> [CsdEvent a] -> CsdEventList a csdEventListDur :: CsdEventList a -> Double csdEventListNotes :: CsdEventList a -> [CsdEvent a] delayCsdEventList :: Double -> CsdEventList a -> CsdEventList a rescaleCsdEventList :: Double -> CsdEventList a -> CsdEventList a instance Eq a => Eq (CsdEventList a) instance Show a => Show (CsdEventList a) instance Functor CsdEventList instance Foldable CsdEventList instance Traversable CsdEventList instance CsdSco CsdEventList -- | Main types module Csound.Dynamic.Types.Exp -- | The inner representation of csound expressions. type E = Fix RatedExp data RatedExp a RatedExp :: Maybe Rate -> Maybe LineNum -> Exp a -> RatedExp a -- | Rate (can be undefined or Nothing, it means that rate should be -- deduced automatically from the context) ratedExpRate :: RatedExp a -> Maybe Rate -- | Dependency (it is used for expressions with side effects, value -- contains the privious statement) ratedExpDepends :: RatedExp a -> Maybe LineNum -- | Main expression ratedExpExp :: RatedExp a -> Exp a isEmptyExp :: E -> Bool -- | RatedVar is for pretty printing of the wiring ports. type RatedVar = Var Rate -- | Makes an rated variable. ratedVar :: Rate -> Int -> RatedVar -- | Querries a rate. ratedVarRate :: RatedVar -> Rate -- | Querries an integral identifier. ratedVarId :: RatedVar -> Int ratedExp :: Maybe Rate -> Exp E -> E noRate :: Exp E -> E withRate :: Rate -> Exp E -> E setRate :: Rate -> E -> E type Exp a = MainExp (PrimOr a) -- | Constructs PrimOr values from the expressions. It does inlining in -- case of primitive values. toPrimOr :: E -> PrimOr E -- | It's a primitive value or something else. It's used for inlining of -- the constants (primitive values). newtype PrimOr a PrimOr :: Either Prim a -> PrimOr a unPrimOr :: PrimOr a -> Either Prim a data MainExp a EmptyExp :: MainExp a -- | Primitives ExpPrim :: Prim -> MainExp a -- | Application of the opcode: we have opcode information (Info) and the -- arguments [a] Tfm :: Info -> [a] -> MainExp a -- | Rate conversion ConvertRate :: Rate -> Rate -> a -> MainExp a -- | Selects a cell from the tuple, here argument is always a tuple (result -- of opcode that returns several outputs) Select :: Rate -> Int -> a -> MainExp a -- | if-then-else If :: (CondInfo a) -> a -> a -> MainExp a -- | Boolean expressions (rendered in infix notation in the Csound) ExpBool :: (BoolExp a) -> MainExp a -- | Numerical expressions (rendered in infix notation in the Csound) ExpNum :: (NumExp a) -> MainExp a -- | Reading/writing a named variable InitVar :: Var -> a -> MainExp a ReadVar :: Var -> MainExp a WriteVar :: Var -> a -> MainExp a -- | Imperative If-then-else IfBegin :: (CondInfo a) -> MainExp a ElseIfBegin :: (CondInfo a) -> MainExp a ElseBegin :: MainExp a IfEnd :: MainExp a -- | looping constructions UntilBegin :: (CondInfo a) -> MainExp a UntilEnd :: MainExp a -- | Verbatim stmt Verbatim :: String -> MainExp a -- | Dependency tracking Starts :: MainExp a Seq :: a -> a -> MainExp a Ends :: a -> MainExp a type Name = String -- | An instrument identifier data InstrId InstrId :: Maybe Int -> Int -> InstrId instrIdFrac :: InstrId -> Maybe Int instrIdCeil :: InstrId -> Int InstrLabel :: String -> InstrId -- | Constructs an instrument id with the integer. intInstrId :: Int -> InstrId -- | Constructs an instrument id with fractional part. ratioInstrId :: Int -> Int -> InstrId -- | Constructs an instrument id with the string label. stringInstrId :: String -> InstrId data VarType LocalVar :: VarType GlobalVar :: VarType data Var Var :: VarType -> Rate -> Name -> Var varType :: Var -> VarType varRate :: Var -> Rate varName :: Var -> Name VarVerbatim :: Rate -> Name -> Var varRate :: Var -> Rate varName :: Var -> Name data Info Info :: Name -> Signature -> OpcFixity -> Info infoName :: Info -> Name infoSignature :: Info -> Signature infoOpcFixity :: Info -> OpcFixity data OpcFixity Prefix :: OpcFixity Infix :: OpcFixity Opcode :: OpcFixity -- | The Csound rates. data Rate Xr :: Rate Ar :: Rate Kr :: Rate Ir :: Rate Sr :: Rate Fr :: Rate Wr :: Rate Tvar :: Rate data Signature SingleRate :: (Map Rate [Rate]) -> Signature MultiRate :: [Rate] -> [Rate] -> Signature outMultiRate :: Signature -> [Rate] inMultiRate :: Signature -> [Rate] isInfix :: Info -> Bool isPrefix :: Info -> Bool data Prim P :: Int -> Prim PString :: Int -> Prim PrimInt :: Int -> Prim PrimDouble :: Double -> Prim PrimString :: String -> Prim PrimInstrId :: InstrId -> Prim PrimVar :: Rate -> Var -> Prim primVarTargetRate :: Prim -> Rate primVar :: Prim -> Var data Gen Gen :: Int -> Int -> [Double] -> Maybe String -> Gen genSize :: Gen -> Int genId :: Gen -> Int genArgs :: Gen -> [Double] genFile :: Gen -> Maybe String data Inline a b Inline :: InlineExp a -> IntMap b -> Inline a b inlineExp :: Inline a b -> InlineExp a inlineEnv :: Inline a b -> IntMap b data InlineExp a InlinePrim :: Int -> InlineExp a InlineExp :: a -> [InlineExp a] -> InlineExp a data PreInline a b PreInline :: a -> [b] -> PreInline a b type BoolExp a = PreInline CondOp a type CondInfo a = Inline CondOp a data CondOp TrueOp :: CondOp FalseOp :: CondOp And :: CondOp Or :: CondOp Equals :: CondOp NotEquals :: CondOp Less :: CondOp Greater :: CondOp LessEquals :: CondOp GreaterEquals :: CondOp isTrue :: CondInfo a -> Bool isFalse :: CondInfo a -> Bool type NumExp a = PreInline NumOp a data NumOp Add :: NumOp Sub :: NumOp Neg :: NumOp Mul :: NumOp Div :: NumOp Pow :: NumOp Mod :: NumOp type Note = [Prim] -- | Multiple output. Specify the number of outputs to get the result. type MultiOut a = Int -> a instance Show InstrId instance Eq InstrId instance Ord InstrId instance Show VarType instance Eq VarType instance Ord VarType instance Show OpcFixity instance Eq OpcFixity instance Ord OpcFixity instance Show Rate instance Eq Rate instance Ord Rate instance Enum Rate instance Bounded Rate instance Show Var instance Eq Var instance Ord Var instance Show Signature instance Eq Signature instance Ord Signature instance Show Info instance Eq Info instance Ord Info instance Show Prim instance Eq Prim instance Ord Prim instance Show a => Show (PrimOr a) instance Eq a => Eq (PrimOr a) instance Ord a => Ord (PrimOr a) instance Functor PrimOr instance Show Gen instance Eq Gen instance Ord Gen instance Show a => Show (InlineExp a) instance Eq a => Eq (InlineExp a) instance Ord a => Ord (InlineExp a) instance (Show a, Show b) => Show (Inline a b) instance (Eq a, Eq b) => Eq (Inline a b) instance (Ord a, Ord b) => Ord (Inline a b) instance Functor (Inline a) instance Foldable (Inline a) instance Traversable (Inline a) instance (Show a, Show b) => Show (PreInline a b) instance (Eq a, Eq b) => Eq (PreInline a b) instance (Ord a, Ord b) => Ord (PreInline a b) instance Functor (PreInline a) instance Foldable (PreInline a) instance Traversable (PreInline a) instance Show CondOp instance Eq CondOp instance Ord CondOp instance Show NumOp instance Eq NumOp instance Ord NumOp instance Show a => Show (MainExp a) instance Eq a => Eq (MainExp a) instance Ord a => Ord (MainExp a) instance Functor MainExp instance Foldable MainExp instance Traversable MainExp instance Show a => Show (RatedExp a) instance Eq a => Eq (RatedExp a) instance Ord a => Ord (RatedExp a) instance Functor RatedExp instance Foldable RatedExp instance Traversable RatedExp instance Traversable PrimOr instance Foldable PrimOr -- | Dependency tracking module Csound.Dynamic.Types.Dep -- | Csound's synonym for IO-monad. Dep means Side Effect. -- You will bump into Dep trying to read and write to delay -- lines, making random signals or trying to save your audio to file. -- Instrument is expected to return a value of Dep [Sig]. So -- it's okay to do some side effects when playing a note. newtype DepT m a DepT :: StateT LocalHistory m a -> DepT m a unDepT :: DepT m a -> StateT LocalHistory m a data LocalHistory LocalHistory :: E -> Int -> Int -> LocalHistory expDependency :: LocalHistory -> E newLineNum :: LocalHistory -> Int newLocalVarId :: LocalHistory -> Int runDepT :: (Functor m, Monad m) => DepT m a -> m (a, LocalHistory) execDepT :: (Functor m, Monad m) => DepT m () -> m E evalDepT :: (Functor m, Monad m) => DepT m a -> m a depT :: Monad m => E -> DepT m E depT_ :: Monad m => E -> DepT m () mdepT :: Monad m => MultiOut [E] -> MultiOut (DepT m [E]) stripDepT :: Monad m => DepT m a -> m a stmtOnlyT :: Monad m => Exp E -> DepT m () newLocalVar :: Monad m => Rate -> m E -> DepT m Var newLocalVars :: Monad m => [Rate] -> m [E] -> DepT m [Var] writeVar :: Monad m => Var -> E -> DepT m () readVar :: Monad m => Var -> DepT m E readOnlyVar :: Var -> E initVar :: Monad m => Var -> E -> DepT m () appendVarBy :: Monad m => (E -> E -> E) -> Var -> E -> DepT m () instance MonadTrans DepT instance Monad m => Monad (DepT m) instance Monad m => Applicative (DepT m) instance Monad m => Functor (DepT m) instance Default LocalHistory -- | The Csound file module Csound.Dynamic.Types.CsdFile data Csd Csd :: Flags -> Orc -> Sco -> Csd csdFlags :: Csd -> Flags csdOrc :: Csd -> Orc csdSco :: Csd -> Sco data Flags data Orc Orc :: InstrBody -> [Instr] -> Orc orcHead :: Orc -> InstrBody orcInstruments :: Orc -> [Instr] data Sco Sco :: Maybe Double -> [(Int, Gen)] -> [(InstrId, [CsdEvent Note])] -> Sco scoTotalDur :: Sco -> Maybe Double scoGens :: Sco -> [(Int, Gen)] scoNotes :: Sco -> [(InstrId, [CsdEvent Note])] data Instr Instr :: InstrId -> InstrBody -> Instr instrName :: Instr -> InstrId instrBody :: Instr -> InstrBody type InstrBody = E intInstr :: Int -> E -> Instr alwaysOn :: InstrId -> (InstrId, [CsdEvent Note]) module Csound.Dynamic.Types module Csound.Dynamic.Build toExp :: E -> Exp E onExp :: (Exp E -> Exp E) -> E -> E getRates :: MainExp a -> [Rate] isMultiOutSignature :: Signature -> Bool getPrimUnsafe :: E -> Prim prim :: Prim -> E opcPrefix :: Name -> Signature -> Info oprPrefix :: Name -> Signature -> Info oprInfix :: Name -> Signature -> Info numExp1 :: NumOp -> E -> E numExp2 :: NumOp -> E -> E -> E tfm :: Info -> [E] -> E tfmNoInlineArgs :: Info -> [E] -> E pn :: Int -> E withInits :: E -> [E] -> E -- | Converts Haskell's doubles to Csound's doubles double :: Double -> E -- | Converts Haskell's integers to Csound's doubles int :: Int -> E -- | Converts Haskell's strings to Csound's strings str :: String -> E verbatim :: Monad m => String -> DepT m () instrIdE :: InstrId -> E type Spec1 = [(Rate, [Rate])] spec1 :: Spec1 -> Signature opcs :: Name -> Spec1 -> [E] -> E opcsNoInlineArgs :: Name -> Spec1 -> [E] -> E opr1 :: Name -> E -> E opr1k :: Name -> E -> E infOpr :: Name -> E -> E -> E oprBy :: Name -> Spec1 -> [E] -> E type Specs = ([Rate], [Rate]) specs :: Specs -> Signature -- | Multiple output. Specify the number of outputs to get the result. type MultiOut a = Int -> a mopcs :: Name -> Specs -> [E] -> MultiOut [E] mo :: Int -> E -> [E] setSr :: Monad m => Int -> DepT m () setKsmps :: Monad m => Int -> DepT m () setNchnls :: Monad m => Int -> DepT m () setNchnls_i :: Monad m => Int -> DepT m () setKr :: Monad m => Int -> DepT m () setZeroDbfs :: Monad m => Double -> DepT m () -- | Numeric instances module Csound.Dynamic.Build.Numeric ceilE :: E -> E floorE :: E -> E roundE :: E -> E intE :: E -> E fracE :: E -> E instance Integral E instance Real E instance Enum E instance Floating E instance Fractional E instance Num E instance Monoid E -- | Boolean instances module Csound.Dynamic.Build.Logic when1 :: Monad m => E -> DepT m () -> DepT m () whens :: Monad m => [(E, DepT m ())] -> DepT m () -> DepT m () ifBegin :: Monad m => E -> DepT m () ifEnd :: Monad m => DepT m () elseBegin :: Monad m => DepT m () elseIfBegin :: Monad m => E -> DepT m () untilDo :: Monad m => E -> DepT m () -> DepT m () untilBegin :: Monad m => E -> DepT m () untilEnd :: Monad m => DepT m () instance OrdB E instance EqB E instance IfB E instance Boolean E module Csound.Dynamic.Render renderCsd :: Csd -> String -- | Exports everything. module Csound.Dynamic