Reference

Reference#

Engine

An Engine wraps a live csound process and provides a simple way to define instruments, schedule events, load soundfiles, etc., for realtime audio processing / synthesis. Any .csd script can be adapted to be run using an Engine.

Session

The Session class implements a high-level interface on top of a running Engine. Within a Session it is possible to define instrument templates (Instr), which can be scheduled at any order to construct complex processing chains (see the bus opcodes or using the chnget/chnset opcodes to communicate between instruments). Such instrument template provide other extra features, like named arguments, automatic gui generation, groups, etc.

The same instrument templates can be reused for offline (non-real-time) rendering

Instr

An Instr is an instrument template. It defines the csound code and its parameters and default values. A concrete csound instrument is created only when an Instr is scheduled. The main difference with a csound instr is that an Instr can be scheduled at any level within the evaluation chain. Similar to plugins in a DAW, Instr can be organized to build processing chains of any depth.

Synth

A Synth wraps an event scheduled within a Session. It has methods for setting and automating/modulating parameters, querying audio inputs and outputs and can auto-generate a user-interface to interact with its parameters in real-time.

Offline Rendering

Both an Engine and its associated Session are concieved to run in real-time. For offline rendering csoundengine provides the Renderer class, which has the same interface as a Session but collects all scheduled events, soundfiles, automation, etc. and renders everything offline (and probably much faster). A Renderer is a drop-in replacement for a Session. It can also be used to generate a csound project to be further edited and/or rendered by the csound executable. See Offline Rendering