| 1 | |
| 2 | <refentry id="prepiano"> |
| 3 | <indexterm id="IndexPrepiano"><primary>prepiano</primary></indexterm> |
| 4 | <refentryinfo><title>Signal Generators:Models and Emulations</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>prepiano</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>prepiano</refname> |
| 11 | <refpurpose> |
| 12 | Creates a tone similar to a piano string prepared in a Cageian fashion. |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para> |
| 19 | Audio output is a tone similar to a piano string, prepared with |
| 20 | a number of rubbers and rattles. The method uses a |
| 21 | physical model developed from solving the partial differential |
| 22 | equation. |
| 23 | </para> |
| 24 | </refsect1> |
| 25 | |
| 26 | <refsect1> |
| 27 | <title>Syntax</title> |
| 28 | <synopsis>ares <command>prepiano</command> ifreq, iNS, iD, iK, \ |
| 29 | iT30,iB, kbcl, kbcr, imass, ihvfreq, iinit, ipos, ivel, isfreq, \ |
| 30 | isspread[, irattles, irubbers]</synopsis> |
| 31 | <synopsis>al,ar <command>prepiano</command> ifreq, iNS, iD, iK, \ |
| 32 | iT30,iB, kbcl, kbcr, imass, ihvfreq, iinit, ipos, ivel, isfreq, \ |
| 33 | isspread[, irattles, irubbers]</synopsis> |
| 34 | </refsect1> |
| 35 | |
| 36 | <refsect1> |
| 37 | <title>Initialization</title> |
| 38 | |
| 39 | <para> |
| 40 | <emphasis>ifreq</emphasis> -- The base frequency of the string. |
| 41 | </para> |
| 42 | |
| 43 | <para> |
| 44 | <emphasis>iNS</emphasis> -- the number of strings involved. In a |
| 45 | real piano 1, 2 or 3 strings are found in different frequency regions. |
| 46 | </para> |
| 47 | |
| 48 | <para> |
| 49 | <emphasis>iD</emphasis> -- the amount each string other that the |
| 50 | first is detuned from the main frequency, measured in cents. |
| 51 | </para> |
| 52 | |
| 53 | <para> |
| 54 | <emphasis>iK</emphasis> -- dimensionless stiffness parameter. |
| 55 | </para> |
| 56 | |
| 57 | <para> |
| 58 | <emphasis>iT30</emphasis> -- 30 db decay time in seconds. |
| 59 | </para> |
| 60 | |
| 61 | <para> |
| 62 | <emphasis>ib</emphasis> -- high-frequency loss parameter (keep this small). |
| 63 | </para> |
| 64 | |
| 65 | <para> |
| 66 | <emphasis>imass</emphasis> -- the mass of the piano hammer. |
| 67 | </para> |
| 68 | |
| 69 | <para> |
| 70 | <emphasis>ihvfreq</emphasis> -- the frequency of the natural |
| 71 | vibrations of the hammer. |
| 72 | </para> |
| 73 | |
| 74 | <para> |
| 75 | <emphasis>iinit</emphasis> -- the initial position of the hammer. |
| 76 | </para> |
| 77 | |
| 78 | <para> |
| 79 | <emphasis>ipos</emphasis> -- position along the string that the strike occurs. |
| 80 | </para> |
| 81 | |
| 82 | <para> |
| 83 | <emphasis>ivel</emphasis> -- normalized strike velocity. |
| 84 | </para> |
| 85 | |
| 86 | <para> |
| 87 | <emphasis>isfreq</emphasis> -- scanning frequency of the reading place. |
| 88 | </para> |
| 89 | |
| 90 | <para> |
| 91 | <emphasis>isspread</emphasis> -- scanning frequency spread. |
| 92 | </para> |
| 93 | |
| 94 | <para> |
| 95 | <emphasis>irattles</emphasis> -- table number giving locations of |
| 96 | any rattle(s). |
| 97 | </para> |
| 98 | |
| 99 | <para> |
| 100 | <emphasis>irubbers</emphasis> -- table number giving locations of |
| 101 | any rubbers(s). |
| 102 | </para> |
| 103 | |
| 104 | <para> |
| 105 | The rattles and rubbers tables are collections of four values, |
| 106 | preceeded by a count. |
| 107 | In the case of a rattle the four are position, mass density |
| 108 | ratio of rattle/string, |
| 109 | frequency of rattle and vertical length of the rattle. For the |
| 110 | rubber the fours are position, mass density ratio of |
| 111 | rubber/string, frequency of rubber and the loss parameter. |
| 112 | </para> |
| 113 | </refsect1> |
| 114 | |
| 115 | <refsect1> |
| 116 | <title>Performance</title> |
| 117 | <para> |
| 118 | A note is played on a piano string, with the arguments as below. |
| 119 | </para> |
| 120 | |
| 121 | <para> |
| 122 | <emphasis>kbcL</emphasis> -- Boundary condition at left end of |
| 123 | string (1 is clamped, 2 pivoting and 3 free). |
| 124 | </para> |
| 125 | |
| 126 | <para> |
| 127 | <emphasis>kbcR</emphasis> -- Boundary condition at right end of |
| 128 | string (1 is clamped, 2 pivoting and 3 free). |
| 129 | </para> |
| 130 | |
| 131 | <para> |
| 132 | Note that changing the boundary conditions during playing may |
| 133 | lead to glitches and is made available as an experiment. |
| 134 | </para> |
| 135 | </refsect1> |
| 136 | |
| 137 | <refsect1> |
| 138 | <title>Examples</title> |
| 139 | <para> |
| 140 | Here is an example of the prepiano opcode. It uses the file <ulink url="examples/prepiano.csd"><citetitle>prepiano.csd</citetitle></ulink>. |
| 141 | |
| 142 | <example> |
| 143 | <title>Example of the prepiano opcode.</title> |
| 144 | |
| 145 | |
| 146 | |
| 147 | <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> |
| 148 | <xi:include href="examples-xml/prepiano.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 149 | </example> |
| 150 | </para> |
| 151 | </refsect1> |
| 152 | |
| 153 | <refsect1> |
| 154 | <title>See Also</title> |
| 155 | <para> |
| 156 | <link linkend="SiggenModels"><citetitle>Models and Emulations</citetitle></link> |
| 157 | </para> |
| 158 | </refsect1> |
| 159 | |
| 160 | <refsect1> |
| 161 | <title>Credits</title> |
| 162 | <para> |
| 163 | <simplelist> |
| 164 | <member>Author: Stefan Bilbao </member> |
| 165 | <member>University of Edinburgh, UK</member> |
| 166 | <member>Author: &namejohn; </member> |
| 167 | <member>University of Bath, Codemist Ltd.</member> |
| 168 | <member>Bath, UK</member> |
| 169 | </simplelist> |
| 170 | </para> |
| 171 | |
| 172 | <para>New in Csound version 5.05</para> |
| 173 | </refsect1> |
| 174 | </refentry> |