Debian Codegraph @

opcodes/distort1.xml

raw symbols SCIP
1
2 <refentry id="distort1">
3 <indexterm id="IndexDistort1"><primary>distort1</primary></indexterm>
4 <refentryinfo><title>Signal Modifiers:Special Effects</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>distort1</refentrytitle>
7 </refmeta>
8
9
10
11 <refnamediv>
12 <refname>distort1</refname>
13 <refpurpose>
14 Modified hyperbolic tangent distortion.
15 </refpurpose>
16 </refnamediv>
17
18 <refsect1>
19 <title>Description</title>
20 <para>
21 Implementation of modified hyperbolic tangent distortion. <emphasis>distort1</emphasis> can be used to generate wave shaping distortion based on a modification of the <link linkend="tanh"><citetitle>tanh</citetitle></link> function.
22 </para>
23
24 <para>
25 <literallayout>
26 exp(asig * (shape1 + pregain)) - exp(asig * (shape2 - pregain))
27 aout = ---------------------------------------------------------------
28 exp(asig * pregain) + exp(-asig * pregain)
29 </literallayout>
30 </para>
31 </refsect1>
32
33 <refsect1>
34 <title>Syntax</title>
35 <synopsis>ares <command>distort1</command> asig, kpregain, kpostgain, kshape1, kshape2[, imode]</synopsis>
36 </refsect1>
37
38 <refsect1>
39 <title>Initialization</title>
40 <para>
41 <emphasis>imode</emphasis> (Csound version 5.00 and later only; optional, defaults to 0) -- scales kpregain, kpostgain, kshape1, and kshape2 for use with audio signals in the range -32768 to 32768 (imode=0), -0dbfs to 0dbfs (imode=1), or disables scaling of kpregain and kpostgain and scales kshape1 by kpregain and kshape2 by -kpregain (imode=2).
42 </para>
43 </refsect1>
44
45 <refsect1>
46 <title>Performance</title>
47 <para>
48 <emphasis>asig</emphasis> -- is the input signal.
49 </para>
50
51 <para>
52 <emphasis>kpregain</emphasis> -- determines the amount of gain applied to the signal before waveshaping. A value of 1 gives slight distortion.
53 </para>
54
55 <para>
56 <emphasis>kpostgain</emphasis> -- determines the amount of gain applied to the signal after waveshaping.
57 </para>
58
59 <para>
60 <emphasis>kshape1</emphasis> -- determines the shape of the positive part of the curve. A value of 0 gives a flat clip, small positive values give sloped shaping.
61 </para>
62
63 <para>
64 <emphasis>kshape2</emphasis> -- determines the shape of the negative part of the curve.
65 </para>
66 </refsect1>
67
68 <refsect1>
69 <title>Examples</title>
70 <para>
71 Here is an example of the distort1 opcode. It uses the file <ulink url="examples/distort1.csd"><citetitle>distort1.csd</citetitle></ulink>.
72
73 <example>
74 <title>Example of the distort1 opcode.</title>
75
76
77
78 <para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para>
79 <xi:include href="examples-xml/distort1.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
80 </example>
81 </para>
82 </refsect1>
83
84 <refsect1>
85 <title>See also</title>
86 <para><link linkend="SigmodSpeciale"><citetitle>Special Effects</citetitle></link></para>
87 <para><link linkend="SigmodWavshape"><citetitle>Waveshaping</citetitle></link></para>
88 </refsect1>
89
90 <refsect1>
91 <title>Credits</title>
92 <para>
93 <simplelist>
94 <member>Author: &namehans;</member>
95 <member>December 1998</member>
96 </simplelist>
97 </para>
98
99 <para>New in Csound version 3.50</para>
100 </refsect1>
101 </refentry>