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
|
<!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:50:05 2000 -->
<HEAD>
<TITLE>Tao User Manual -- Access Point Methods</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_84.html"><IMG ALT="Up" ALIGN=BOTTOM BORDER=0 SRC="up.gif"></A>
<BR><A HREF="UserManual_84.html">Object Method Reference</A><BR><IMG width="167" height="1" SRC="trans1x1.gif">
</td><td class="nav" valign="top"><A HREF="UserManual_99.html"><IMG ALT="Back" ALIGN=BOTTOM BORDER=0 SRC="back.gif"></A>
<BR><A HREF="UserManual_99.html">Output Methods</A><BR><IMG width="167" height="1" SRC="trans1x1.gif">
</td><td class="nav" valign="top"><A HREF="UserManual_101.html"><IMG ALT="Forward" ALIGN=BOTTOM BORDER=0 SRC="forward.gif"></A>
<BR><A HREF="UserManual_101.html">Pitch Methods</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>Access Point Methods</H2>
These methods are some of the most important since they are the
ones which allow simulated physical interaction with <B>Tao</B>'s
cellular material.
<P><PRE>
getPosition()
getVelocity()
getForce()
getInstrument()
applyForce(<force>)
clear()
</PRE>
<P>The <CODE>getPosition</CODE><A NAME="1">,</A> <CODE>getForce</CODE><A NAME="2"> and</A> <CODE>getVelocity</CODE><A NAME="3">
methods</A> return the physical attributes of the material at the access point.
All three values returned are with respect to the <I>z</I> axis of the material.
<P>The <CODE>getInstrument</CODE><A NAME="4"> method</A> returns the instrument on which the
access point is operating.
<P>The <CODE>applyForce</CODE><A NAME="5"> method</A> applies the given force at the position
of the access point, not surprisingly! Note that in the same way that an
access point can be used to read the physical attributes of the material at
any point, forces can be applied at any point too. This means that you
could for example generate a moving access point whose instrument coordinates
were governed by some time varying value generated by an arbitrary expression,
and apply a time varying force at that moving point.
<P>The following example illustrates the use of the access point methods
(although I don't know whether it would produce interesting sounds or not).
<P><PRE>
Audio rate: 44100;
String s(200 Hz, 20 secs);
AccessPoint p1, p2;
Param x1, x2;
Init:
s.lockEnds();
...
Score 10 secs:
x1=0.5+0.5*cos(Time*1000.0);
x2=0.5+0.5*cos(Time*1100.0);
p1=s(x1);
p2=s(x2);
Every 0.01 secs:
Print "At time ", Time, ", position=", p1.getPosition(),
" velocity=", p1.getVelocity(), newline;
...
If p1.getForce() < 1:
p2.applyForce(1.0);
...
If p2.getVelocity() > -1:
p1.applyForce(-1.0);
...
...
</PRE>
<P>Finally, the <CODE>clear</CODE><A NAME="6"> method</A> resets the access point to
be null. Attempting to read any physical attributes off of the
access point will result in zero being returned. In addition,
attempting to apply a force to a null access point has no effect.
<P>
<BR></td></tr><!-- end main text --><tr><td class="nav" align="left" valign="top"><!-- bottom matter --><A HREF="UserManual_84.html"><IMG ALT="Up" ALIGN=BOTTOM BORDER=0 SRC="up.gif"></A>
<BR><A HREF="UserManual_84.html">Object Method Reference</A><BR><IMG width="167" height="1" SRC="trans1x1.gif">
</td><td class="nav" align="left" valign="top"><A HREF="UserManual_99.html"><IMG ALT="Back" ALIGN=BOTTOM BORDER=0 SRC="back.gif"></A>
<BR><A HREF="UserManual_99.html">Output Methods</A><BR><IMG width="167" height="1" SRC="trans1x1.gif">
</td><td class="nav" align="left" valign="top"><!-- bottom matter --><A HREF="UserManual_101.html"><IMG ALT="Forward" ALIGN=BOTTOM BORDER=0 SRC="forward.gif"></A>
<BR><A HREF="UserManual_101.html">Pitch Methods</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>©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>
|