csound-expression-0.2.0: Csound combinator library

CsoundExpr.Base.Header

Contents

Description

Header section

Synopsis

Types

type Header = [SignalInit]Source

Header section

Setup variables

midi instruments

massignSource

Arguments

:: [Int]

ireset

-> Int

ichnl

-> SignalOut

midi instrument

-> SignalInit 

pgmassignSource

Arguments

:: [Int]

ichn

-> Int

ipgm

-> SignalOut

midi instrument

-> SignalInit 

Setting instrument order

instrOrder :: [SignalOut] -> SignalInitSource

instrOrder defines relative order of instruments in orchestra

Instrument is a mapping from note-interface to SignalOut. If two SignalOut's have equal expression-tree structure they are rendered to the same instrument. Value in list refers to expresion-tree structure of instrument.

Example :

 header = [
    instr0 [ 
        gSr     <=>     44100,
        gKr     <=>     4410,        
        gKsmps  <=>       10,
        gNchnls <=>        1],
    instrOrder [instr1 (0, 0), instr2 ""]
 ]
 instr1 :: (Irate, Irate) -> SignalOut
 instr1 (amp, cps) = out $ oscilA [] amp cps 
 instr2 :: String -> SignalOut
 instr2 file  = out $ moA1 $ diskin2 [] file (num 1) 

Header opcodes

instr0 :: [SignalOut] -> SignalInitSource

header's initialization statements, like global variables initialization, seed, ctrlinit, fltk, etc.

Example :

 instr0 [
     gar "sig0"  <=> initA 0,
     gar "sig1"  <=> initA 0,
     gir "fn"    <=> ftgen 0 16384 10 [1],
     seed 0
 ]    

initA :: Irate -> ArateSource

Puts the value of the i-time expression into a a-rate variable.

initK :: Irate -> KrateSource

Puts the value of the i-time expression into a k-rate variable.

initI :: Irate -> IrateSource

Puts the value of the i-time expression into a i-rate variable.

seed :: Irate -> SignalOutSource

Sets the global seed value for all x-class noise generators, as well as other opcodes that use a random call, such as grain.

 seed ival

ctrlinit :: Irate -> [Irate] -> SignalOutSource

Sets the initial values for a set of MIDI controllers.

 ctrlinit ichnl, ictlno1, ival1 [, ictlno2] [, ival2] [, ictlno3] \
      [, ival3] [,...ival32]

ftgen :: Irate -> Irate -> Irate -> [Irate] -> IrateSource

Generate a score function table from within the orchestra.

 gir ftgen ifn, itime, isize, igen, iarga [, iargb ] [...] 

ifn - is set to zero

 ftgen itime isize igen [iargs]

Constants

(gSr = 44100, gKr = 4410, gKsmps = 10)