Expose voice detune parameter of the lv2 plugin
[zyn.git] / addsynth.h
blob50a9b1c7e2cb43e8eef9048b2d00cf78cec36c8f
1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
2 /*****************************************************************************
4 * Copyright (C) 2006,2007,2008,2009 Nedko Arnaudov <nedko@arnaudov.name>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *****************************************************************************/
21 #ifndef ADDSYNTH_H__D1C82A9B_D028_4BAE_9D98_BEC4DFCD0240__INCLUDED
22 #define ADDSYNTH_H__D1C82A9B_D028_4BAE_9D98_BEC4DFCD0240__INCLUDED
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 #if 0
28 } /* Adjust editor indent */
29 #endif
31 typedef void * zyn_addsynth_handle;
33 typedef void * zyn_addsynth_component;
35 bool
36 zyn_addsynth_create(
37 float sample_rate,
38 unsigned int voices_count,
39 zyn_addsynth_handle * handle_ptr);
41 void
42 zyn_addsynth_get_audio_output(
43 zyn_addsynth_handle handle,
44 zyn_sample_type * buffer_left,
45 zyn_sample_type * buffer_right);
47 void
48 zyn_addsynth_note_on(
49 zyn_addsynth_handle handle,
50 unsigned int note,
51 unsigned int velocity);
53 void
54 zyn_addsynth_note_off(
55 zyn_addsynth_handle handle,
56 unsigned int note);
58 void
59 zyn_addsynth_all_notes_off(
60 zyn_addsynth_handle handle);
62 void
63 zyn_addsynth_all_sound_off(
64 zyn_addsynth_handle handle);
66 void
67 zyn_addsynth_destroy(
68 zyn_addsynth_handle handle);
70 #define ZYNADD_COMPONENT_AMP_GLOBALS 0
71 #define ZYNADD_COMPONENT_AMP_ENV 1
72 #define ZYNADD_COMPONENT_AMP_LFO 2
73 #define ZYNADD_COMPONENT_FILTER_GLOBALS 3
74 #define ZYNADD_COMPONENT_FILTER_ANALOG 4
75 #define ZYNADD_COMPONENT_FILTER_FORMANT 5
76 #define ZYNADD_COMPONENT_FILTER_SV 6
77 #define ZYNADD_COMPONENT_FILTER_ENV 7
78 #define ZYNADD_COMPONENT_FILTER_LFO 8
79 #define ZYNADD_COMPONENT_FREQUENCY_GLOBALS 9
80 #define ZYNADD_COMPONENT_FREQUENCY_ENV 10
81 #define ZYNADD_COMPONENT_FREQUENCY_LFO 11
82 #define ZYNADD_COMPONENT_PORTAMENTO 12
83 #define ZYNADD_COMPONENT_DETUNE 13
85 #define ZYNADD_GLOBAL_COMPONENTS_COUNT 14
87 #define ZYNADD_COMPONENT_VOICE_GLOBALS 0
88 #define ZYNADD_COMPONENT_VOICE_OSCILLATOR 1
89 #define ZYNADD_COMPONENT_VOICE_DETUNE 2
90 #define ZYNADD_COMPONENT_VOICE_FIXED_DETUNE 3
91 #define ZYNADD_COMPONENT_VOICE_MODULATOR_DETUNE 4
93 #define ZYNADD_VOICE_COMPONENTS_COUNT 5
95 /* when parameter index is used in more than one component
96 it does need not to conflict with unique parameters */
97 #define ZYNADD_PARAMETER_REUSED_OFFSET 100
99 /* float - reused */
100 #define ZYNADD_PARAMETER_FLOAT_VOLUME (ZYNADD_PARAMETER_REUSED_OFFSET + 0) /* 0 .. 100 */
101 #define ZYNADD_PARAMETER_FLOAT_FREQUNECY (ZYNADD_PARAMETER_REUSED_OFFSET + 1) /* -5 .. 5; 0 .. 1 for legacy filter implementations */
102 #define ZYNADD_PARAMETER_FLOAT_Q_FACTOR (ZYNADD_PARAMETER_REUSED_OFFSET + 2) /* 0 .. 1 */
103 #define ZYNADD_PARAMETER_FLOAT_FREQUENCY_TRACKING (ZYNADD_PARAMETER_REUSED_OFFSET + 3) /* -1 .. 1 */
105 /* float - globals */
106 #define ZYNADD_PARAMETER_FLOAT_PANORAMA 0 /* -1 .. 1 */
107 #define ZYNADD_PARAMETER_FLOAT_VELOCITY_SENSING 1 /* 0 .. 100 */
108 #define ZYNADD_PARAMETER_FLOAT_PUNCH_STRENGTH 2 /* 0 .. 100 */
109 #define ZYNADD_PARAMETER_FLOAT_PUNCH_TIME 3 /* 0 .. 100 */
110 #define ZYNADD_PARAMETER_FLOAT_PUNCH_STRETCH 4 /* 0 .. 100 */
111 #define ZYNADD_PARAMETER_FLOAT_PUNCH_VELOCITY_SENSING 5 /* 0 .. 100 */
112 #define ZYNADD_PARAMETER_FLOAT_PITCH_BEND_RANGE 6 /* -6400 .. 6400, in cents */
113 #define ZYNADD_PARAMETER_FLOAT_PITCH_BEND 7 /* -1 .. 1 */
114 #define ZYNADD_PARAMETER_FLOAT_DETUNE_BANDWIDTH 8 /* -1 .. 1 */
116 /* float - envelope */
117 #define ZYNADD_PARAMETER_FLOAT_ENV_ATTACK_VALUE 0 /* 0 .. 100 */
118 #define ZYNADD_PARAMETER_FLOAT_ENV_ATTACK_DURATION 1 /* 0 .. 100 */
119 #define ZYNADD_PARAMETER_FLOAT_ENV_DECAY_VALUE 2 /* 0 .. 100 */
120 #define ZYNADD_PARAMETER_FLOAT_ENV_DECAY_DURATION 3 /* 0 .. 100 */
121 #define ZYNADD_PARAMETER_FLOAT_ENV_SUSTAIN_VALUE 4 /* 0 .. 100 */
122 #define ZYNADD_PARAMETER_FLOAT_ENV_RELEASE_VALUE 5 /* 0 .. 100 */
123 #define ZYNADD_PARAMETER_FLOAT_ENV_RELEASE_DURATION 6 /* 0 .. 100 */
124 #define ZYNADD_PARAMETER_FLOAT_ENV_STRETCH 7 /* 0 .. 200 */
126 /* float - lfo */
127 #define ZYNADD_PARAMETER_FLOAT_LFO_FREQUENCY 0 /* 0 .. 1 */
128 #define ZYNADD_PARAMETER_FLOAT_LFO_DEPTH 1 /* 0 .. 100 */
129 #define ZYNADD_PARAMETER_FLOAT_LFO_START_PHASE 2 /* 0 .. 1 */
130 #define ZYNADD_PARAMETER_FLOAT_LFO_DELAY 3 /* 0 .. 4?, seconds */
131 #define ZYNADD_PARAMETER_FLOAT_LFO_STRETCH 4 /* -1 .. 1 */
132 #define ZYNADD_PARAMETER_FLOAT_LFO_DEPTH_RANDOMNESS 5 /* 0 .. 100 */
133 #define ZYNADD_PARAMETER_FLOAT_LFO_FREQUENCY_RANDOMNESS 6 /* 0 .. 100 */
135 /* float filter globals */
136 #define ZYNADD_PARAMETER_FLOAT_VELOCITY_SENSING_AMOUNT 0 /* 0 .. 1 */
137 #define ZYNADD_PARAMETER_FLOAT_VELOCITY_SENSING_FUNCTION 1 /* -1 .. 1 */
139 /* float - oscillator */
140 #define ZYNADD_PARAMETER_FLOAT_OSCILLATOR_BASE_FUNCTION_ADJUST 0 /* 0 .. 1 */
141 #define ZYNADD_PARAMETER_FLOAT_OSCILLATOR_WAVESHAPE_DRIVE 1 /* 0 .. 100 */
142 #define ZYNADD_PARAMETER_FLOAT_OSCILLATOR_SPECTRUM_ADJUST 2 /* 0 .. 100 */
144 /* float - portamento */
145 #define ZYNADD_PARAMETER_FLOAT_PORTAMENTO_TIME 0 /* 0 .. 1 */
146 #define ZYNADD_PARAMETER_FLOAT_PORTAMENTO_TIME_STRETCH 1 /* -1 .. 1 */
148 /* float - detune */
149 #define ZYNADD_PARAMETER_FLOAT_DETUNE_FINE 0 /* -1 .. 1 */
151 /* bool - globals */
152 #define ZYNADD_PARAMETER_BOOL_RANDOM_PANORAMA 0
153 #define ZYNADD_PARAMETER_BOOL_STEREO 1
154 #define ZYNADD_PARAMETER_BOOL_RANDOM_GROUPING 2
156 /* bool - envelope */
157 #define ZYNADD_PARAMETER_BOOL_ENV_FORCED_RELEASE 0
158 #define ZYNADD_PARAMETER_BOOL_ENV_LINEAR 1
160 /* bool - lfo */
161 #define ZYNADD_PARAMETER_BOOL_LFO_RANDOM_START_PHASE 0
162 #define ZYNADD_PARAMETER_BOOL_LFO_RANDOM_DEPTH 1
163 #define ZYNADD_PARAMETER_BOOL_LFO_RANDOM_FREQUENCY 2
165 /* bool - portamento */
166 #define ZYNADD_PARAMETER_BOOL_PORTAMENTO_ENABLED 0
167 #define ZYNADD_PARAMETER_BOOL_PORTAMENTO_PITCH_THRESHOLD_ABOVE 1
169 /* bool - voice */
170 #define ZYNADD_PARAMETER_BOOL_ENABLED 0
171 #define ZYNADD_PARAMETER_BOOL_RESONANCE 1
172 #define ZYNADD_PARAMETER_BOOL_WHITE_NOISE 2
174 #define ZYNADD_PARAMETER_ENUM_LFO_SHAPE 1000
175 #define ZYNADD_PARAMETER_ENUM_FILTER_CATEGORY 1001
176 #define ZYNADD_PARAMETER_ENUM_FILTER_TYPE 1002
177 #define ZYNADD_PARAMETER_ENUM_OSCILLATOR_BASE_FUNCTION 1003
178 #define ZYNADD_PARAMETER_ENUM_OSCILLATOR_WAVESHAPE_TYPE 1004
179 #define ZYNADD_PARAMETER_ENUM_OSCILLATOR_SPECTRUM_ADJUST_TYPE 1005
180 #define ZYNADD_PARAMETER_ENUM_DETUNE_TYPE 1006
181 #define ZYNADD_PARAMETER_ENUM_FIXED_DETUNE_MODE 1007
183 #define ZYNADD_PARAMETER_INT_STAGES 0 /* 1 .. 5 */
185 #define ZYNADD_PARAMETER_INT_PORTAMENTO_PITCH_THRESHOLD 1 /* 0 .. 127 */
187 #define ZYNADD_PARAMETER_INT_DETUNE_OCTAVE 0 /* -8 .. 7 */
188 #define ZYNADD_PARAMETER_INT_DETUNE_COARSE 1 /* -64 .. 63 */
190 #define ZYNADD_PARAMETER_INT_FIXED_DETUNE_EQUAL_TEMPERATE 0 /* 0 .. 127 */
192 zyn_addsynth_component
193 zyn_addsynth_get_global_component(
194 zyn_addsynth_handle handle,
195 unsigned int component);
197 zyn_addsynth_component
198 zyn_addsynth_get_voice_component(
199 zyn_addsynth_handle handle,
200 unsigned int voice,
201 unsigned int component);
203 float
204 zyn_addsynth_get_float_parameter(
205 zyn_addsynth_component component,
206 unsigned int parameter);
208 void
209 zyn_addsynth_set_float_parameter(
210 zyn_addsynth_component component,
211 unsigned int parameter,
212 float value);
214 signed int
215 zyn_addsynth_get_int_parameter(
216 zyn_addsynth_component component,
217 unsigned int parameter);
219 void
220 zyn_addsynth_set_int_parameter(
221 zyn_addsynth_component component,
222 unsigned int parameter,
223 signed int value);
225 bool
226 zyn_addsynth_get_bool_parameter(
227 zyn_addsynth_component component,
228 unsigned int parameter);
230 void
231 zyn_addsynth_set_bool_parameter(
232 zyn_addsynth_component component,
233 unsigned int parameter,
234 bool value);
236 #if 0
237 { /* Adjust editor indent */
238 #endif
239 #ifdef __cplusplus
240 } /* extern "C" */
241 #endif
243 #endif /* #ifndef ADDSYNTH_H__D1C82A9B_D028_4BAE_9D98_BEC4DFCD0240__INCLUDED */