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"
37 #define filter ((zyn_filter_sv_handle)context)
40 zyn_component_filter_sv_get_float(
42 unsigned int parameter
)
46 case ZYNADD_PARAMETER_FLOAT_FREQUNECY
:
47 return zyn_filter_sv_get_frequency(filter
);
48 case ZYNADD_PARAMETER_FLOAT_Q_FACTOR
:
49 return zyn_filter_sv_get_q_factor(filter
);
50 case ZYNADD_PARAMETER_FLOAT_FREQUENCY_TRACKING
:
51 return zyn_filter_sv_get_frequency_tracking(filter
);
52 case ZYNADD_PARAMETER_FLOAT_VOLUME
:
53 return zyn_filter_sv_get_gain(filter
);
56 LOG_ERROR("Unknown sv filter float parameter %u", parameter
);
63 zyn_component_filter_sv_set_float(
65 unsigned int parameter
,
70 case ZYNADD_PARAMETER_FLOAT_FREQUNECY
:
71 zyn_filter_sv_set_frequency(filter
, value
);
73 case ZYNADD_PARAMETER_FLOAT_Q_FACTOR
:
74 zyn_filter_sv_set_q_factor(filter
, value
);
76 case ZYNADD_PARAMETER_FLOAT_FREQUENCY_TRACKING
:
77 zyn_filter_sv_set_frequency_tracking(filter
, value
);
79 case ZYNADD_PARAMETER_FLOAT_VOLUME
:
80 return zyn_filter_sv_set_gain(filter
, value
);
84 LOG_ERROR("Unknown sv filter float parameter %u", parameter
);
89 zyn_component_filter_sv_get_int(
91 unsigned int parameter
)
95 case ZYNADD_PARAMETER_INT_STAGES
:
96 return zyn_filter_sv_get_stages(filter
);
97 case ZYNADD_PARAMETER_ENUM_FILTER_TYPE
:
98 return zyn_filter_sv_get_type(filter
);
101 LOG_ERROR("Unknown sv filter int/enum parameter %u", parameter
);
108 zyn_component_filter_sv_set_int(
110 unsigned int parameter
,
115 case ZYNADD_PARAMETER_INT_STAGES
:
116 return zyn_filter_sv_set_stages(filter
, value
);
117 case ZYNADD_PARAMETER_ENUM_FILTER_TYPE
:
118 zyn_filter_sv_set_type(filter
, value
);
122 LOG_ERROR("Unknown sv filter int/enum parameter %u", parameter
);
127 zyn_component_filter_sv_get_bool(
129 unsigned int parameter
)
131 LOG_ERROR("Unknown sv filter bool parameter %u", parameter
);
138 zyn_component_filter_sv_set_bool(
140 unsigned int parameter
,
143 LOG_ERROR("Unknown sv filter bool parameter %u", parameter
);
150 zyn_addsynth_component_init_filter_sv(
151 struct zyn_component_descriptor
* component_ptr
,
152 zyn_filter_sv_handle filter
)
154 ZYN_INIT_COMPONENT(component_ptr
, filter
, zyn_component_filter_sv_
);