Debian Codegraph @

opcodes/sfinstrm.xml

raw symbols SCIP
1
2 <refentry id="sfinstrm">
3 <indexterm id="IndexSfinstrm"><primary>sfinstrm</primary></indexterm>
4 <refentryinfo><title>Signal Generators:Sample Playback</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>sfinstrm</refentrytitle>
7 </refmeta>
8
9 <refnamediv>
10 <refname>sfinstrm</refname>
11 <refpurpose>
12 Plays a SoundFont2 (SF2) sample instrument, generating a mono sound.
13 </refpurpose>
14 </refnamediv>
15
16 <refsect1>
17 <title>Description</title>
18 <para>
19 Plays a SoundFont2 (SF2) sample instrument, generating a mono sound. These opcodes allow management the sample-structure of SF2 files. In order to understand the usage of these opcodes, the user must have some knowledge of the SF2 format, so a brief description of this format can be found in the <link linkend="SiggenSample"><citetitle>SoundFont2 File Format</citetitle></link> section.
20 </para>
21 </refsect1>
22
23 <refsect1>
24 <title>Syntax</title>
25 <synopsis>ares <command>sfinstrm</command> ivel, inotenum, xamp, xfreq, instrnum, ifilhandle \
26 [, iflag] [, ioffset]</synopsis>
27 </refsect1>
28
29 <refsect1>
30 <title>Initialization</title>
31 <para>
32 <emphasis>ivel</emphasis> -- velocity value
33 </para>
34
35 <para>
36 <emphasis>inotenum</emphasis> -- MIDI note number value
37 </para>
38
39 <para>
40 <emphasis>instrnum</emphasis> -- number of an instrument of a SF2 file.
41 </para>
42
43 <para>
44 <emphasis>ifilhandle</emphasis> -- unique number generated by <emphasis>sfload</emphasis> opcode to be used as an identifier for a SF2 file. Several SF2 files can be loaded and activated at the same time.
45 </para>
46
47 <para>
48 <emphasis>iflag</emphasis> (optional) -- flag regarding the behavior of <emphasis>xfreq</emphasis> and <emphasis>inotenum</emphasis>
49 </para>
50
51 <para>
52 <emphasis>ioffset</emphasis> (optional) -- start playing at offset, in samples.
53 </para>
54 </refsect1>
55
56 <refsect1>
57 <title>Performance</title>
58 <para>
59 <emphasis>xamp</emphasis> -- amplitude correction factor
60 </para>
61
62 <para>
63 <emphasis>xfreq</emphasis> -- frequency value or frequency multiplier, depending by <emphasis>iflag</emphasis>. When <emphasis>iflag</emphasis> = 0, <emphasis>xfreq</emphasis> is a multiplier of a the default frequency, assigned by SF2 preset to the <emphasis>inotenum</emphasis> value. When <emphasis>iflag</emphasis> = 1, <emphasis>xfreq</emphasis> is the absolute frequency of the output sound, in Hz. Default is 0.
64 </para>
65
66 <para>
67 When <emphasis>iflag</emphasis> = 0, <emphasis>inotenum</emphasis> sets the frequency of the output according to the MIDI note number used, and <emphasis>xfreq</emphasis> is used as a multiplier. When <emphasis>iflag</emphasis> = 1, the frequency of the output, is set directly by <emphasis>xfreq</emphasis>. This allows the user to use any kind of micro-tuning based scales. However, this method is designed to work correctly only with presets tuned to the default equal temperament. Attempts to use this method with a preset already having non-standard tunings, or with drum-kit-based presets, could give unexpected results.
68 </para>
69
70 <para>
71 Adjustment of the amplitude can be done by varying the <emphasis>xamp</emphasis> argument, which acts as
72 a multiplier.
73 </para>
74
75 <para>
76 The <emphasis>ioffset</emphasis> parameter allows the sound to start from a sample different than the first one. The user should make sure that its value is within the length of the specific sound. Otherwise, Csound will probably crash.
77 </para>
78
79 <para>
80 <emphasis>sfinstrm</emphasis> is a mono version of <link linkend="sfinstr"><citetitle>sfinstr</citetitle></link>. This is the fastest opcode of the SF2 family.
81 </para>
82
83 <para>
84 These opcodes only support the sample structure of SF2 files. The modulator structure of the SoundFont2 format is not supported in Csound. Any modulation or processing to the sample data is left to the Csound user, bypassing all restrictions forced by the SF2 standard.
85 </para>
86 </refsect1>
87
88 <refsect1>
89 <title>Examples</title>
90 <para>
91 See the example for <link linkend="sfinstr"><citetitle>sfinstr</citetitle></link>.
92 </para>
93 </refsect1>
94
95 <refsect1>
96 <title>See also</title>
97 <para><link linkend="SiggenSample"><citetitle>Soundfonts</citetitle></link></para>
98 <para> More information on soundfonts is in the Floss Manuals: <ulink url="https://flossmanual.csound.com/midi/reading-midi-files"><citetitle>https://flossmanual.csound.com/midi/reading-midi-files</citetitle></ulink></para>
99 <para> For other information on soundfonts look in the Wikipedia: <ulink url="http://en.wikipedia.org/wiki/Soundfont"><citetitle>http://en.wikipedia.org/wiki/Soundfont</citetitle></ulink></para>
100 </refsect1>
101
102 <refsect1>
103 <title>Credits</title>
104 <para>
105 <simplelist>
106 <member>Author: &namegabriel;</member>
107 <member>Italy</member>
108 <member>May 2000</member>
109 </simplelist>
110 </para>
111
112 <para>New in Csound Version 4.07</para>
113 </refsect1>
114 </refentry>