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
|
<HTML>
<TITLE>P-FIELDS</TITLE>
<CENTER><P><A NAME="P-Fields"></A>
<HR><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="./TUTORIALS.html">Top of this section</A></B> - <A HREF="./note.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="./envel.html">Next</A>
<HR></P></CENTER>
<H2>Toot 2: "P-Fields"</H2>
<P>The first instrument was not interesting because it could play only
one note at one amplitude level. We can make things more interesting by
allowing the pitch and amplitude to be defined by parameters in the score.
Each column in the score constitutes a <A HREF="./../Syntax/nomen.html">parameter
field</A>, numbered from the left. The first three parameter fields of
the <B><A HREF="./../NumScore/i-stat.html">i-statement</A> </B>have
a reserved function:</P>
<PRE><TT> p1 = instrument number
p2 = start time
p3 = duration</TT>
</PRE>
<P>All other parameter fields are determined by the way the sound designer
defines his instrument. In the instrument below, the oscillator's amplitude
argument is replaced by p4 and the frequency argument by p5. Now we can
change these values at i-time, i.e. with each note in the score. The orchestra
and score files now look like:</P>
<PRE><TT> instr 2
a1 oscil p4, p5, 1 ; p4=amp
out a1 ; p5=freq
endin
f1 0 4096 10 1 ; sine wave
; instrument start duration amp(p4) freq(p5)
i2 0 1 2000 880
i2 1.5 1 4000 440
i2 3 1 8000 220
i2 4.5 1 16000 110
i2 6 1 32000 55
e</TT>
</PRE>
<CENTER><P>
<HR><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="./TUTORIALS.html">Top of this section</A></B> - <A HREF="./note.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="./envel.html">Next</A>
<HR></P></CENTER>
<P><CENTER>
<B><I><FONT COLOR="#006600">HTML Csound Manual - <FONT SIZE=-1>©
Jean Piché & Peter J. Nix, 1994-97</FONT></FONT></I></B>
</CENTER>
</HTML>
|