HALverb.h 1.96 KB

#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