chenlh
2026-03-10 0f65a1a9267b8a7ab4678ef20b07532e4c8377ca
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include "reverb.h"
//#include "reverb_wrapper.h"
#include <stdio.h>
 
 
static int ch,n,L;
static float *x[32], *y[32];
 
 
void reverb_wrapper_init(void **p, int channels, int frame_size, int sample_rate, double dry, double early, double late, int input_mix_on, int hight_cut_on,    // 6
    int low_cut_on, double input_mix, double high_cut_freq, double low_cut_freq, double cross_seed, int taps_on, double  taps_count, double taps_pre_delay, double taps_decay, double taps_length, int early_difus_on, double early_difus_count, double early_difus_delay,    // 13
    double early_difus_feedback, double early_difus_mod_amt, double early_difus_mod_rate, int late_mode, int late_reflect_on, double late_line_count, double late_line_size, double late_line_mod_amt, double late_line_decay, double late_line_mod_rate, double late_difus_count, double late_difus_delay,    // 12
    double late_difus_feedback, double late_difus_mod_amt, double late_difus_mod_rate, int eq_low_shelf_on, int eq_high_shelf_on, int eq_low_pass_on, double eq_low_shelf_freq, double eq_low_shelf_gain, double eq_high_shelf_freq, double eq_high_shelf_gain, double eq_low_pass_freq        // 11
    )
{
    Reverb_common c_t = {sample_rate, dry, early, late, input_mix_on, hight_cut_on, low_cut_on, input_mix, high_cut_freq, low_cut_freq, cross_seed};
    Reverb_taps t_t = {taps_on, taps_count, taps_pre_delay, taps_decay, taps_length};
    Reverb_early e_t = {early_difus_on, early_difus_count, early_difus_delay, early_difus_feedback, early_difus_mod_amt, early_difus_mod_rate};
    Reverb_late l_t = {late_mode, late_reflect_on, late_line_count, late_line_size, late_line_mod_amt, late_line_decay, late_line_mod_rate, late_difus_count, late_difus_delay, late_difus_feedback, late_difus_mod_amt, late_difus_mod_rate};
    Reverb_eq eq_t = {eq_low_shelf_on, eq_high_shelf_on, eq_low_pass_on, eq_low_shelf_freq, eq_low_shelf_gain, eq_high_shelf_freq, eq_high_shelf_gain, eq_low_pass_freq};
 
    *(Reverb **)p = reverb_new(channels, frame_size, &c_t, &t_t, &e_t, &l_t, &eq_t);
    ch = channels;
    n = frame_size;
 
//    FILE *file = fopen("debug.txt", "w");
//    if (NULL == file) return;
 
//    fprintf(file, "GUI params:\n");
//    fprintf(file, "late_refl_on:%d.\n", l_t.late_reflect_on);
//    fprintf(file, "FS:%d  dry:%2.2f  early:%2.2f  late:%2.2f  inp_on:%d  h_c_on:%d  l_c_on:%d  in_mix:%2.2f  h_c:%2.2f  l_c:%2.2f  c_s:%2.2f.\n",
//                   c_t.sample_rate, c_t.dry, c_t.early, c_t.late, c_t.input_mix_on, c_t.high_cut_on, \
//                   c_t.low_cut_on, c_t.input_mix, c_t.high_cut, c_t.low_cut, c_t.cross_seed);
//    fclose(file);
}
 
 
void reverb_wrapper_process(void *p, /*int sample_rate, double dry, double early, double late, int input_mix_on, int hight_cut_on,    // 6
    int low_cut_on, double input_mix, double high_cut_freq, double low_cut_freq, double cross_seed, int taps_on, double  taps_count, double taps_pre_delay, double taps_decay, double taps_length, int early_difus_on, double early_difus_count, double early_difus_delay,    // 13
    double early_difus_feedback, double early_difus_mod_amt, double early_difus_mod_rate, int late_mode, int late_reflect_on, double late_line_count, double late_line_size, double late_line_mod_amt, double late_line_decay, double late_line_mod_rate, double late_difus_count, double late_difus_delay,    // 12
    double late_difus_feedback, double late_difus_mod_amt, double late_difus_mod_rate, int eq_low_shelf_on, int eq_high_shelf_on, int eq_low_pass_on, double eq_low_shelf_freq, double eq_low_shelf_gain, double eq_high_shelf_freq, double eq_high_shelf_gain, double eq_low_pass_freq,
                                  */float *src, float *dst)
{
    int i;
 
    for(i = 0; i < ch; i ++)
        x[i] = src + i * n;
 
    for(i = 0; i < ch; i ++)
        y[i] = dst + i * n;
 
 
    reverb_process(p, x, y);
 
    /*Reverb params = {ch, n, {sample_rate, dry, early, late, input_mix_on, hight_cut_on, low_cut_on, input_mix, high_cut_freq, low_cut_freq, cross_seed},
                     {taps_on, taps_count, taps_pre_delay, taps_decay, taps_length},
                       {early_difus_on, early_difus_count, early_difus_delay, early_difus_feedback, early_difus_mod_amt, early_difus_mod_rate},
                     {late_mode, late_reflect_on, late_line_count, late_line_size, late_line_mod_amt, late_line_mod_rate},
                     {eq_low_shelf_on, eq_high_shelf_on, eq_low_pass_on, eq_low_shelf_freq, eq_low_shelf_gain, eq_high_shelf_freq, eq_high_shelf_gain, eq_low_pass_freq},
                    };
    reverb_params_set(&params);*/
    
}
 
 
void reverb_wrapper_delete(void *p)
{
     reverb_delete(p);
}