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 *****************************************************************************/
27 #include "lfo_parameters.h"
28 #include "filter_parameters.h"
29 #include "envelope_parameters.h"
30 #include "resonance.h"
32 #include "oscillator.h"
33 #include "portamento.h"
34 #include "addsynth_internal.h"
38 zyn_component_frequency_globals_get_float(
40 unsigned int parameter
)
47 zyn_component_frequency_globals_set_float(
49 unsigned int parameter
,
56 zyn_component_frequency_globals_get_int(
58 unsigned int parameter
)
65 zyn_component_frequency_globals_set_int(
67 unsigned int parameter
,
74 zyn_component_frequency_globals_get_bool(
76 unsigned int parameter
)
83 zyn_component_frequency_globals_set_bool(
85 unsigned int parameter
,
92 zyn_addsynth_component_init_frequency_globals(
93 struct zyn_component_descriptor
* component_ptr
)
95 ZYN_INIT_COMPONENT(component_ptr
, NULL
, zyn_component_frequency_globals_
);
98 #define detune_ptr ((struct zyn_detune * )context)
101 zyn_component_detune_get_float(
103 unsigned int parameter
)
107 case ZYNADD_PARAMETER_FLOAT_DETUNE_FINE
:
108 return detune_ptr
->fine
;
110 LOG_ERROR("Unknown detune parameter %u", parameter
);
116 zyn_component_detune_set_float(
118 unsigned int parameter
,
123 case ZYNADD_PARAMETER_FLOAT_DETUNE_FINE
:
124 detune_ptr
->fine
= value
;
127 LOG_ERROR("Unknown detune parameter %u", parameter
);
133 zyn_component_detune_get_int(
135 unsigned int parameter
)
139 case ZYNADD_PARAMETER_ENUM_DETUNE_TYPE
:
140 return detune_ptr
->type
;
141 case ZYNADD_PARAMETER_INT_DETUNE_OCTAVE
:
142 return detune_ptr
->octave
;
143 case ZYNADD_PARAMETER_INT_DETUNE_COARSE
:
144 return detune_ptr
->coarse
;
147 LOG_ERROR("Unknown int detune parameter %u", parameter
);
153 zyn_component_detune_set_int(
155 unsigned int parameter
,
160 case ZYNADD_PARAMETER_ENUM_DETUNE_TYPE
:
161 detune_ptr
->type
= value
;
163 case ZYNADD_PARAMETER_INT_DETUNE_OCTAVE
:
164 detune_ptr
->octave
= value
;
166 case ZYNADD_PARAMETER_INT_DETUNE_COARSE
:
167 detune_ptr
->coarse
= value
;
171 LOG_ERROR("Unknown int detune parameter %u", parameter
);
176 zyn_component_detune_get_bool(
178 unsigned int parameter
)
183 LOG_ERROR("Unknown bool detune parameter %u", parameter
);
189 zyn_component_detune_set_bool(
191 unsigned int parameter
,
197 LOG_ERROR("Unknown bool detune parameter %u", parameter
);
205 zyn_addsynth_component_init_detune(
206 struct zyn_component_descriptor
* component_ptr
,
207 struct zyn_detune
* detune_ptr
)
209 ZYN_INIT_COMPONENT(component_ptr
, detune_ptr
, zyn_component_detune_
);
212 #define fixed_detune_ptr ((struct zyn_fixed_detune * )context)
215 zyn_component_fixed_detune_get_float(
217 unsigned int parameter
)
222 LOG_ERROR("Unknown fixed detune parameter %u", parameter
);
228 zyn_component_fixed_detune_set_float(
230 unsigned int parameter
,
236 LOG_ERROR("Unknown fixed detune parameter %u", parameter
);
242 zyn_component_fixed_detune_get_int(
244 unsigned int parameter
)
248 case ZYNADD_PARAMETER_ENUM_FIXED_DETUNE_MODE
:
249 return fixed_detune_ptr
->mode
;
250 case ZYNADD_PARAMETER_INT_FIXED_DETUNE_EQUAL_TEMPERATE
:
251 return fixed_detune_ptr
->equal_temperate
;
254 LOG_ERROR("Unknown int fixed detune parameter %u", parameter
);
260 zyn_component_fixed_detune_set_int(
262 unsigned int parameter
,
267 case ZYNADD_PARAMETER_ENUM_FIXED_DETUNE_MODE
:
268 fixed_detune_ptr
->mode
= value
;
270 case ZYNADD_PARAMETER_INT_FIXED_DETUNE_EQUAL_TEMPERATE
:
271 fixed_detune_ptr
->equal_temperate
= value
;
275 LOG_ERROR("Unknown int fixed detune parameter %u", parameter
);
280 zyn_component_fixed_detune_get_bool(
282 unsigned int parameter
)
287 LOG_ERROR("Unknown bool fixed detune parameter %u", parameter
);
293 zyn_component_fixed_detune_set_bool(
295 unsigned int parameter
,
301 LOG_ERROR("Unknown bool fixed detune parameter %u", parameter
);
306 #undef fixed_detune_ptr
309 zyn_addsynth_component_init_fixed_detune(
310 struct zyn_component_descriptor
* component_ptr
,
311 struct zyn_fixed_detune
* fixed_detune_ptr
)
313 ZYN_INIT_COMPONENT(component_ptr
, fixed_detune_ptr
, zyn_component_fixed_detune_
);