| 1 | |
| 2 | <section id="ScoreMult"> |
| 3 | <title>Multiple File Score</title> |
| 4 | |
| 5 | <simplesect> |
| 6 | <title>Description</title> |
| 7 | <para> |
| 8 | Using the score in more than one file. |
| 9 | </para> |
| 10 | </simplesect> |
| 11 | |
| 12 | <simplesect> |
| 13 | <title>Syntax</title> |
| 14 | <synopsis><command>#include</command> "filename"</synopsis> |
| 15 | <synopsis><command>#includestr</command> "filename"</synopsis> |
| 16 | </simplesect> |
| 17 | |
| 18 | <simplesect> |
| 19 | <title>Performance</title> |
| 20 | <para> |
| 21 | It is sometimes convenient to have the score in more than one file. This use is supported by the <emphasis>#include</emphasis> facility which is part of the macro system. A line containing the text |
| 22 | |
| 23 | <indexterm id="IndexIncludeScore"><primary>#include</primary><secondary>score</secondary></indexterm> |
| 24 | <indexterm id="IndexMultiFileScore"><primary>multiple file scores</primary></indexterm> |
| 25 | |
| 26 | <informalexample> |
| 27 | <programlisting> |
| 28 | <emphasis>#include</emphasis> "filename"</programlisting> |
| 29 | </informalexample> |
| 30 | |
| 31 | where the character <emphasis>"</emphasis> can be replaced |
| 32 | by any suitable character. For most uses the double quote |
| 33 | symbol will probably be the most convenient. The file name can |
| 34 | include a full path. |
| 35 | </para> |
| 36 | |
| 37 | <para> |
| 38 | This takes input from the named file until it ends, when input |
| 39 | reverts to the previous input. There is currently a limit of 20 |
| 40 | on the depth of included files and macros. |
| 41 | </para> |
| 42 | |
| 43 | <para> |
| 44 | A suggested use of <emphasis>#include</emphasis> would be to |
| 45 | define a set of macros which are part of the composer's style. |
| 46 | It could also be used to provide repeated sections. |
| 47 | |
| 48 | <informalexample> |
| 49 | <programlisting> |
| 50 | <emphasis role="stamnt">s</emphasis> |
| 51 | #include :section1: |
| 52 | <emphasis role="comment">;; Repeat that</emphasis> |
| 53 | <emphasis role="stamnt">s</emphasis> |
| 54 | #include :section1:</programlisting> |
| 55 | </informalexample> |
| 56 | </para> |
| 57 | |
| 58 | <para> |
| 59 | Alternative methods of doing repeats, use the <link linkend="r"><citetitle>r statement</citetitle></link>, <link linkend="m"><citetitle>m statement</citetitle></link>, and <link linkend="n"><citetitle>n statement</citetitle></link>. |
| 60 | </para> |
| 61 | </simplesect> |
| 62 | |
| 63 | <simplesect> |
| 64 | <para> |
| 65 | The form <emphasis>#includestr</emphasis> is the same as #include |
| 66 | except the deliminator must be a double quote and the file name |
| 67 | may contain macro calls. |
| 68 | </para> |
| 69 | </simplesect> |
| 70 | |
| 71 | <simplesect> |
| 72 | <title>Credits</title> |
| 73 | <para>Author: &namejohn;</para> |
| 74 | <para>University of Bath/Codemist Ltd.</para> |
| 75 | <para>Bath, UK</para> |
| 76 | <para>April, 1998 (New in Csound version 3.48)</para> |
| 77 | <para>Thanks to &nameluis; for pointing out the incorrect syntax |
| 78 | in multiple file include statement.</para> |
| 79 | <para>#includestr new in version 6.12</para> |
| 80 | </simplesect> |
| 81 | </section> |