5 * Copyright (C) 2002-2005 Monty
7 * Postfish is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
12 * Postfish is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Postfish; see the file COPYING. If not, write to the
19 * Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24 typedef struct reverb_settings
{
25 sig_atomic_t roomsize
; /* 0 - 1000 */
26 sig_atomic_t liveness
; /* 0 - 1000 */
27 sig_atomic_t hfdamp
; /* 0 - 1000 */
28 sig_atomic_t delay
; /* 0 - 1000 */
30 sig_atomic_t wet
; /* dB * 10 */
31 sig_atomic_t width
; /* 0 - 1000 */
32 sig_atomic_t dry_mix
; /* 0, 1 */
34 sig_atomic_t active
; /* 0, 1 */
35 sig_atomic_t visible
; /* 0, 1 */
38 typedef struct allpass
{
54 #define numallpasses 4
55 #define scalehfdamp 0.4f
56 #define scaleliveness 0.4f
57 #define offsetliveness 0.58f
58 #define scaleroom 1111
59 #define stereospread 23
60 #define fixedgain 0.015f
76 /* These values assume 44.1KHz sample rate
77 they will probably be OK for 48KHz sample rate
78 but would need scaling for 96KHz (or other) sample rates.
79 The values were obtained by listening tests. */
81 static const int combL
[numcombs
]={
82 comb0
, comb1
, comb2
, comb3
,
83 comb4
, comb5
, comb6
, comb7
86 static const int combR
[numcombs
]={
87 comb0
+stereospread
, comb1
+stereospread
, comb2
+stereospread
, comb3
+stereospread
,
88 comb4
+stereospread
, comb5
+stereospread
, comb6
+stereospread
, comb7
+stereospread
91 static const int allL
[numallpasses
]={
92 all0
, all1
, all2
, all3
,
95 static const int allR
[numallpasses
]={
96 all0
+stereospread
, all1
+stereospread
, all2
+stereospread
, all3
+stereospread
,
99 /* enough storage for L or R */
100 typedef struct reverb_state
{
101 comb_state comb
[numcombs
];
102 allpass_state allpass
[numallpasses
];
104 float bufcomb0
[comb0
+stereospread
];
105 float bufcomb1
[comb1
+stereospread
];
106 float bufcomb2
[comb2
+stereospread
];
107 float bufcomb3
[comb3
+stereospread
];
108 float bufcomb4
[comb4
+stereospread
];
109 float bufcomb5
[comb5
+stereospread
];
110 float bufcomb6
[comb6
+stereospread
];
111 float bufcomb7
[comb7
+stereospread
];
113 float bufallpass0
[all0
+stereospread
];
114 float bufallpass1
[all1
+stereospread
];
115 float bufallpass2
[all2
+stereospread
];
116 float bufallpass3
[all3
+stereospread
];
121 typedef struct converted_reverb_settings
{
131 } converted_reverb_settings
;
133 typedef struct reverb_instance_one
{
138 converted_reverb_settings sC
;
139 } reverb_instance_one
;
141 typedef struct reverb_instance
{
145 int blocksize
; /* can go away after lib conversion */
146 reverb_instance_one
*reverbs
;
149 extern time_linkage
*p_reverb_read_master(time_linkage
*in
);
150 extern time_linkage
*p_reverb_read_channel(time_linkage
*in
,
152 time_linkage
**revB
);
153 extern void p_reverb_reset(void);
154 extern int p_reverb_load(void);
156 extern reverb_settings
*reverb_channelset
;
157 extern reverb_settings reverb_masterset
;