Path: blob/master/libs/fluidsynth/src/rvoice/fluid_rev.h
4396 views
/* FluidSynth - A Software Synthesizer1*2* Copyright (C) 2003 Peter Hanappe and others.3*4* This library is free software; you can redistribute it and/or5* modify it under the terms of the GNU Lesser General Public License6* as published by the Free Software Foundation; either version 2.1 of7* the License, or (at your option) any later version.8*9* This library is distributed in the hope that it will be useful, but10* WITHOUT ANY WARRANTY; without even the implied warranty of11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU12* Lesser General Public License for more details.13*14* You should have received a copy of the GNU Lesser General Public15* License along with this library; if not, write to the Free16* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA17* 02110-1301, USA18*/192021#ifndef _FLUID_REV_H22#define _FLUID_REV_H2324#include "fluidsynth_priv.h"2526typedef struct _fluid_revmodel_t fluid_revmodel_t;2728/* enum describing each reverb parameter */29enum fluid_reverb_param30{31FLUID_REVERB_ROOMSIZE, /**< reverb time */32FLUID_REVERB_DAMP, /**< high frequency damping */33FLUID_REVERB_WIDTH, /**< stereo width */34FLUID_REVERB_LEVEL, /**< output level */35FLUID_REVERB_PARAM_LAST /* number of enum fluid_reverb_param */36};3738/* return a bit flag from param: 2^param */39#define FLUID_REVPARAM_TO_SETFLAG(param) (1 << param)4041/** Flags for fluid_revmodel_set() */42typedef enum43{44FLUID_REVMODEL_SET_ROOMSIZE = FLUID_REVPARAM_TO_SETFLAG(FLUID_REVERB_ROOMSIZE),45FLUID_REVMODEL_SET_DAMPING = FLUID_REVPARAM_TO_SETFLAG(FLUID_REVERB_DAMP),46FLUID_REVMODEL_SET_WIDTH = FLUID_REVPARAM_TO_SETFLAG(FLUID_REVERB_WIDTH),47FLUID_REVMODEL_SET_LEVEL = FLUID_REVPARAM_TO_SETFLAG(FLUID_REVERB_LEVEL),4849/** Value for fluid_revmodel_set() which sets all reverb parameters. */50FLUID_REVMODEL_SET_ALL = FLUID_REVMODEL_SET_LEVEL51| FLUID_REVMODEL_SET_WIDTH52| FLUID_REVMODEL_SET_DAMPING53| FLUID_REVMODEL_SET_ROOMSIZE,54} fluid_revmodel_set_t;5556/*57* reverb preset58*/59typedef struct _fluid_revmodel_presets_t60{61const char *name;62fluid_real_t roomsize;63fluid_real_t damp;64fluid_real_t width;65fluid_real_t level;66} fluid_revmodel_presets_t;676869/*70* reverb71*/72fluid_revmodel_t *73new_fluid_revmodel(fluid_real_t sample_rate_max, fluid_real_t sample_rate);7475void delete_fluid_revmodel(fluid_revmodel_t *rev);7677void fluid_revmodel_processmix(fluid_revmodel_t *rev, const fluid_real_t *in,78fluid_real_t *left_out, fluid_real_t *right_out);7980void fluid_revmodel_processreplace(fluid_revmodel_t *rev, const fluid_real_t *in,81fluid_real_t *left_out, fluid_real_t *right_out);8283void fluid_revmodel_reset(fluid_revmodel_t *rev);8485void fluid_revmodel_set(fluid_revmodel_t *rev, int set, fluid_real_t roomsize,86fluid_real_t damping, fluid_real_t width, fluid_real_t level);8788int fluid_revmodel_samplerate_change(fluid_revmodel_t *rev, fluid_real_t sample_rate);8990#endif /* _FLUID_REV_H */919293