Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wine-mirror
GitHub Repository: wine-mirror/wine
Path: blob/master/libs/fluidsynth/src/synth/fluid_gen.h
4396 views
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
22
#ifndef _FLUID_GEN_H
23
#define _FLUID_GEN_H
24
25
#include "fluidsynth_priv.h"
26
27
typedef struct _fluid_gen_info_t
28
{
29
char num; /* Generator number */
30
char *name;
31
char init; /* Does the generator need to be initialized (not used) */
32
char nrpn_scale; /* The scale to convert from NRPN (cfr. fluid_gen_map_nrpn()) */
33
float min; /* The minimum value */
34
float max; /* The maximum value */
35
float def; /* The default value (cfr. fluid_gen_init()) */
36
} fluid_gen_info_t;
37
38
/*
39
* SoundFont generator structure.
40
*/
41
typedef struct _fluid_gen_t
42
{
43
unsigned char flags; /**< Is the generator set or not (#fluid_gen_flags) */
44
double val; /**< The nominal value */
45
double mod; /**< Change by modulators */
46
double nrpn; /**< Change by NRPN messages */
47
} fluid_gen_t;
48
49
/*
50
* Enum value for 'flags' field of #fluid_gen_t (not really flags).
51
*/
52
enum fluid_gen_flags
53
{
54
GEN_UNUSED, /**< Generator value is not set */
55
GEN_SET, /**< Generator value is set */
56
};
57
58
#define fluid_gen_set_mod(_gen, _val) { (_gen)->mod = (double) (_val); }
59
#define fluid_gen_set_nrpn(_gen, _val) { (_gen)->nrpn = (double) (_val); }
60
61
fluid_real_t fluid_gen_scale(int gen, float value);
62
fluid_real_t fluid_gen_scale_nrpn(int gen, int nrpn);
63
void fluid_gen_init(fluid_gen_t *gen, fluid_channel_t *channel);
64
const char *fluid_gen_name(int gen);
65
66
67
#endif /* _FLUID_GEN_H */
68
69