s Statement

s — Marks the end of a section.

Description

The s statement marks the end of a section.

Syntax

s [time]

Initialization

The first p-field time is optional and if present determines the end time (length in beats) of the section. This time must be after the end of the last event in the section otherwise it will have no effect. This can be used to create a pause before the beginning of the next section or to allow "always on" instruments such as effects to play by themselves for some length of time.

Performance

Sorting of the i statement, f statement and a statement by action time is done section by section.

Time warping for the t statement is done section by section.

All action times within a section are relative to its beginning. A section statement establishes a new relative time of 0, but has no other reinitializing effects (e.g. stored function tables are preserved across section boundaries).

A section is considered complete when all action times and finite durations have been satisfied (i.e., the "length" of a section is determined by the last occurring action or turn-off). A section can be extended by the use of an f0 statement or by supplying the optional p1 value to the s statement.

A section ending automatically invokes a purge of inactive instrument and data spaces.

[Note] Note

  • Since score statements are processed section by section, the amount of memory required depends on the maximum number of score statements in a section. Memory allocation is dynamic, and the user will be informed as extra memory blocks are requested during score processing.

  • For the end of the final section of a score, the s statement is optional; the e statement may be used instead.

Examples

Here is an example of the s statement. It uses the file s.csd.

Example 1268. Example of the s statement.

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac     ;;;realtime audio out
;-iadc    ;;;uncomment -iadc if RT audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o s.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 32
nchnls = 2
0dbfs  = 1

instr 1

aenv expseg .01, p3*0.25, 1, p3*0.75, 0.01
asig poscil3 .8*aenv, p4, 1
     outs asig, asig

endin
</CsInstruments>
<CsScore>
f 1 0 16384 10 1;sine wave

s		;first section
i 1 0 2 110
i 1 3 2 220
i 1 6 2 440
i 1 9 2 880

s		;second section
i 1 0 2 880
i 1 3 2 440
i 1 6 2 220
i 1 9 2 110
e
</CsScore>
</CsoundSynthesizer>