Documentation
:: Flags | flags |
-> Header | header section |
-> EventList Dur SignalOut | score section |
-> CsoundFile | csd file |
Generate csound code
Csound code consists of flags, header section, instruments,
ftables and score. Flags are represeted by String
. See
CsoundExpr.Base.Header for more details on header
section. Instruments, ftables and score are generated from
EventList
Dur
SignalOut
. From list of SignalOut
notes list
of instruments is derived. Expression-tree structures of
instruments are different from one another. An instrument
can't be transformed into another one only with substitution
of values in lists of expression-tree.
Example (d minor) :
import Temporal.Music.Notation.Score import CsoundExpr import CsoundExpr.Opcodes import CsoundExpr.Base.Pitch flags = "-o dm.wav" setup = instr0 [ gSr <=> 44100, gKr <=> 4410, gKsmps <=> 10, gNchnls <=> 1] header = [setup] sinWave = gen10 4096 [1] instr :: Irate -> SignalOut instr x = out $ oscilA [] (num 1000) (cpspch x) sinWave sco = fmap instr $ line $ map (note 1) [d, f, a, high d] main = print $ csd flags header $ renderScore sco