Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wine-mirror
GitHub Repository: wine-mirror/wine
Path: blob/master/libs/fluidsynth/src/rvoice/fluid_chorus.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_CHORUS_H
23
#define _FLUID_CHORUS_H
24
25
#include "fluidsynth_priv.h"
26
27
28
typedef struct _fluid_chorus_t fluid_chorus_t;
29
30
/* enum describing each chorus parameter */
31
enum fluid_chorus_param
32
{
33
FLUID_CHORUS_NR, /**< number of delay line */
34
FLUID_CHORUS_LEVEL, /**< output level */
35
FLUID_CHORUS_SPEED, /**< lfo frequency */
36
FLUID_CHORUS_DEPTH, /**< modulation depth */
37
FLUID_CHORUS_TYPE, /**< type of waveform */
38
FLUID_CHORUS_PARAM_LAST /* number of enum fluid_chorus_param */
39
};
40
41
/* return a bit flag from param: 2^param */
42
#define FLUID_CHORPARAM_TO_SETFLAG(param) (1 << param)
43
44
/** Flags for fluid_chorus_set() */
45
typedef enum
46
{
47
FLUID_CHORUS_SET_NR = FLUID_CHORPARAM_TO_SETFLAG(FLUID_CHORUS_NR),
48
FLUID_CHORUS_SET_LEVEL = FLUID_CHORPARAM_TO_SETFLAG(FLUID_CHORUS_LEVEL),
49
FLUID_CHORUS_SET_SPEED = FLUID_CHORPARAM_TO_SETFLAG(FLUID_CHORUS_SPEED),
50
FLUID_CHORUS_SET_DEPTH = FLUID_CHORPARAM_TO_SETFLAG(FLUID_CHORUS_DEPTH),
51
FLUID_CHORUS_SET_TYPE = FLUID_CHORPARAM_TO_SETFLAG(FLUID_CHORUS_TYPE),
52
53
/** Value for fluid_chorus_set() which sets all chorus parameters. */
54
FLUID_CHORUS_SET_ALL = FLUID_CHORUS_SET_NR
55
| FLUID_CHORUS_SET_LEVEL
56
| FLUID_CHORUS_SET_SPEED
57
| FLUID_CHORUS_SET_DEPTH
58
| FLUID_CHORUS_SET_TYPE,
59
} fluid_chorus_set_t;
60
61
/*
62
* chorus
63
*/
64
fluid_chorus_t *new_fluid_chorus(fluid_real_t sample_rate);
65
void delete_fluid_chorus(fluid_chorus_t *chorus);
66
void fluid_chorus_reset(fluid_chorus_t *chorus);
67
68
void fluid_chorus_set(fluid_chorus_t *chorus, int set, int nr, fluid_real_t level,
69
fluid_real_t speed, fluid_real_t depth_ms, int type);
70
void
71
fluid_chorus_samplerate_change(fluid_chorus_t *chorus, fluid_real_t sample_rate);
72
73
void fluid_chorus_processmix(fluid_chorus_t *chorus, const fluid_real_t *in,
74
fluid_real_t *left_out, fluid_real_t *right_out);
75
void fluid_chorus_processreplace(fluid_chorus_t *chorus, const fluid_real_t *in,
76
fluid_real_t *left_out, fluid_real_t *right_out);
77
78
79
80
#endif /* _FLUID_CHORUS_H */
81
82