Path: blob/master/libs/fluidsynth/src/synth/fluid_tuning.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/*2223More information about micro tuning can be found at:2425https://www.midi.org/about-midi/tuning.htm26https://www.midi.org/about-midi/tuning-scale.htm27https://www.midi.org/about-midi/tuning_extens.htm2829*/3031#ifndef _FLUID_TUNING_H32#define _FLUID_TUNING_H3334#include "fluidsynth_priv.h"3536struct _fluid_tuning_t37{38char *name;39int bank;40int prog;41double pitch[128]; /* the pitch of every key, in cents */42fluid_atomic_int_t refcount; /* Tuning reference count */43};4445fluid_tuning_t *new_fluid_tuning(const char *name, int bank, int prog);46void delete_fluid_tuning(fluid_tuning_t *tuning);47fluid_tuning_t *fluid_tuning_duplicate(fluid_tuning_t *tuning);48void fluid_tuning_ref(fluid_tuning_t *tuning);49int fluid_tuning_unref(fluid_tuning_t *tuning, int count);5051int fluid_tuning_set_name(fluid_tuning_t *tuning, const char *name);52char *fluid_tuning_get_name(fluid_tuning_t *tuning);5354#define fluid_tuning_get_bank(_t) ((_t)->bank)55#define fluid_tuning_get_prog(_t) ((_t)->prog)5657void fluid_tuning_set_pitch(fluid_tuning_t *tuning, int key, double pitch);58#define fluid_tuning_get_pitch(_t, _key) ((_t)->pitch[_key])5960void fluid_tuning_set_octave(fluid_tuning_t *tuning, const double *pitch_deriv);6162void fluid_tuning_set_all(fluid_tuning_t *tuning, const double *pitch);63#define fluid_tuning_get_all(_t) (&(_t)->pitch[0])6465666768#endif /* _FLUID_TUNING_H */697071