Path: blob/master/libs/fluidsynth/src/synth/fluid_gen.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_GEN_H22#define _FLUID_GEN_H2324#include "fluidsynth_priv.h"2526typedef struct _fluid_gen_info_t27{28char num; /* Generator number */29char *name;30char init; /* Does the generator need to be initialized (not used) */31char nrpn_scale; /* The scale to convert from NRPN (cfr. fluid_gen_map_nrpn()) */32float min; /* The minimum value */33float max; /* The maximum value */34float def; /* The default value (cfr. fluid_gen_init()) */35} fluid_gen_info_t;3637/*38* SoundFont generator structure.39*/40typedef struct _fluid_gen_t41{42unsigned char flags; /**< Is the generator set or not (#fluid_gen_flags) */43double val; /**< The nominal value */44double mod; /**< Change by modulators */45double nrpn; /**< Change by NRPN messages */46} fluid_gen_t;4748/*49* Enum value for 'flags' field of #fluid_gen_t (not really flags).50*/51enum fluid_gen_flags52{53GEN_UNUSED, /**< Generator value is not set */54GEN_SET, /**< Generator value is set */55};5657#define fluid_gen_set_mod(_gen, _val) { (_gen)->mod = (double) (_val); }58#define fluid_gen_set_nrpn(_gen, _val) { (_gen)->nrpn = (double) (_val); }5960fluid_real_t fluid_gen_scale(int gen, float value);61fluid_real_t fluid_gen_scale_nrpn(int gen, int nrpn);62void fluid_gen_init(fluid_gen_t *gen, fluid_channel_t *channel);63const char *fluid_gen_name(int gen);646566#endif /* _FLUID_GEN_H */676869