File: UserManual_56.html

package info (click to toggle)
taopm 1.0-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 6,972 kB
  • sloc: sh: 9,809; cpp: 5,161; yacc: 2,298; lex: 464; makefile: 434; ansic: 57
file content (73 lines) | stat: -rwxr-xr-x 4,884 bytes parent folder | download | duplicates (3)
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<!-- HTML file produced from file: UserManual.tex --
 -- using Hyperlatex v 2.3.1 (c) Otfried Cheong--
 -- on Emacs 21.1 (patch 4) "Arches" XEmacs Lucid, Sun Apr 30 20:49:59 2000 -->
<HEAD>
<TITLE>Tao User Manual -- Control Structures</TITLE>

    <link rel=stylesheet href="../../taomanual.css" type="text/css">
    
</HEAD><BODY BACKGROUND="bg.gif">

    <table width="500" border="0" align="left" cellspacing="2" cellpadding="2"><tr><td class="nav" valign="top"><!-- top panel --><A HREF="UserManual_46.html"><IMG ALT="Up" ALIGN=BOTTOM BORDER=0 SRC="up.gif"></A>
    <BR><A HREF="UserManual_46.html"><B>Tao</B>'s Synthesis Language in Detail</A><BR><IMG width="167" height="1" SRC="trans1x1.gif">
    </td><td class="nav" valign="top"><A HREF="UserManual_55.html"><IMG ALT="Back" ALIGN=BOTTOM BORDER=0 SRC="back.gif"></A>
    <BR><A HREF="UserManual_55.html">The Score Section</A><BR><IMG width="167" height="1" SRC="trans1x1.gif">
    </td><td class="nav" valign="top"><A HREF="UserManual_57.html"><IMG ALT="Forward" ALIGN=BOTTOM BORDER=0 SRC="forward.gif"></A>
    <BR><A HREF="UserManual_57.html">At</A><BR><IMG width="167" height="1" SRC="trans1x1.gif">
    </td></tr><!-- end top panel --><tr><td colspan="3" class="main"><!-- main text --><br><br>
<H2>Control Structures</H2>

<B>Tao</B>'s score language provide a set of constructs for scheduling events
in a performance. These are referred to as <EM>control structures</EM><A NAME="1">
and</A> include the following:
<P><PRE>
    At &lt;t&gt;: &lt;body&gt; ...
    At &lt;t1&gt; for &lt;t2&gt;: &lt;body&gt; ...
    From &lt;t1&gt; to &lt;t2&gt;: &lt;body&gt; ...
    Before &lt;t&gt;: &lt;body&gt; ...
    After &lt;t&gt;: &lt;body&gt; ...
    ControlRate &lt;k&gt;: &lt;body&gt; ...
    Every &lt;t&gt;: &lt;body&gt; ...
</PRE>
<P>In each case <CODE>&lt;body&gt;</CODE> is the code which is to be executed at
the scheduled time. In the case of <CODE>At</CODE><A NAME="2"> the</A> code is executed once
at the given time <CODE>&lt;t&gt;</CODE>. For <CODE>At..for</CODE><A NAME="3"> and</A> <CODE>From..to</CODE><A NAME="4"> the</A>
<CODE>&lt;body&gt;</CODE> is executed on every tick in the interval defined by
<CODE>&lt;t1&gt;</CODE> and <CODE>&lt;t2&gt;</CODE>.
<P><CODE>Before</CODE><A NAME="5"> and</A> <CODE>After</CODE><A NAME="6"> also</A> define time intervals during which the
<CODE>&lt;body&gt;</CODE> is executed on every tick but the behaviour is slightly more
context dependent as we will see later in this section. For
<CODE>ControlRate</CODE><A NAME="7"> the</A> code is executed on every <CODE>&lt;k&gt;</CODE>'th tick and
finally, for <CODE>Every</CODE><A NAME="8"> the</A> code is executed repeatedly once every
<CODE>&lt;t&gt;</CODE> seconds (other units can be specified).
<P>In each of the control structures introduced above there is a <EM>head</EM><A NAME="9">
part</A> which determines when the <EM>body</EM><A NAME="10"> will</A> be executed. For most of
the control structures the head consists of some sort of test to see what
the value of the system variable <CODE>Time</CODE> is compared to the
given values. This variable keeps track of the amount of sound synthesised
so far - i.e. <EM>performance-time</EM><A NAME="11"> -</A> not real-time.
If the particular condition specified is met then the body of the control
structure is executed.
<P>What follows is a more detailed look at the syntax and behaviour of
the various control structures.
<P><MENU>
<LI><A HREF="UserManual_57.html">At</A>
<LI><A HREF="UserManual_58.html">At..for</A>
<LI><A HREF="UserManual_59.html">From..to</A>
<LI><A HREF="UserManual_60.html">Every</A>
<LI><A HREF="UserManual_61.html">ControlRate</A>
</MENU>

    <BR></td></tr><!-- end main text --><tr><td class="nav" align="left" valign="top"><!-- bottom matter --><A HREF="UserManual_46.html"><IMG ALT="Up" ALIGN=BOTTOM BORDER=0 SRC="up.gif"></A>
    <BR><A HREF="UserManual_46.html"><B>Tao</B>'s Synthesis Language in Detail</A><BR><IMG width="167" height="1" SRC="trans1x1.gif">
    </td><td class="nav" align="left" valign="top"><A HREF="UserManual_55.html"><IMG ALT="Back" ALIGN=BOTTOM BORDER=0 SRC="back.gif"></A>
    <BR><A HREF="UserManual_55.html">The Score Section</A><BR><IMG width="167" height="1" SRC="trans1x1.gif">
    </td><td class="nav" align="left" valign="top"><!-- bottom matter --><A HREF="UserManual_57.html"><IMG ALT="Forward" ALIGN=BOTTOM BORDER=0 SRC="forward.gif"></A>
    <BR><A HREF="UserManual_57.html">At</A>
    <IMG width="167" height="1" SRC="trans1x1.gif">
    </td></tr><!-- end bottom matter -->

    <tr><td colspan="3" class="addr"><!-- bottom panel --><ADDRESS><FONT SIZE=-1>&#169;1999,2000 Mark Pearson
<A HREF="mailto:m.pearson@ukonline.co.uk">m.pearson@ukonline.co.uk</A> April 30, 2000</ADDRESS><BR></td></tr><!-- end bottom panel --></table></BODY></HTML>