1 /* FluidSynth - A Software Synthesizer
2  *
3  * Copyright (C) 2003  Peter Hanappe and others.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public License
7  * as published by the Free Software Foundation; either version 2.1 of
8  * the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free
17  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18  * 02110-1301, USA
19  */
20 
21 #ifndef _FLUID_MOD_H
22 #define _FLUID_MOD_H
23 
24 #include "fluidsynth_priv.h"
25 #include "fluid_conv.h"
26 
27 /*
28  * Modulator structure.  See SoundFont 2.04 PDF section 8.2.
29  */
30 struct _fluid_mod_t
31 {
32     unsigned char dest;           /**< Destination generator to control */
33     unsigned char src1;           /**< Source controller 1 */
34     unsigned char flags1;         /**< Source controller 1 flags */
35     unsigned char src2;           /**< Source controller 2 */
36     unsigned char flags2;         /**< Source controller 2 flags */
37     double amount;                /**< Multiplier amount */
38     /* The 'next' field allows to link modulators into a list.  It is
39      * not used in fluid_voice.c, there each voice allocates memory for a
40      * fixed number of modulators.  Since there may be a huge number of
41      * different zones, this is more efficient.
42      */
43     fluid_mod_t *next;
44 };
45 
46 fluid_real_t fluid_mod_get_value(fluid_mod_t *mod, fluid_voice_t *voice);
47 int fluid_mod_check_sources(const fluid_mod_t *mod, char *name);
48 
49 #ifdef DEBUG
50 void fluid_dump_modulator(fluid_mod_t *mod);
51 #endif
52 
53 
54 #endif /* _FLUID_MOD_H */
55