Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wine-mirror
GitHub Repository: wine-mirror/wine
Path: blob/master/libs/fluidsynth/src/synth/fluid_mod.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
#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
unsigned char trans; /**< Output transform flag */
38
double amount; /**< Multiplier amount */
39
/* The 'next' field allows to link modulators into a list. It is
40
* not used in fluid_voice.c, there each voice allocates memory for a
41
* fixed number of modulators. Since there may be a huge number of
42
* different zones, this is more efficient.
43
*/
44
fluid_mod_t *next;
45
};
46
47
fluid_real_t fluid_mod_get_value(fluid_mod_t *mod, fluid_voice_t *voice);
48
int fluid_mod_check_sources(const fluid_mod_t *mod, char *name);
49
fluid_real_t fluid_mod_transform_source_value(fluid_real_t val, unsigned char mod_flags, const fluid_real_t range);
50
51
52
#ifdef DEBUG
53
void fluid_dump_modulator(fluid_mod_t *mod);
54
#endif
55
56
57
#endif /* _FLUID_MOD_H */
58
59