HALverb.h
1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef __HALVERB_H__
#define __HALVERB_H__
#include <stdio.h>
#define NUM_OF_MONO_AP_SECTS 3 /* must be at least 1 */
#define NUM_OF_STEREO_L_AP_SECTS 2 /* may be 0 or greater */
#define NUM_OF_STEREO_R_AP_SECTS 2 /* may be 0 or greater */
#define NUM_OF_STEREO_AP_SECTS NUM_OF_STEREO_L_AP_SECTS+NUM_OF_STEREO_R_AP_SECTS
#define NUM_OF_AP_SECTS NUM_OF_MONO_AP_SECTS+NUM_OF_STEREO_AP_SECTS
#define SAMPLE_RATE 44100
#define SAMPLES_PER_MILLISEC SAMPLE_RATE/1000
#define ms *SAMPLES_PER_MILLISEC
#define BUFF_SIZE 512
/*-------------------------------------------------------------------------------
|\ dry_gain
left in>--------------------------------------------------| >---------|
| |/ -----
| | + |--> left out
| ----- ----- |\ -----
| --|AP3|---|AP4|---| >----|
| | ----- ----- |/ wet_gain
| ----- ----- ----- |
|----|AP0|---|AP1|---|AP2|---|
| ----- ----- ----- |
| | ----- ----- |\ wet_gain
| --|AP5|---|AP6|---| >----|
| ----- ----- |/ -----
| | + |--> right out
| |\ -----
right in>--------------------------------------------------| >---------|
|/ dry_gain
---------------------------------------------------------------------------------*/
const struct {int length; float coef; } HALS_REVERB_PARMS[ NUM_OF_AP_SECTS ] = {
{ 49.60 ms,0.750 }, /* first 'mono' section */
{ 34.65 ms,0.720 }, /* second 'mono' section */
{ 24.18 ms,0.691 }, /* third 'mono' section */
{ 17.85 ms,0.649 }, /* first 'stereo left' section */
{ 10.98 ms,0.662 }, /* second 'stereo left' section */
{ 18.01 ms,0.646 }, /* first 'stereo right' section */
{ 10.82 ms,0.666 } }; /* second 'stereo right' section */
/******* exported prototypes *********/
int do_reverb(FILE *in_file, FILE *out_file, float *wet, float *dry, int stereo);
#endif