| 1 | |
| 2 | <refentry id="lorisread"> |
| 3 | <indexterm id="IndexLorisRead"><primary>lorisread</primary></indexterm> |
| 4 | <refentryinfo><title>Spectral Processing:Loris</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>lorisread</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | |
| 10 | |
| 11 | <refnamediv> |
| 12 | <refname>lorisread</refname> |
| 13 | <refpurpose>Imports a set of bandwidth-enhanced partials from a SDIF-format |
| 14 | data file, applying control-rate frequency, amplitude, and |
| 15 | bandwidth scaling envelopes, and stores the modified partials in |
| 16 | memory. |
| 17 | </refpurpose> |
| 18 | </refnamediv> |
| 19 | |
| 20 | <refsect1> |
| 21 | <title>Syntax</title> |
| 22 | <synopsis><command>lorisread</command> ktimpnt, ifilcod, istoreidx, kfreqenv, kampenv, kbwenv[, ifadetime]</synopsis> |
| 23 | </refsect1> |
| 24 | |
| 25 | <refsect1> |
| 26 | <title>Description</title> |
| 27 | <para>lorisread imports a set of bandwidth-enhanced partials from a SDIF-format data file, applying control-rate frequency, amplitude, and bandwidth scaling envelopes, and stores the modified partials in memory. |
| 28 | </para> |
| 29 | </refsect1> |
| 30 | |
| 31 | <refsect1> |
| 32 | <title>Initialization</title> |
| 33 | <para><emphasis>ifilcod </emphasis> - integer or character-string |
| 34 | denoting a control-file derived from reassigned bandwidth-enhanced |
| 35 | analysis of an audio signal. An integer denotes the suffix of a file |
| 36 | loris.sdif (e.g. loris.sdif.1); a character-string (in double quotes) |
| 37 | gives a filename, optionally a full pathname. If not a full pathname, the |
| 38 | file is sought first in the current directory, then in the one given |
| 39 | by the environment variable SADIR (if defined). The reassigned |
| 40 | bandwidth-enhanced data file contains breakpoint frequency, amplitude, |
| 41 | noisiness, and phase envelope values organized for bandwidth-enhanced |
| 42 | additive resynthesis. The control data must conform to one of the SDIF |
| 43 | formats that can be</para> |
| 44 | |
| 45 | <para>Loris stores partials in SDIF RBEP frames. Each RBEP frame |
| 46 | contains one RBEP matrix, and each row in a RBEP matrix describes one |
| 47 | breakpoint in a Loris partial. A RBEL frame containing one RBEL matrix |
| 48 | describing the labeling of the partials may precede the first RBEP |
| 49 | frame in the SDIF file. The RBEP and RBEL frame and matrix definitions |
| 50 | are included in the SDIF file's header. In addition to RBEP frames, |
| 51 | Loris can also read and write SDIF 1TRC frames. Since 1TRC frames do |
| 52 | not represent bandwidth-enhancement or the exact timing of Loris |
| 53 | breakpoints, their use is not recommended. 1TRC capabilities are |
| 54 | provided to allow interchange with programs that are unable to handle |
| 55 | RBEP frames.</para> |
| 56 | |
| 57 | <para><emphasis>istoreidx, ireadidx, isrcidx, itgtidx</emphasis> are |
| 58 | labels that identify a stored set of bandwidth-enhanced |
| 59 | partials. lorisread imports partials from a SDIF file and stores them |
| 60 | with the integer label istoreidx. lorismorph morphs sets of partials |
| 61 | labeled isrcidx and itgtidx, and stores the resulting partials with |
| 62 | the integer label istoreidx. lorisplay renders the partials stored |
| 63 | with the label ireadidx. The labels are used only at initialization |
| 64 | time, and may be reused without any cost or benefit in efficiency, and |
| 65 | without introducing any interaction between instruments or |
| 66 | instances.</para> |
| 67 | |
| 68 | <para><emphasis>ifadetime (optional)</emphasis> - In general, |
| 69 | partials exported from Loris begin and end at non-zero amplitude. In |
| 70 | order to prevent artifacts, it is very often necessary to fade the |
| 71 | partials in and out, instead of turning them abruptly on and |
| 72 | off. Specification of a non-zero ifadetime causes partials to fade in |
| 73 | at their onsets and to fade out at their terminations. This is |
| 74 | achieved by adding two more breakpoints to each partial: one ifadetime |
| 75 | seconds before the start time and another ifadetime seconds after the |
| 76 | end time. (However, no breakpoint will be introduced at a time less |
| 77 | than zero. If necessary, the onset fade time will be shortened.) The |
| 78 | additional breakpoints at the partial onset and termination will have |
| 79 | the same frequency and bandwidth as the first and last breakpoints in |
| 80 | the partial, respectively, but their amplitudes will be zero. The |
| 81 | phase of the new breakpoints will be extrapolated to preserve phase |
| 82 | correctness. If no value is specified, ifadetime defaults to |
| 83 | zero. Note that the fadetime may not be exact, since the partial |
| 84 | parameter envelopes are sampled at the control rate (krate) and |
| 85 | indexed by ktimpnt (see below), and not by real time.</para> |
| 86 | |
| 87 | </refsect1> |
| 88 | |
| 89 | <refsect1> |
| 90 | |
| 91 | <title>Performance</title> |
| 92 | |
| 93 | <para>lorisread reads pre-computed Reassigned Bandwidth-Enhanced |
| 94 | analysis data from a file stored in SDIF format, as described |
| 95 | above. The passage of time through this file is specified by ktimpnt, |
| 96 | which represents the time in seconds. ktimpnt must always be positive, |
| 97 | but can move forwards or backwards in time, be stationary or |
| 98 | discontinuous, as a pointer into the analysis file. kfreqenv is a |
| 99 | control-rate transposition factor: a value of 1 incurs no |
| 100 | transposition, 1.5 transposes up a perfect fifth, and .5 down an |
| 101 | octave. kampenv is a control-rate scale factor that is applied to all |
| 102 | partial amplitude envelopes. kbwenv is a control-rate scale factor |
| 103 | that is applied to all partial bandwidth or noisiness envelopes. The |
| 104 | bandwidth-enhanced partial data is stored in memory with a specified |
| 105 | label for future access by another generator.</para> |
| 106 | |
| 107 | </refsect1> |
| 108 | |
| 109 | <refsect1> |
| 110 | <title>Examples</title> |
| 111 | <para> |
| 112 | Here is an example of the lorisread opcode. It uses the file <ulink url="examples/lorisread.csd"><citetitle>lorisread.csd</citetitle></ulink>. |
| 113 | <example> |
| 114 | <title>Example of the lorisread opcode.</title> |
| 115 | <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> |
| 116 | <xi:include href="examples-xml/lorisread.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 117 | </example> |
| 118 | </para> |
| 119 | </refsect1> |
| 120 | |
| 121 | <refsect1> |
| 122 | |
| 123 | <title>Credits</title> |
| 124 | |
| 125 | <para>This implementation of the Loris unit generators was written by Kelly |
| 126 | Fitz (<ulink |
| 127 | url="mailto:[email protected]">[email protected]</ulink>). It is patterned after a prototype implementation of the |
| 128 | <emphasis>lorisplay</emphasis> unit generator written by Corbin Champion, and based on the |
| 129 | method of Bandwidth-Enhanced Additive Synthesis and on the sound |
| 130 | morphing algorithms implemented in the Loris library for sound |
| 131 | modeling and manipulation. The opcodes were further adapted as a |
| 132 | plugin for Csound 5 by Michael Gogins.</para> |
| 133 | |
| 134 | </refsect1> |
| 135 | |
| 136 | </refentry> |