Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wine-mirror
GitHub Repository: wine-mirror/wine
Path: blob/master/libs/fluidsynth/src/rvoice/fluid_rev.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_REV_H
23
#define _FLUID_REV_H
24
25
#include "fluidsynth_priv.h"
26
27
typedef struct _fluid_revmodel_t fluid_revmodel_t;
28
29
/* enum describing each reverb parameter */
30
enum fluid_reverb_param
31
{
32
FLUID_REVERB_ROOMSIZE, /**< reverb time */
33
FLUID_REVERB_DAMP, /**< high frequency damping */
34
FLUID_REVERB_WIDTH, /**< stereo width */
35
FLUID_REVERB_LEVEL, /**< output level */
36
FLUID_REVERB_PARAM_LAST /* number of enum fluid_reverb_param */
37
};
38
39
/* return a bit flag from param: 2^param */
40
#define FLUID_REVPARAM_TO_SETFLAG(param) (1 << param)
41
42
/** Flags for fluid_revmodel_set() */
43
typedef enum
44
{
45
FLUID_REVMODEL_SET_ROOMSIZE = FLUID_REVPARAM_TO_SETFLAG(FLUID_REVERB_ROOMSIZE),
46
FLUID_REVMODEL_SET_DAMPING = FLUID_REVPARAM_TO_SETFLAG(FLUID_REVERB_DAMP),
47
FLUID_REVMODEL_SET_WIDTH = FLUID_REVPARAM_TO_SETFLAG(FLUID_REVERB_WIDTH),
48
FLUID_REVMODEL_SET_LEVEL = FLUID_REVPARAM_TO_SETFLAG(FLUID_REVERB_LEVEL),
49
50
/** Value for fluid_revmodel_set() which sets all reverb parameters. */
51
FLUID_REVMODEL_SET_ALL = FLUID_REVMODEL_SET_LEVEL
52
| FLUID_REVMODEL_SET_WIDTH
53
| FLUID_REVMODEL_SET_DAMPING
54
| FLUID_REVMODEL_SET_ROOMSIZE,
55
} fluid_revmodel_set_t;
56
57
/*
58
* reverb preset
59
*/
60
typedef struct _fluid_revmodel_presets_t
61
{
62
const char *name;
63
fluid_real_t roomsize;
64
fluid_real_t damp;
65
fluid_real_t width;
66
fluid_real_t level;
67
} fluid_revmodel_presets_t;
68
69
70
/*
71
* reverb
72
*/
73
fluid_revmodel_t *
74
new_fluid_revmodel(fluid_real_t sample_rate_max, fluid_real_t sample_rate);
75
76
void delete_fluid_revmodel(fluid_revmodel_t *rev);
77
78
void fluid_revmodel_processmix(fluid_revmodel_t *rev, const fluid_real_t *in,
79
fluid_real_t *left_out, fluid_real_t *right_out);
80
81
void fluid_revmodel_processreplace(fluid_revmodel_t *rev, const fluid_real_t *in,
82
fluid_real_t *left_out, fluid_real_t *right_out);
83
84
void fluid_revmodel_reset(fluid_revmodel_t *rev);
85
86
void fluid_revmodel_set(fluid_revmodel_t *rev, int set, fluid_real_t roomsize,
87
fluid_real_t damping, fluid_real_t width, fluid_real_t level);
88
89
int fluid_revmodel_samplerate_change(fluid_revmodel_t *rev, fluid_real_t sample_rate);
90
91
#endif /* _FLUID_REV_H */
92
93