1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
2 /*****************************************************************************
4 * Copyright (C) 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 *****************************************************************************/
28 #include "lv2dynparam/lv2dynparam.h"
29 #include "lv2dynparam/plugin.h"
30 #include "zynadd_internal.h"
32 #define LOG_LEVEL LOG_LEVEL_ERROR
35 #define LV2DYNPARAM_PARAMETER_ENABLED 0
36 #define LV2DYNPARAM_PARAMETER_RESONANCE 1
37 #define LV2DYNPARAM_PARAMETER_WHITE_NOISE 2
38 #define LV2DYNPARAM_PARAMETER_OSCILLATOR_BASE_FUNCTION 3
39 #define LV2DYNPARAM_PARAMETER_OSCILLATOR_WAVESHAPE_TYPE 4
40 #define LV2DYNPARAM_PARAMETER_OSCILLATOR_WAVESHAPE_DRIVE 5
41 #define LV2DYNPARAM_PARAMETER_OSCILLATOR_BASE_FUNCTION_ADJUST 6
42 #define LV2DYNPARAM_PARAMETER_OSCILLATOR_SPECTRUM_ADJUST_TYPE 7
43 #define LV2DYNPARAM_PARAMETER_OSCILLATOR_SPECTRUM_ADJUST 8
44 #define LV2DYNPARAM_PARAMETER_DETUNE 9
46 #define LV2DYNPARAM_PARAMETERS_COUNT 10
48 #define LV2DYNPARAM_GROUP_VOICEX 0
49 #define LV2DYNPARAM_GROUP_OSCILLATOR 1
51 #define LV2DYNPARAM_GROUPS_COUNT 2
53 struct group_descriptor g_voice_forest_map_groups
[LV2DYNPARAM_GROUPS_COUNT
];
54 struct parameter_descriptor g_voice_forest_map_parameters
[LV2DYNPARAM_PARAMETERS_COUNT
];
55 struct zyn_forest_map g_voice_forest_map
;
56 #define map_ptr (&g_voice_forest_map)
58 void zynadd_init_voice_forest_map() __attribute__((constructor
));
59 void zynadd_init_voice_forest_map()
61 LV2DYNPARAM_FOREST_MAP_BEGIN(LV2DYNPARAM_GROUPS_COUNT
, LV2DYNPARAM_PARAMETERS_COUNT
, g_voice_forest_map_groups
, g_voice_forest_map_parameters
);
63 LOG_DEBUG("zynadd_init_voice_forest_map() called");
65 LV2DYNPARAM_GROUP_INIT(ROOT
, VOICEX
, "Voice X", NULL
);
67 LV2DYNPARAM_PARAMETER_INIT_BOOL(VOICEX
, ENABLED
, VOICE_GLOBALS
, ENABLED
, "Enabled", ALWAYS
, NULL
);
68 LV2DYNPARAM_PARAMETER_INIT_FLOAT(VOICEX
, DETUNE
, VOICE_DETUNE
, DETUNE_FINE
, "Detune", -1, 1, ALWAYS
, NULL
);
69 LV2DYNPARAM_PARAMETER_INIT_BOOL(VOICEX
, RESONANCE
, VOICE_GLOBALS
, RESONANCE
, "Resonance", ALWAYS
, NULL
);
70 LV2DYNPARAM_PARAMETER_INIT_BOOL(VOICEX
, WHITE_NOISE
, VOICE_GLOBALS
, WHITE_NOISE
, "White Noise", ALWAYS
, NULL
);
72 LV2DYNPARAM_GROUP_INIT(VOICEX
, OSCILLATOR
, "Oscillator", NULL
);
74 LV2DYNPARAM_PARAMETER_INIT_ENUM(OSCILLATOR
, OSCILLATOR_BASE_FUNCTION
, VOICE_OSCILLATOR
, OSCILLATOR_BASE_FUNCTION
, "Base function", g_oscillator_base_function_names
, ZYN_OSCILLATOR_BASE_FUNCTIONS_COUNT
, ALWAYS
, NULL
);
75 LV2DYNPARAM_PARAMETER_INIT_FLOAT(OSCILLATOR
, OSCILLATOR_BASE_FUNCTION_ADJUST
, VOICE_OSCILLATOR
, OSCILLATOR_BASE_FUNCTION_ADJUST
, "Base function adjust", 0, 1, ALWAYS
, NULL
);
77 LV2DYNPARAM_PARAMETER_INIT_ENUM(OSCILLATOR
, OSCILLATOR_WAVESHAPE_TYPE
, VOICE_OSCILLATOR
, OSCILLATOR_WAVESHAPE_TYPE
, "Waveshape type", g_oscillator_waveshape_type_names
, ZYN_OSCILLATOR_WAVESHAPE_TYPES_COUNT
, ALWAYS
, NULL
);
78 LV2DYNPARAM_PARAMETER_INIT_FLOAT(OSCILLATOR
, OSCILLATOR_WAVESHAPE_DRIVE
, VOICE_OSCILLATOR
, OSCILLATOR_WAVESHAPE_DRIVE
, "Waveshape drive", 0, 100, ALWAYS
, NULL
);
80 LV2DYNPARAM_PARAMETER_INIT_ENUM(OSCILLATOR
, OSCILLATOR_SPECTRUM_ADJUST_TYPE
, VOICE_OSCILLATOR
, OSCILLATOR_SPECTRUM_ADJUST_TYPE
, "Spectrum adjust type", g_oscillator_spectrum_adjust_type_names
, ZYN_OSCILLATOR_SPECTRUM_ADJUST_TYPES_COUNT
, ALWAYS
, NULL
);
81 LV2DYNPARAM_PARAMETER_INIT_FLOAT(OSCILLATOR
, OSCILLATOR_SPECTRUM_ADJUST
, VOICE_OSCILLATOR
, OSCILLATOR_SPECTRUM_ADJUST
, "Spectrum adjust", 0, 100, ALWAYS
, NULL
);
85 LV2DYNPARAM_FOREST_MAP_END
;