TclCsound
Prev | Part I. Overview | Next

## TclCsound

TclCsound was introduced to provide a simple scripting interface to Csound. Tcl is a simple language that is easy to extend and provide nice facilities such as easy file access and TCP networking. With its Tk component, it can also handle a graphic and event interface. TclCsound provides three ‘points of contact' with Tcl:

1. a csound-aware tcl interpreter (cstclsh)

2. a csound-aware windowing shell (cswish)

3. a csound commands module for Tcl/Tk (tclcsound dynamic lib)

## The Tcl interpreter: cstclsh

With cstclsh, it is possible to have interactive control over a csound performance. The command starts an interactive shell, which holds an instance of Csound. A number of commands can then be used to control it. For instance, the following command can compile csound code and load it in memory ready for performance:

    csCompile -odac orchestra score -m0

Once this is done, performance can be started in two ways: using csPlay or csPerform . The command

    csPlay

will start the Csound performance in a separate thread and return to the cstclsh prompt. A number of commands can then be used to control Csound. For instance,

    csPause

will pause performance; and

    csRewind

will rewind to the beginning of the note-list. The csNote, csTable and csEvent commands can be used to add Csound score events to the performance, on-the-fly. The csPerform command, as opposed to csPlay , will not launch a separate thread, but will run Csound in the same thread, returning only when the performance is finished. A variety of other commands exist, providing full control of Csound.

Prev | Up | Next
CsoundVST | Home | Cswish: the windowing shell