-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsfont_8h.html
More file actions
211 lines (198 loc) · 17.2 KB
/
sfont_8h.html
File metadata and controls
211 lines (198 loc) · 17.2 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libfluidsynth: sfont.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">libfluidsynth
 <span id="projectnumber">1.1.11</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_e9d22631e23def53df9d7c08c7c6097f.html">fluidsynth</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Data Structures</a> |
<a href="#define-members">Macros</a> |
<a href="#enum-members">Enumerations</a> </div>
<div class="headertitle">
<div class="title">sfont.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>SoundFont plugins.
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fluid__sfloader__t.html">_fluid_sfloader_t</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">SoundFont loader structure. <a href="struct__fluid__sfloader__t.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fluid__sfont__t.html">_fluid_sfont_t</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Virtual SoundFont instance structure. <a href="struct__fluid__sfont__t.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fluid__preset__t.html">_fluid_preset_t</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Virtual SoundFont preset. <a href="struct__fluid__preset__t.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fluid__sample__t.html">_fluid_sample_t</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Virtual SoundFont sample. <a href="struct__fluid__sample__t.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a0b95cae7587539906dec2602ac29b743"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sfont_8h.html#a0b95cae7587539906dec2602ac29b743">fluid_sample_refcount</a>(_sample)   ((_sample)->refcount)</td></tr>
<tr class="memdesc:a0b95cae7587539906dec2602ac29b743"><td class="mdescLeft"> </td><td class="mdescRight">Get the reference count of a sample. <a href="#a0b95cae7587539906dec2602ac29b743">More...</a><br /></td></tr>
<tr class="separator:a0b95cae7587539906dec2602ac29b743"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a501aa3c84a31b590891c0e080681895f"><td class="memItemLeft" align="right" valign="top"><a id="a501aa3c84a31b590891c0e080681895f"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sfont_8h.html#a501aa3c84a31b590891c0e080681895f">FLUID_SAMPLETYPE_MONO</a>   1</td></tr>
<tr class="memdesc:a501aa3c84a31b590891c0e080681895f"><td class="mdescLeft"> </td><td class="mdescRight">Flag for <a class="el" href="types_8h.html#abf9174d452679ca1a4ee7d693fb773cf" title="SoundFont sample. ">fluid_sample_t</a> <em>sampletype</em> field for mono samples. <br /></td></tr>
<tr class="separator:a501aa3c84a31b590891c0e080681895f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a07582e4dc7657d0303a66c560c496d06"><td class="memItemLeft" align="right" valign="top"><a id="a07582e4dc7657d0303a66c560c496d06"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sfont_8h.html#a07582e4dc7657d0303a66c560c496d06">FLUID_SAMPLETYPE_RIGHT</a>   2</td></tr>
<tr class="memdesc:a07582e4dc7657d0303a66c560c496d06"><td class="mdescLeft"> </td><td class="mdescRight">Flag for <a class="el" href="types_8h.html#abf9174d452679ca1a4ee7d693fb773cf" title="SoundFont sample. ">fluid_sample_t</a> <em>sampletype</em> field for right samples of a stereo pair. <br /></td></tr>
<tr class="separator:a07582e4dc7657d0303a66c560c496d06"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab4903bcb19a00df0480135339007bb7f"><td class="memItemLeft" align="right" valign="top"><a id="ab4903bcb19a00df0480135339007bb7f"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sfont_8h.html#ab4903bcb19a00df0480135339007bb7f">FLUID_SAMPLETYPE_LEFT</a>   4</td></tr>
<tr class="memdesc:ab4903bcb19a00df0480135339007bb7f"><td class="mdescLeft"> </td><td class="mdescRight">Flag for <a class="el" href="types_8h.html#abf9174d452679ca1a4ee7d693fb773cf" title="SoundFont sample. ">fluid_sample_t</a> <em>sampletype</em> field for left samples of a stereo pair. <br /></td></tr>
<tr class="separator:ab4903bcb19a00df0480135339007bb7f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa4566ed6619b8f5f3ea6db05ec02b4f0"><td class="memItemLeft" align="right" valign="top"><a id="aa4566ed6619b8f5f3ea6db05ec02b4f0"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sfont_8h.html#aa4566ed6619b8f5f3ea6db05ec02b4f0">FLUID_SAMPLETYPE_LINKED</a>   8</td></tr>
<tr class="memdesc:aa4566ed6619b8f5f3ea6db05ec02b4f0"><td class="mdescLeft"> </td><td class="mdescRight">Flag for <a class="el" href="types_8h.html#abf9174d452679ca1a4ee7d693fb773cf" title="SoundFont sample. ">fluid_sample_t</a> <em>sampletype</em> field, not used currently. <br /></td></tr>
<tr class="separator:aa4566ed6619b8f5f3ea6db05ec02b4f0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af8a793524cd3a81badbb10560645bcc4"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sfont_8h.html#af8a793524cd3a81badbb10560645bcc4">FLUID_SAMPLETYPE_OGG_VORBIS</a>   0x10</td></tr>
<tr class="memdesc:af8a793524cd3a81badbb10560645bcc4"><td class="mdescLeft"> </td><td class="mdescRight">Flag for <a class="el" href="types_8h.html#abf9174d452679ca1a4ee7d693fb773cf" title="SoundFont sample. ">fluid_sample_t</a> <em>sampletype</em> field for Ogg Vorbis compressed samples. <a href="#af8a793524cd3a81badbb10560645bcc4">More...</a><br /></td></tr>
<tr class="separator:af8a793524cd3a81badbb10560645bcc4"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2f977322c4a336ef8ad35d2205a82352"><td class="memItemLeft" align="right" valign="top"><a id="a2f977322c4a336ef8ad35d2205a82352"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sfont_8h.html#a2f977322c4a336ef8ad35d2205a82352">FLUID_SAMPLETYPE_ROM</a>   0x8000</td></tr>
<tr class="memdesc:a2f977322c4a336ef8ad35d2205a82352"><td class="mdescLeft"> </td><td class="mdescRight">Flag for <a class="el" href="types_8h.html#abf9174d452679ca1a4ee7d693fb773cf" title="SoundFont sample. ">fluid_sample_t</a> <em>sampletype</em> field, ROM sample, causes sample to be ignored. <br /></td></tr>
<tr class="separator:a2f977322c4a336ef8ad35d2205a82352"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:a06fc87d81c62e9abb8790b6e5713c55b"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom">{ <a class="el" href="sfont_8h.html#a06fc87d81c62e9abb8790b6e5713c55ba3b9d777321001517ceb0fc4f69fb35b1">FLUID_PRESET_SELECTED</a>,
<a class="el" href="sfont_8h.html#a06fc87d81c62e9abb8790b6e5713c55ba5d10f094a7a45e62fa19d559ac29e7f1">FLUID_PRESET_UNSELECTED</a>,
<a class="el" href="sfont_8h.html#a06fc87d81c62e9abb8790b6e5713c55bad5841d407c7bcd3b59b787de8d506a7c">FLUID_SAMPLE_DONE</a>
}<tr class="memdesc:a06fc87d81c62e9abb8790b6e5713c55b"><td class="mdescLeft"> </td><td class="mdescRight">Some notification enums for presets and samples. <a href="sfont_8h.html#a06fc87d81c62e9abb8790b6e5713c55b">More...</a><br /></td></tr>
</td></tr>
<tr class="separator:a06fc87d81c62e9abb8790b6e5713c55b"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>SoundFont plugins. </p>
<p>It is possible to add new SoundFont loaders to the synthesizer. The API uses a couple of "interfaces" (structures with callback functions): <a class="el" href="types_8h.html#ad3e880056d2262e48468719757b3f5e6" title="SoundFont loader plugin. ">fluid_sfloader_t</a>, <a class="el" href="types_8h.html#aa6c18288f76608acbb10b80a153f4ab8" title="SoundFont. ">fluid_sfont_t</a>, and <a class="el" href="types_8h.html#a985e5ee05f433da841127750f67a4723" title="SoundFont preset. ">fluid_preset_t</a>. This API allows for virtual SoundFont files to be loaded and synthesized, which may not actually be SoundFont files, as long as they can be represented by the SoundFont synthesis model.</p>
<p>To add a new SoundFont loader to the synthesizer, call <a class="el" href="synth_8h.html#a4b35dcb250542b8e60cf5dccd0ec1589" title="Add a SoundFont loader to the synth. ">fluid_synth_add_sfloader()</a> and pass a pointer to an fluid_sfloader_t structure. The important callback function in this structure is "load", which should try to load a file and returns a <a class="el" href="types_8h.html#aa6c18288f76608acbb10b80a153f4ab8" title="SoundFont. ">fluid_sfont_t</a> structure, or NULL if it fails.</p>
<p>The <a class="el" href="types_8h.html#aa6c18288f76608acbb10b80a153f4ab8" title="SoundFont. ">fluid_sfont_t</a> structure contains a callback to obtain the name of the SoundFont. It contains two functions to iterate though the contained presets, and one function to obtain a preset corresponding to a bank and preset number. This function should return a <a class="el" href="types_8h.html#a985e5ee05f433da841127750f67a4723" title="SoundFont preset. ">fluid_preset_t</a> structure.</p>
<p>The <a class="el" href="types_8h.html#a985e5ee05f433da841127750f67a4723" title="SoundFont preset. ">fluid_preset_t</a> structure contains some functions to obtain information from the preset (name, bank, number). The most important callback is the noteon function. The noteon function should call <a class="el" href="synth_8h.html#a005a5e8e6b34eb5a44b41d9020ce32d5" title="Allocate a synthesis voice. ">fluid_synth_alloc_voice()</a> for every sample that has to be played. <a class="el" href="synth_8h.html#a005a5e8e6b34eb5a44b41d9020ce32d5" title="Allocate a synthesis voice. ">fluid_synth_alloc_voice()</a> expects a pointer to a <a class="el" href="types_8h.html#abf9174d452679ca1a4ee7d693fb773cf" title="SoundFont sample. ">fluid_sample_t</a> structure and returns a pointer to the opaque <a class="el" href="types_8h.html#a5123ae5ef2d7806475267380c33604c3" title="Synthesis voice instance. ">fluid_voice_t</a> structure. To set or increment the values of a generator, use <a class="el" href="voice_8h.html#aa72691425953a90635ddc32ad246528e" title="Set the value of a generator. ">fluid_voice_gen_set()</a> or <a class="el" href="voice_8h.html#a7113dbb4a08d8097d4188658876749c5" title="Offset the value of a generator. ">fluid_voice_gen_incr()</a>. When you are finished initializing the voice call fluid_voice_start() to start playing the synthesis voice. </p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a0b95cae7587539906dec2602ac29b743"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0b95cae7587539906dec2602ac29b743">◆ </a></span>fluid_sample_refcount</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define fluid_sample_refcount</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">_sample</td><td>)</td>
<td>   ((_sample)->refcount)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the reference count of a sample. </p>
<p>Should only be called from within synthesis context (noteon method for example) </p>
<p class="reference">Referenced by <a class="el" href="ramsfont_8h.html#adaaf00a64687fd1f2121e27483b9d02e">fluid_ramsfont_create_sfont()</a>.</p>
</div>
</div>
<a id="af8a793524cd3a81badbb10560645bcc4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af8a793524cd3a81badbb10560645bcc4">◆ </a></span>FLUID_SAMPLETYPE_OGG_VORBIS</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define FLUID_SAMPLETYPE_OGG_VORBIS   0x10</td>
</tr>
</table>
</div><div class="memdoc">
<p>Flag for <a class="el" href="types_8h.html#abf9174d452679ca1a4ee7d693fb773cf" title="SoundFont sample. ">fluid_sample_t</a> <em>sampletype</em> field for Ogg Vorbis compressed samples. </p>
<dl class="section since"><dt>Since</dt><dd>1.1.7 </dd></dl>
</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="a06fc87d81c62e9abb8790b6e5713c55b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a06fc87d81c62e9abb8790b6e5713c55b">◆ </a></span>anonymous enum</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">anonymous enum</td>
</tr>
</table>
</div><div class="memdoc">
<p>Some notification enums for presets and samples. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a06fc87d81c62e9abb8790b6e5713c55ba3b9d777321001517ceb0fc4f69fb35b1"></a>FLUID_PRESET_SELECTED </td><td class="fielddoc"><p>Preset selected notify. </p>
</td></tr>
<tr><td class="fieldname"><a id="a06fc87d81c62e9abb8790b6e5713c55ba5d10f094a7a45e62fa19d559ac29e7f1"></a>FLUID_PRESET_UNSELECTED </td><td class="fielddoc"><p>Preset unselected notify. </p>
</td></tr>
<tr><td class="fieldname"><a id="a06fc87d81c62e9abb8790b6e5713c55bad5841d407c7bcd3b59b787de8d506a7c"></a>FLUID_SAMPLE_DONE </td><td class="fielddoc"><p>Sample no longer needed notify. </p>
</td></tr>
</table>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>