summaryrefslogtreecommitdiff
path: root/opcodes/adsyn.xml
blob: c97f217ed10ab344b887224346e39f78f823042c (plain)
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
<refentry id="adsyn">
<indexterm id="IndexAdsyn"><primary>adsyn</primary></indexterm>
  <refentryinfo><title>Signal Generators:Additive Synthesis/Resynthesis</title></refentryinfo>
  <refmeta>
    <refentrytitle>adsyn</refentrytitle>
  </refmeta>


 
  <refnamediv>
    <refname>adsyn</refname>
    <refpurpose>
      Output is an additive set of individually controlled sinusoids, using an oscillator bank.
          </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Output is an additive set of individually controlled sinusoids, using an oscillator bank.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis>ares <command>adsyn</command> kamod, kfmod, ksmod, ifilcod</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>ifilcod</emphasis> --  integer or character-string denoting a control-file derived from analysis of an audio signal. An integer denotes the suffix of a file <emphasis>adsyn.m</emphasis> or <emphasis>pvoc.m</emphasis>; a character-string (in double quotes) gives a filename, optionally a full pathname. If not fullpath, the file is sought first in the current directory, then in the one given by the environment variable <link linkend="OrchDirFiles"><citetitle>SADIR</citetitle></link> (if defined). <emphasis>adsyn</emphasis> control contains breakpoint amplitude- and frequency-envelope values organized for oscillator resynthesis, while <emphasis>pvoc</emphasis> control contains similar data organized for fft resynthesis. Memory usage depends on the size of the files involved, which are read and held entirely in memory during computation but are shared by multiple calls (see also <link linkend="lpread"><citetitle>lpread</citetitle></link>).
    </para>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>kamod</emphasis> -- amplitude factor of the contributing partials.
    </para>

    <para>
      <emphasis>kfmod</emphasis> -- frequency factor of the contributing partials. It is a control-rate transposition factor: a value of 1 incurs no transposition, 1.5 transposes up a perfect fifth, and .5 down an octave.
    </para>

    <para>
      <emphasis>ksmod</emphasis> -- speed factor of the contributing partials.
    </para>

    <para>
      <emphasis>adsyn</emphasis> synthesizes complex time-varying timbres through the method of additive synthesis. Any number of sinusoids, each individually controlled in frequency and amplitude, can be summed by high-speed arithmetic to produce a high-fidelity result.
    </para>

    <para>
      Component sinusoids are described by a control file describing amplitude and frequency tracks in millisecond breakpoint fashion. Tracks are defined by sequences of 16-bit binary integers:
      <literallayout>
-1, time, amp, time, amp,... 
-2, time, freq, time, freq,...
      </literallayout>
      such as from hetrodyne filter analysis of an audio file. (For details see <link linkend="hetro"><citetitle>hetro</citetitle></link>.) The instantaneous amplitude and frequency values are used by an internal fixed-point oscillator that adds each active partial into an accumulated output signal. While there is a practical limit (limit removed in version 3.47) on the number of contributing partials, there is no restriction on their behavior over time. Any sound that can be described in terms of the behavior of sinusoids can be synthesized by <emphasis>adsyn</emphasis> alone.
    </para>

    <para>
      Sound described by an <emphasis>adsyn</emphasis> control file can also be modified during re-synthesis. The signals <emphasis>kamod,</emphasis> <emphasis>kfmod</emphasis>, <emphasis>ksmod</emphasis> will modify the amplitude, frequency, and speed of contributing partials. These are multiplying factors, with <emphasis>kfmod</emphasis> modifying the frequency and <emphasis>ksmod</emphasis> modifying the <emphasis>speed</emphasis> with which the millisecond breakpoint line-segments are traversed. Thus .7, 1.5, and 2 will give rise to a softer sound, a perfect fifth higher, but only half as long. The values 1,1,1 will leave the sound unmodified. Each of these inputs can be a control signal.
    </para>
  </refsect1>

  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the adsyn opcode. It uses the file <ulink url="examples/adsyn.csd"><citetitle>adsyn.csd</citetitle></ulink>, and <ulink url="examples/kickroll.het"><citetitle>kickroll.het</citetitle></ulink>. The file <quote>kickroll.het</quote> was created by using the <link linkend="hetro"><citetitle>hetro</citetitle></link> utility with the audio file <ulink url="examples/kickroll.wav"><citetitle>kickroll.wav</citetitle></ulink>.

      <example>
        <title>Example of the adsyn opcode.</title>
        

        <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>
          <xi:include href="examples-xml/adsyn.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
      </example>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>Example written by &namekevin;.</para>
  </refsect1>
</refentry>