1 /* FluidSynth - A Software Synthesizer
3 * Copyright (C) 2003 Peter Hanappe and others.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public License
7 * as published by the Free Software Foundation; either version 2.1 of
8 * the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free
17 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24 More information about micro tuning can be found at:
26 http://www.midi.org/about-midi/tuning.htm
27 http://www.midi.org/about-midi/tuning-scale.htm
28 http://www.midi.org/about-midi/tuning_extens.htm
32 #ifndef _FLUID_TUNING_H
33 #define _FLUID_TUNING_H
35 #include "fluidsynth_priv.h"
37 struct _fluid_tuning_t
42 double pitch[128]; /* the pitch of every key, in cents */
43 fluid_atomic_int_t refcount; /* Tuning reference count */
46 fluid_tuning_t *new_fluid_tuning(const char *name, int bank, int prog);
47 void delete_fluid_tuning(fluid_tuning_t *tuning);
48 fluid_tuning_t *fluid_tuning_duplicate(fluid_tuning_t *tuning);
49 void fluid_tuning_ref(fluid_tuning_t *tuning);
50 int fluid_tuning_unref(fluid_tuning_t *tuning, int count);
52 int fluid_tuning_set_name(fluid_tuning_t *tuning, const char *name);
53 char *fluid_tuning_get_name(fluid_tuning_t *tuning);
55 #define fluid_tuning_get_bank(_t) ((_t)->bank)
56 #define fluid_tuning_get_prog(_t) ((_t)->prog)
58 void fluid_tuning_set_pitch(fluid_tuning_t *tuning, int key, double pitch);
59 #define fluid_tuning_get_pitch(_t, _key) ((_t)->pitch[_key])
61 void fluid_tuning_set_octave(fluid_tuning_t *tuning, const double *pitch_deriv);
63 void fluid_tuning_set_all(fluid_tuning_t *tuning, const double *pitch);
64 #define fluid_tuning_get_all(_t) (&(_t)->pitch[0])
69 #endif /* _FLUID_TUNING_H */