Instruments

Instruments are functions from some signal representation to signal.
Score is a Functor, so to play on instrument means to apply instrument
to Score of its notes. Instrument can be made with opcodes.
Translator derives p-fields from instrument structure. There are only
two explicit p-fields itime and idur (p2 and p3 in csound).

Opcodes

Naming conventions : Opcodes are named after csound's counterparts usually.
Some opcodes in csound can produce signals of different rates by request (oscil, linseg).
Those opcodes are labelled with suffix. Suffix defines output rate of signal (oscilA, oscilK).
Some opcodes in csound have unfixed number of inputs due to setup parameters, almost all of them.
Those opcodes have first argument that is list of setup parameters.

Imperative style csound code

Most of csound opcodes can be used in functional way. You can plug them in one another,
and make expressions, but some of them behave like procedures and rely on order
of execution in instrument. Module CsoundExpr.Base.Imperative provides functions
to write imperative csound code.

Preview

User Defined opcodes

MIDI

There are two ways to tell csd to include instrument in csound file.
Instrument can be a part of Score or it can be midi instrument, then it should
be mentioned in massign or pgmassign function. If you want to play midi-instr
for some time t, you can tell it to csd function by invoking csd with rest t
in place of EventList value.