previous up next
5.2 The Scheme interface

The interface between the Scheme interpreter and the Varèse package consists of the following:

  • a set of class encapsulating Scheme primitives,
  • Scheme functions to create and call objects of the Varèse package.

Among the classes that encapsulate Scheme primitives we note the class SchemeProgram. This class implements the Program interface and refers to the Scheme primitive procedure. Functions defined in the Scheme environment can thus be used in the event handling.

We have defined Scheme procedures to interact with the synthesizer thru the Scheme shell. Since all sound synthesis is done by synthesis processes the first procedures we need are those to add or kill a synthesis process. The user can add a new synthesis process to the synthesizer using the following syntax:

(add <id> <sp>)

The id is an integer number, specified by the user, used to identify a synthesis process. The identification number is specified by the sender of an events and not by the synthesizer object to avoid the overhead of asynchronous communication. The second argument, sp, is an object of type SynthesisProcess. To kill the process the following expression is used:

(kill <id>)

Creating and scheduling a new event is done as follows:

(event <t> <p> <a1> ... )

The procedure p will be evaluated at time t with arguments a1, .... The procedure p is automatically wrapped in a SchemeProgram object.

In the following section we will describe the major classes of our project. We will show examples of their use and introduce the Scheme functions to interface them. We do not want to overload the text with the definition of all the Scheme interface functions we will use. The reader can find a reference of all the Scheme functions in appendix A.

previous up next