File: const.html

package info (click to toggle)
csound-doc 3.47b2-2
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 1,492 kB
  • ctags: 272
  • sloc: makefile: 36
file content (93 lines) | stat: -rw-r--r-- 5,088 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<HTML>
<TITLE>CONSTANTS_AND_VARIABLES</TITLE>
<CENTER><A NAME="CONSTANTS_AND_VARIABLES"></A>
<HR WIDTH="100%"><B><A HREF="../REFER.html">QUICK-REF</A></B> - <B><A HREF="../TITLE.html"><FONT SIZE=+1>C</FONT>soundManual</A></B>
- <B><A HREF="SYNTAX.html">Top of this section</A></B> - <A HREF="./statem.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="./expr.html">Next</A>&nbsp;
<HR></CENTER>

<H2>
CONSTANTS AND VARIABLES</H2>
<B>constants</B> are floating point numbers, such as 1, 3.14159, or -73.45.
They are available continuously and do not change in value.

<P><B>variables</B> are named cells containing numbers. They are available
continuously and may be updated at one of the four update rates (setup
only, I-rate, K-rate, or A-rate). I- and K-rate variables are scalars (i.e.
they take on only one value at any given time) and are primarily used to
store and recall controlling data, that is, data that changes at the note
rate (for I-variables) or at the control rate (for K-variables). I- and
K-variables are therefore useful for storing note parameter values, pitches,
durations, slow-moving frequencies, vibratos, etc. A-variables, on the
other hand, are arrays or vectors of information. Though renewed on the
same perf-time control pass as K-variables, these array cells represent
a finer resolution of time by dividing the control period into sample periods
(<A HREF="./orches.html">see ksmps </A>). A-variables are
used to store and recall data changing at the audio sampling rate (e.g.
output signals of oscillators, filters, etc.).

<P>A further distinction is that between local and global variables. <B>local</B>
variables are private to a particular instrument, and cannot be read from
or written into by any other instrument. Their values are preserved, and
they may carry information from pass to pass (e.g. from initialization
time to performance time) within a single instrument. Local variable names
begin with the letter <B>p, i, k</B>, or <B>a</B>. The same local variable
name may appear in two or more different instrument blocks without conflict.

<P><B>global</B> variables are cells that are accessible by all instruments.
The names are either like local names preceded by the letter <B>g</B>,
or are special reserved symbols. Global variables are used for broadcasting
general values, for communicating between instruments (semaphores), or
for sending sound from one instrument to another (e.g. mixing prior to
reverberation).

<P>Given these distinctions, there are eight forms of local and global
variables :

<P><TT><B>type&nbsp;</B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<B>when renewable</B>&nbsp;&nbsp;&nbsp; <B>Local&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Global</B></TT>

<P><TT>reserved symbols&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
permanent&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
rsymbol</TT>
<BR><TT>score parameter fields&nbsp;&nbsp; I-time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<B>p</B>number&nbsp;&nbsp;&nbsp;&nbsp; --</TT>
<BR><TT>v-set symbols&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
I-time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<B>v</B>number&nbsp;&nbsp;&nbsp; <B>gv</B>number</TT>
<BR><TT>init variables&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
I-time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<B>i</B>name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>gi</B>name</TT>
<BR><TT>midi controllers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
any time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>c</B>number&nbsp;&nbsp;&nbsp;
--</TT>
<BR><TT>control signals&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
P-time, K-rate&nbsp;&nbsp;&nbsp; <B>k</B>name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<B>gk</B>name</TT>
<BR><TT>audio signals&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
P-time, A-rate&nbsp;&nbsp;&nbsp; <B>a</B>name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<B>ga</B>name</TT>
<BR><TT>spectral data types&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; K-rate&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<B>w</B>name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --</TT>
<BR>&nbsp;

<P>&nbsp;where rsymbol is a special reserved symbol (e.g.&nbsp; <B>sr,
kr</B>), number is a positive integer referring to a score pfield or sequence
number, and name is a string of letters and/or digits with local or global
meaning.&nbsp; As might be apparent, score parameters are local I-variables
whose values are copied from the invoking score statement just prior to
the Init pass through an instrument, while midi controllers are variables
which can be updated asynchronously from a midi file or midi device.
<BR>&nbsp;
<CENTER><P>
<HR></CENTER>


<P><CENTER>
<B><I><FONT COLOR="#006600">HTML Csound Manual - <FONT SIZE=-1>&copy;
Jean Pich&eacute; &amp; Peter J. Nix, 1994-97</FONT></FONT></I></B>&nbsp;
</CENTER>
</HTML>