File: xtratim.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 (83 lines) | stat: -rw-r--r-- 3,132 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
<HTML>
<TITLE>XTRATIM</TITLE>
<CENTER><A NAME="xtratim"></A>
<HR><B><A HREF="../REFER.html">QUICK-REF</A></B> - <B><A HREF="../TITLE.html"><FONT SIZE=+1>C</FONT>soundManual</A>
- <A HREF="CONVERTERS.html">Top of this section</A></B> - <A HREF="./mclock.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="./ion.html">Next</A>&nbsp;
<HR></CENTER>

<H2>
xtratim, release</H2>

<PRE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>xtratim</B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; iextradur
&nbsp;&nbsp; kflag&nbsp;&nbsp; <B>release</B></PRE>

<HR>
<H4>
<U>DESCRIPTION</U></H4>
Extend the duration of realtime generated events and handle their extra
life (see also linenr).
<H4>
<U>INITIALIZATION</U></H4>
<I>iextradur</I> - additional duration of current instrument instance
<H4>
<U>PERFORMANCE</U></H4>
<B>xtratim</B> exetends current MIDI-activated note duration of <I>iextradur</I>
seconds after the corresponding note-off message has deactivated current
note itself. This opcode has no output arguments.

<P><B>release</B> outputs current note state. If current note is in the
<B>release</B> stage (i.e. if its duration has been exetended with <B>xtratim</B>
opcode and if it has only just deactivated), kflag output argument is set
to 1, else (in sustain stage of current note) is set to 0. These two opcodes
are useful for implementing complex release-oriented envelopes.
<H4>
<U>EXAMPLE:</U></H4>

<PRE>&nbsp; instr 1 ;allows complex ADSR envelope with MIDI events
&nbsp;&nbsp; inum <B>notnum
</B>&nbsp;&nbsp; icps <B>cpsmidi
</B>&nbsp;&nbsp; iamp <B>ampmidi</B> 4000
&nbsp;&nbsp; ;
&nbsp;&nbsp; ;------- complex envelope block ------
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>xtratim</B> 1 ;extra-time, i.e. release dur
&nbsp;&nbsp; krel <B>init</B> 0
&nbsp;&nbsp; krel <B>release</B> ;outputs release-stage flag (0 or 1 values)
&nbsp;&nbsp; if (krel > .5) kgoto rel ;if in relase-stage goto relase section
&nbsp;&nbsp; ;
&nbsp;&nbsp; ;************ attack and sustain section ***********
&nbsp;&nbsp; kmp1 <B>linseg</B> 0, .03, 1, .05, 1, .07, 0, .08, .5, 4, 1, 50, 1&nbsp;
&nbsp;&nbsp; kmp = kmp1*iamp
&nbsp;&nbsp;&nbsp; kgoto done
&nbsp;&nbsp; ;
&nbsp;&nbsp; ;--------- <B>release</B> section --------
&nbsp;&nbsp; rel:
&nbsp;&nbsp; kmp2 <B>linseg</B> 1, .3, .2, .7, 0&nbsp;
&nbsp;&nbsp; kmp = kmp1*kmp2*iamp
&nbsp;&nbsp; done:
&nbsp;&nbsp; ;------
&nbsp;&nbsp; ;
&nbsp;&nbsp; a1 <B>oscili</B> kmp, icps, 1
&nbsp;&nbsp;&nbsp; <B>out</B> a1
&nbsp; endin</PRE>

<H4>
<U>AUTHOR:</U></H4>
Gabriel Maldonado
<BR>Italy
<BR>May 1997
<CENTER><P>
<HR><B><A HREF="../REFER.html">QUICK-REF</A></B> - <B><A HREF="../TITLE.html"><FONT SIZE=+1>C</FONT>soundManual</A>
- <A HREF="CONVERTERS.html">Top of this section</A></B> - <A HREF="./mclock.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="./ion.html">Next</A>&nbsp;
<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>