1<?xml version="1.0" encoding="koi8-r"?>
2<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3                  "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5<!--
6
7  I am currently using 'xsltproc' to generate the HTML files. I use a
8  stylesheet contained in the docbook-xsl-stylesheets Debian package:
9
10  $ xsltproc /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/xtchunk.xsl \
11    fluidsynth-v10-devdoc.xml
12
13  An alternative would be to use the Linux Documentation Project's
14  style sheets. See
15  http://www.tldp.org/LDP/LDP-Author-Guide/usingldpxsl.html.
16
17  Suggestions are welcome!
18
19  [PH]
20
21-->
22
23<article>
24  <articleinfo>
25    <title>
26    FluidSynth 1.0 &mdash; Developer Documentation
27    </title>
28
29    <author>
30      <firstname>Peter</firstname>
31      <surname>Hanappe</surname>
32    </author>
33
34    <revhistory>
35      <revision>
36        <revnumber>1.0</revnumber>
37        <date>2003-12-11</date>
38        <authorinitials>hanappe</authorinitials>
39        <revremark>First attempt.</revremark>
40      </revision>
41    </revhistory>
42
43    <copyright>
44      <year>2003</year>
45      <holder>Copyright Peter Hanappe</holder>
46    </copyright>
47
48    <legalnotice>
49      <para>All the source code examples in this document are in the
50      public domain; you can use them as you please. This document is
51      licensed under the Creative Commons Attribution License. To view
52      a copy of this license, visit
53      http://creativecommons.org/licenses/by/1.0/ or send a letter to
54      Creative Commons, 559 Nathan Abbott Way, Stanford, California
55      94305, USA. The FluidSynth library is distributed under the GNU
56      Library General Public License. A copy of the GNU Library
57      General Public License is contained in the FluidSynth package;
58      if not, write to the Free Foundation, Inc., 59 Temple Place,
59      Suite 330, Boston, MA 02111-1307 USA.</para> </legalnotice>
60
61    <keywordset>
62      <keyword>FluidSynth</keyword>
63      <keyword>software</keyword>
64      <keyword>synthesizer</keyword>
65      <keyword>SoundFont</keyword>
66      <keyword>Linux</keyword>
67      <keyword>audio</keyword>
68      <keyword>development</keyword>
69      <keyword>documentation</keyword>
70      <keyword>HOWTO</keyword>
71    </keywordset>
72
73    <abstract>
74
75      <para>FluidSynth is a software synthesizer based on the
76      SoundFont 2 specifications. The synthesizer is available as a
77      shared object that can easily be reused in any application that
78      wants to use wavetable synthesis. This documents explains the
79      basic usage of FluidSynth. Some of the more advanced features
80      are not yet discussed but will be added in future
81      versions.</para>
82
83    </abstract>
84  </articleinfo>
85
86  <sect1>
87    <title>Disclaimer</title>
88
89    <para>This documentation, in its current version, is probably
90    outdated and most certainly incomplete. As always, the source code
91    is the final reference.</para>
92
93    <para>SoundFont(R) is a registered trademark of E-mu Systems, Inc.</para>
94
95  </sect1>
96
97  <sect1>
98    <title>Introduction</title>
99
100    <para>FluidSynth can easily be embedded in an application. It has
101    a main header file, fluidsynth.h, and one dynamically linkable
102    library. FluidSynth runs on Linux, MacOS 9, MacOS X, and the Win32
103    platforms. It has audio and midi drivers for all mentioned
104    platforms but you can use it with your own drivers if your
105    application already handles audio and MIDI input/output. This
106    document explains the basic usage of FluidSynth and provides
107    examples that you can reuse. </para>
108
109  </sect1>
110
111
112  <sect1>
113    <title>Creating and changing the settings</title>
114
115    <para>
116    Before you can use the synthesizer, you have to create a settings
117    object. The settings objects is used by all components of the
118    FluidSynth library. It gives a unified API to set the parameters
119    of the audio drivers, the midi drivers, the synthesizer,
120    andsoforth. A number of default settings are defined by the
121    current implementation. In future versions, the use of the
122    settings will probably be generalized.</para>
123
124    <para>
125    All settings have a name that follows the "dotted-name"
126    notation. For example, "synth.polyphony" refers to the number of
127    voices (polyphony) preallocated by the synthesizer. The settings
128    also have a type. There are currently three types: strings,
129    numbers (double floats), and integers. You can change the values
130    of a setting using the <function>fluid_settings_setstr</function>,
131    <function>fluid_settings_setnum</function>, and
132    <function>fluid_synth_setint</function> functions. For example:
133
134<programlisting>
135#include &lt;fluidsynth.h&gt;
136
137int main(int argc, char** argv)
138{
139  fluid_settings_t* settings = new_fluid_settings();
140
141  fluid_synth_setint(settings, "synth.polyphony", 128);
142
143  delete_fluid_settings(settings);
144  return 0;
145}
146</programlisting>
147
148    </para>
149
150    <para>
151    The API contains the functions to query the type, the current
152    value, the default value, the range and the "hints" of a
153    setting. The range is the minumum and maximum value of the
154    setting. The hints gives additional information about a
155    setting. For example, whether a string represents a filename. Or
156    whether a number should be interpreted on on a logarithmic
157    scale. Check the API documentation for a description of all
158    functions.
159    </para>
160
161  </sect1>
162
163  <sect1>
164    <title>Creating the synthesizer</title>
165
166    <para>
167    To create the synthesizer, you pass it the settings object, as
168    in the following example:
169
170<programlisting>
171#include &lt;fluidsynth.h&gt;
172
173int main(int argc, char** argv)
174{
175  fluid_settings_t* settings;
176  fluid_synth_t* synth;
177
178  fluid_settings_t* settings = new_fluid_settings();
179
180  synth = new_fluid_synth(settings);
181
182  /* Do useful things here */
183
184  delete_fluid_synth(synth);
185  delete_fluid_settings(settings);
186  return 0;
187}
188</programlisting>
189    </para>
190
191    <para>
192    The default settings should be fine for most uses. A detailed
193    description of all the settings used by the synthesizer described
194    below.
195
196<table frame="all"><title>Synthesizer settings</title>
197<tgroup cols="3" colsep="0" rowsep="0" align="left">
198<tbody>
199
200<!-- separation line -->
201<row>
202  <entry>synth.gain</entry>
203  <entry>Type</entry>
204  <entry>number</entry>
205</row>
206<row>
207  <entry></entry>
208  <entry>Default</entry>
209  <entry>0.2</entry>
210</row>
211<row>
212  <entry></entry>
213  <entry>Min-Max</entry>
214  <entry>0.0-10.0</entry>
215</row>
216<row>
217  <entry></entry>
218  <entry>Description</entry>
219  <entry>The gain is applied to the final or master output of the
220synthesizer. It is set to a low value by default to avoid the
221saturation of the output when random MIDI files are played.</entry>
222</row>
223
224<!-- separation line -->
225<row>
226  <entry>synth.sample-rate</entry>
227  <entry>Type</entry>
228  <entry>number</entry>
229</row>
230<row>
231  <entry></entry>
232  <entry>Default</entry>
233  <entry>44100</entry>
234</row>
235<row>
236  <entry></entry>
237  <entry>Min-Max</entry>
238  <entry>22050-96000</entry>
239</row>
240<row>
241  <entry></entry>
242  <entry>Description</entry>
243  <entry>The sample rate of the audio generated by the synthesizer.</entry>
244</row>
245
246<!-- separation line -->
247<row>
248  <entry>synth.polyphony</entry>
249  <entry>Type</entry>
250  <entry>integer</entry>
251</row>
252<row>
253  <entry></entry>
254  <entry>Default</entry>
255  <entry>256</entry>
256</row>
257<row>
258  <entry></entry>
259  <entry>Min-Max</entry>
260  <entry>16-4096</entry>
261</row>
262<row>
263  <entry></entry>
264  <entry>Description</entry>
265  <entry>The polyphony defines how many voices can be played in parallel. The
266number of voices is not necessarily equivalent to the number of notes
267played simultaniously. Indeed, when a note is struck on a specific
268MIDI channel, the preset on that channel may created several voices,
269for example, one for the left audio channel and one for the right
270audio channels. The number of voices activated depends on the number
271of instrument zones that fall in the correspond to the velocity and
272key of the played note.</entry>
273</row>
274
275<!-- separation line -->
276<row>
277  <entry>synth.midi-channels</entry>
278  <entry>Type</entry>
279  <entry>integer</entry>
280</row>
281<row>
282  <entry></entry>
283  <entry>Default</entry>
284  <entry>16</entry>
285</row>
286<row>
287  <entry></entry>
288  <entry>Min-Max</entry>
289  <entry>16-256</entry>
290</row>
291<row>
292  <entry></entry>
293  <entry>Description</entry>
294  <entry>This setting defines the number of MIDI channels of the
295synthesizer. The MIDI standard defines 16 channels, so most hardware
296keyboards are limited to 16. If you plan to use the synthesizer as a
297plugin in an application, it might be interesting to set the number of
298channels to a larger value. In this case you can program a greater
299number of presets.</entry>
300</row>
301
302<!-- separation line -->
303<row>
304  <entry>synth.reverb.active</entry>
305  <entry>Type</entry>
306  <entry>string</entry>
307</row>
308<row>
309  <entry></entry>
310  <entry>Default</entry>
311  <entry>"yes"</entry>
312</row>
313<row>
314  <entry></entry>
315  <entry>Description</entry>
316  <entry>When set to "yes" the reverb effects module is activated. Otherwise,
317no reverb will be added to the output signal. Note that when the
318reverb module is active, the amount of signal send to the reverb
319module depends on the "reverb send" generator defined in the
320SoundFont.</entry>
321</row>
322
323<!-- separation line -->
324<row>
325  <entry>synth.chorus.active</entry>
326  <entry>Type</entry>
327  <entry>string</entry>
328</row>
329<row>
330  <entry></entry>
331  <entry>Default</entry>
332  <entry>"yes"</entry>
333</row>
334<row>
335  <entry></entry>
336  <entry>Description</entry>
337  <entry>When set to "yes" the chorus effects module is activated. Otherwise,
338no chorus will be added to the output signal. Note that when the
339reverb module is active, the amount of signal send to the chorus
340module depends on the "chorus send" generator defined in the
341SoundFont.</entry>
342</row>
343
344<!-- separation line -->
345<row>
346  <entry>synth.ladspa.active</entry>
347  <entry>Type</entry>
348  <entry>string</entry>
349</row>
350<row>
351  <entry></entry>
352  <entry>Default</entry>
353  <entry>"no"</entry>
354</row>
355<row>
356  <entry></entry>
357  <entry>Description</entry>
358  <entry>When set to "yes" the LADSPA subsystem will be called. This subsystem
359allows to load and interconnect LADSPA plugins. The output of the
360synthesizer is processed by the LADSPA subsystem. Note that the
361synthesizer has to be compiled with LADSPA support. More information
362about the LADSPA subsystem later.</entry>
363</row>
364
365<!-- separation line -->
366<row>
367  <entry>synth.audio-groups</entry>
368  <entry>Type</entry>
369  <entry>integer</entry>
370</row>
371<row>
372  <entry></entry>
373  <entry>Default</entry>
374  <entry>1</entry>
375</row>
376<row>
377  <entry></entry>
378  <entry>Min-Max</entry>
379  <entry>1-128</entry>
380</row>
381<row>
382  <entry></entry>
383  <entry>Description</entry>
384  <entry>By default, the synthesizer outputs a single stereo signal. Using this
385option, the synthesizer can output multichannel audio.</entry>
386</row>
387
388<!-- separation line -->
389<row>
390  <entry>synth.effects-channels</entry>
391  <entry>Type</entry>
392  <entry>integer</entry>
393</row>
394<row>
395  <entry></entry>
396  <entry>Default</entry>
397  <entry>2</entry>
398</row>
399<row>
400  <entry></entry>
401  <entry>Min-Max</entry>
402  <entry>2-2</entry>
403</row>
404<row>
405  <entry></entry>
406  <entry>Description</entry>
407  <entry></entry>
408</row>
409
410<!-- separation line -->
411<row>
412  <entry>synth.verbose</entry>
413  <entry>Type</entry>
414  <entry>string</entry>
415</row>
416<row>
417  <entry></entry>
418  <entry>Default</entry>
419  <entry>"no"</entry>
420</row>
421<row>
422  <entry></entry>
423  <entry>Description</entry>
424
425  <entry>When set to "yes" the synthesizer will print out information
426  about the received MIDI events to the stdout. This can be helpful
427  for debugging. This setting can not be changed after the synthesizer
428  has started.</entry>
429
430</row>
431
432<!-- separation line -->
433<row>
434  <entry>synth.dump</entry>
435  <entry>Type</entry>
436  <entry>string</entry>
437</row>
438<row>
439  <entry></entry>
440  <entry>Default</entry>
441  <entry>"no"</entry>
442</row>
443<row>
444  <entry></entry>
445  <entry>Description</entry>
446  <entry></entry>
447</row>
448
449</tbody>
450</tgroup>
451</table>
452
453
454    </para>
455  </sect1>
456
457  <sect1>
458    <title>Creating the audio driver</title>
459
460    <para>
461    The synthesizer itself does not write any audio to the audio
462    output. This allows application developers to manage the audio
463    output themselves if they wish. The next section describes the use
464    of the synthesizer without an audio driver in more detail.
465    </para>
466
467    <para>
468    Creating the audio driver is straightforward: set the appropriate
469    settings and create the driver object. Because the FluidSynth has
470    support for several audio systems, you may want to change which
471    one you want to use. The list below shows theaudio systems that
472    are currently supported. It displays the name, as used by the
473    fluidsynth library, and a description. </para>
474
475    <para>
476    <itemizedlist>
477      <listitem><para>alsa: Advanced Linux Sound Architecture</para></listitem>
478      <listitem><para>oss: Open Sound System (Linux)</para></listitem>
479      <listitem><para>jack: JACK Audio Connection Kit (Linux, Mac OS X)</para></listitem>
480      <listitem><para>portaudio: Portaudio Library (MacOS 9 &amp; X, Windows, Linux)</para></listitem>
481      <listitem><para>sndmgr: Apple SoundManager (Mac OS Classic)</para></listitem>
482      <listitem><para>coreaudio: Apple CoreAudio (MacOS X, experimental)</para></listitem>
483      <listitem><para>dsound: Microsoft DirectSound (Windows)</para></listitem>
484    </itemizedlist>
485    </para>
486
487    <para>
488    The default audio driver depends on the settings with which
489    FluidSynth was compiled. You can get the default driver with
490    fluid_settings_getstr_default(settings, "audio.driver").  To get
491    the list of available drivers use the
492    <function>fluid_settings_foreach_option</function>
493    function. Finally, you can set the driver with
494    <function>fluid_settings_setstr</function>. In most cases, the
495    default driver should work out of the box.  </para>
496
497    <para>
498    Additional options that define the audio quality and latency are
499    "audio.sample-format", "audio.period-size", and
500    "audio.periods". The details are described later.
501    </para>
502
503    <para>
504    You create the audio driver with the
505    <function>new_fluid_audio_driver</function> function. This
506    function takes the settings and synthesizer object as
507    arguments. For example:
508
509<programlisting>
510void init()
511{
512  fluid_settings_t* settings;
513  fluid_synth_t* synth;
514  fluid_audio_driver_t* adriver;
515
516  settings = new_fluid_settings();
517
518  /* Set the synthesizer settings, if necessary */
519
520  synth = new_fluid_synth(settings);
521
522  fluid_settings_setstr(settings, "audio.driver", "jack");
523  adriver = new_fluid_audio_driver(settings, synth);
524}
525</programlisting>
526    </para>
527
528    <para>
529    As soon as the audio driver is created, it will start playing. The
530    audio driver creates a separate thread that runs in real-time mode
531    (is the application has sufficient privileges) and call the
532    synthesizer object to generate the audio.
533    </para>
534
535
536    <para>
537    There are a number of general audio driver settings. The
538    audio.driver settings defines the audio subsystem that will be
539    used. The audio.periods and audio.period-size settings define the
540    latency and robustness against scheduling delays. There are
541    additional settings for the audio subsystems used. They will be
542    documented later.
543    </para>
544
545<table frame="all"><title>General audio driver settings</title>
546<tgroup cols="3" align="left" colsep="0" rowsep="0">
547<tbody>
548
549<!-- separation line -->
550<row>
551  <entry>audio.driver</entry>
552  <entry>Type</entry>
553  <entry>string</entry>
554</row>
555<row>
556  <entry></entry>
557  <entry>Default</entry>
558  <entry>alsa (Linux), dsound (Windows), sndman (MacOS9), coreaudio (MacOS X)</entry>
559</row>
560<row>
561  <entry></entry>
562  <entry>Options</entry>
563  <entry>alsa, oss, jack, dsound, sndman, coreaudio, portaudio</entry>
564</row>
565<row>
566  <entry></entry>
567  <entry>Description</entry>
568  <entry>The audio system to be used.</entry>
569</row>
570
571<!-- separation line -->
572<row>
573  <entry>audio.periods</entry>
574  <entry>Type</entry>
575  <entry>int</entry>
576</row>
577<row>
578  <entry></entry>
579  <entry>Default</entry>
580  <entry>16 (Linux, MacOS X), 8 (Windows)</entry>
581</row>
582<row>
583  <entry></entry>
584  <entry>Min-Max</entry>
585  <entry>2-64</entry>
586</row>
587<row>
588  <entry></entry>
589  <entry>Description</entry>
590  <entry>The number of the audio buffers used by the driver. This
591  number of buffers, multiplied by the buffer size (see setting
592  audio.period-size), determines the maximum latency of the audio
593  driver.</entry>
594</row>
595
596<!-- separation line -->
597<row>
598  <entry>audio.period-size</entry>
599  <entry>Type</entry>
600  <entry>int</entry>
601</row>
602<row>
603  <entry></entry>
604  <entry>Default</entry>
605  <entry>64 (Linux, MacOS X), 512 (Windows)</entry>
606</row>
607<row>
608  <entry></entry>
609  <entry>Min-Max</entry>
610  <entry>64-8192</entry>
611</row>
612<row>
613  <entry></entry>
614  <entry>Description</entry>
615  <entry>The size of the audio buffers (in frames).</entry>
616</row>
617
618<!-- separation line -->
619<row>
620  <entry>audio.sample-format</entry>
621  <entry>Type</entry>
622  <entry>string</entry>
623</row>
624<row>
625  <entry></entry>
626  <entry>Default</entry>
627  <entry>"16bits"</entry>
628</row>
629<row>
630  <entry></entry>
631  <entry>Options</entry>
632  <entry>"16bits", "float"</entry>
633</row>
634<row>
635  <entry></entry>
636  <entry>Description</entry>
637
638  <entry>The format of the audio samples. This is currently only an
639  indication; the audio driver may ignore this setting if it can't
640  handle the specified format.</entry>
641
642</row>
643
644</tbody>
645</tgroup>
646</table>
647
648
649  </sect1>
650
651  <sect1>
652    <title>Using the synthesizer without an audio driver</title>
653
654    <para>
655    It is possible to use the synthesizer object without creating an
656    audio driver. This is desirable if the application using
657    FluidSynth manages the audio output itself. The synthesizer has
658    several API functions that can be used to obtain the audio output:
659    </para>
660
661    <para>
662    <function>fluid_synth_write_s16</function> fills two buffers (left
663    and right channel) with samples coded as signed 16 bits (the
664    endian-ness is machine
665    dependent). <function>fluid_synth_write_float</function> fills a
666    left and right audio buffer with 32 bits floating point
667    samples. For multi channel audio output, the function
668    <function>fluid_synth_nwrite_float</function> has to be used.
669    </para>
670
671    <para>
672    The function <function>fluid_synth_process</function> is still
673    experimental and its use is therefore not recommended but it will
674    probably become the generic interface in future versions.
675    </para>
676
677  </sect1>
678
679  <sect1>
680    <title>Loading and managing SoundFonts</title>
681
682    <para>
683    Before any sound can be produced, the synthesizer needs a
684    SoundFont. For a discussion on SoundFont please refer to some
685    other, not yet existing, therefore virtual document.
686    </para>
687
688    <para>
689    SoundFonts are loaded with the
690    <function>fluid_synth_sfload</function> function. The function
691    takes the path to a SoundFont file as argument and a boolean to
692    indicate whether the presets of the MIDI channels should be
693    updated after the SoundFont is loaded. More on the preset updates
694    below.
695    </para>
696
697    <para>
698    The synthesizer can load any number of SoundFonts. This is an
699    advantage, of course, but there are some issues that you must be
700    aware of. The presets in a SoundFont are identified by their bank
701    and preset number. The MIDI specifications allows the change of a
702    preset on a MIDI channel using the combination of "bank select"
703    and the "program change" messages. An ambiguity arrizes when a
704    preset with a specific bank and preset number is defined in
705    multiple loaded SoundFonts. This is solved by searching the
706    SoundFonts in the inverse order they were loaded, i.e. the lastly
707    loaded SoundFont is searched first for the request preset
708    (identified by bank and preset number) then the on but last loaded
709    SoundFont, and so on until. The first preset found is then
710    used. You can somehow consider the SoundFonts placed on a
711    stack. The SoundFont on top of the stack is inspected first,
712    followed by the SoundFont down on the stack. Newly loaded
713    SoundFonts are always placed on top of the stack. This is how
714    commercial, hardware synthesizers work. The inconvenience is that
715    a preset in a SoundFont at the bottom end of the stack may be
716    masked by a preset in a SoundFont at the top of the stack. Using
717    the standard MIDI messages, bank select and program change, there
718    is no way to select a masked preset. However, FluidSynth has an
719    API function to unambiguously select a preset
720    (<function>fluid_synth_program_select</function>). This function
721    is not invokeable through MIDI messages, though.
722    </para>
723
724    <para>
725    The <function>fluid_synth_sfload</function> function returns the
726    unique identifier of the loaded SoundFont, or -1 in case of an
727    error. This identifier is used in subsequent management functions:
728    <function>fluid_synth_sfunload</function> removes the SoundFont,
729    <function>fluid_synth_sfreload</function> reloads the
730    SoundFont. When a SoundFont is reloaded, it retains it's ID and
731    position on the SoundFont stack.
732    </para>
733
734    <para>
735    Additional API functions are provided to get the number of loaded
736    SoundFonts ot to get a pointer to the SoundFont.
737    </para>
738
739    <para>
740    Another issue that needs some explanation is the reprogramming of
741    the presets after a SoundFont load or unload. The default behavior
742    of commercial synthesizers is to reset all the preset that are
743    programmed on the MIDI channels when a SoundFont is loaded or
744    unloaded. Consider the case where MIDI channel 1 uses preset (0,
745    0) (the couple indicates the bank and program number). This preset
746    was found in the SoundFont with ID 3, for example. When a new
747    SoundFont is loaded that also contains a preset with bank number 0
748    and program number 0, then the newly loaded preset will be used on
749    channel 1 for future events. This behavior is as if a bank select
750    and program change message is send to all channels after a
751    load/unload using the channel's bank and program number. This may
752    be sometimes confusing or unwanted. A user may not want to loose
753    its preset setup when a new SoundFont is loaded. To avoid the
754    reprogramming of the presets, the third parameter to the
755    <function>fluid_synth_sfload</function> and
756    <function>fluid_synth_sfunload</function> functions should be set
757    to zero.
758    </para>
759
760  </sect1>
761
762  <sect1>
763    <title>Sending MIDI events</title>
764
765    <para>
766    Once the synthesizer is up and running and a SoundFont is loaded,
767    most people will want to do something usefull with it. Make noise,
768    for example. The synthesizer aims to be compatible with the MIDI
769    standard, so it accepts almost all MIDI messages (details on the
770    MIDI compatibility elsewhere). The MIDI channel messages can be
771    send using the <function>fluid_synth_noteon</function>,
772    <function>fluid_synth_noteoff</function>,
773    <function>fluid_synth_cc</function>,
774    <function>fluid_synth_pitch_bend</function>,
775    <function>fluid_synth_pitch_wheel_sens</function>, and
776    <function>fluid_synth_program_change</function> functions. For
777    convenience, there's also a
778    <function>fluid_synth_bank_select</function> function (the bank
779    select message is normally sent using a control change message).
780    </para>
781
782    <para>
783    The following example show a generic graphical button that plays a
784    not when clicked:
785
786<programlisting>
787class SoundButton : public SomeButton
788{
789public:
790
791  SoundButton() : SomeButton() {
792    if (!_synth) {
793       initSynth();
794    }
795  }
796
797  static void initSynth() {
798    _settings = new_fluid_settings();
799    _synth = new_fluid_synth(_settings);
800    _adriver = new_fluid_audio_driver(_settings, _synth);
801  }
802
803  /* ... */
804
805  virtual int handleMouseDown(int x, int y) {
806    /* Play a note on key 60 with velocity 100 on MIDI channel 0 */
807    fluid_synth_noteon(_synth, 0, 60, 100);
808  }
809
810  virtual int handleMouseUp(int x, int y) {
811    /* Release the note on key 60 */
812    fluid_synth_noteoff(_synth, 0, 60);
813  }
814
815
816protected:
817
818  static fluid_settings_t* _settings;
819  static fluid_synth_t* _synth;
820  static fluid_audio_driver_t* _adriver;
821};
822</programlisting>
823    </para>
824
825
826  </sect1>
827
828  <sect1>
829    <title>Advanced features, not yet documented</title>
830
831<itemizedlist mark="opencircle">
832<listitem><para>Accessing low-level voice parameters</para></listitem>
833<listitem><para>Reverb settings</para></listitem>
834<listitem><para>Chorus settings</para></listitem>
835<listitem><para>Interpolation settings (set_gen, get_gen, NRPN)</para></listitem>
836<listitem><para>Sequencer</para></listitem>
837<listitem><para>LADSPA effects unit</para></listitem>
838<listitem><para>MIDI router</para></listitem>
839<listitem><para>Multi-channel audio</para></listitem>
840<listitem><para>MIDI tunings</para></listitem>
841<listitem><para>MIDI file player</para></listitem>
842<listitem><para>SoundFont loader</para></listitem>
843</itemizedlist>
844
845  </sect1>
846</article>
847