-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLibAPI_getKarplusParams.cpp
202 lines (187 loc) · 4.2 KB
/
LibAPI_getKarplusParams.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
/**
* @file LibAPI_getKarplusParams.cpp
* @author Nahum Budin
* @date 15-Oct-2024
* @version 1.2
* 1. Code refactoring and notaion.
*
* @brief Get active Karplus String Generator settings parameters
*
* History:
* version 1.1 Code refactoring and notaion.
* version 1.0 5-Oct-2019 1st version
*
*/
#include "modSynth.h"
#include "./LibAPI_settingsManager.h"
int res_kps;
_settings_int_param_t int_param_kps;
_settings_bool_param_t bool_param_kps;
bool mod_synth_get_active_karplus_enable_state()
{
res_kps = settings_manager->get_bool_param(AdjSynth::get_instance()->get_active_patch_params(),
"adjsynth.karplus_synth.enabled",
&bool_param_kps);
if (res_kps == _SETTINGS_KEY_FOUND)
{
return bool_param_kps.value;
}
else
{
return false;
}
}
int mod_synth_get_active_karplus_excitation_waveform_type()
{
res_kps = settings_manager->get_int_param(AdjSynth::get_instance()->get_active_patch_params(),
"adjsynth.karplus_synth.excitation_waveform_type",
&int_param_kps);
if (res_kps == _SETTINGS_KEY_FOUND)
{
return int_param_kps.value;
}
else
{
return 0;
}
}
int mod_synth_get_active_karplus_excitation_waveform_variations()
{
res_kps = settings_manager->get_int_param(AdjSynth::get_instance()->get_active_patch_params(),
"adjsynth.karplus_synth.excitation_waveform_variations",
&int_param_kps);
if (res_kps == _SETTINGS_KEY_FOUND)
{
return int_param_kps.value;
}
else
{
return 0;
}
}
int mod_synth_get_active_karplus_string_damping_calculation_mode()
{
res_kps = settings_manager->get_int_param(AdjSynth::get_instance()->get_active_patch_params(),
"adjsynth.karplus_synth.string_damping_calculation_mode",
&int_param_kps);
if (res_kps == _SETTINGS_KEY_FOUND)
{
return int_param_kps.value;
}
else
{
return 0;
}
}
int mod_synth_get_active_karplus_string_damping()
{
res_kps = settings_manager->get_int_param(AdjSynth::get_instance()->get_active_patch_params(),
"adjsynth.karplus_synth.string_damping",
&int_param_kps);
if (res_kps == _SETTINGS_KEY_FOUND)
{
return int_param_kps.value;
}
else
{
return 0;
}
}
int mod_synth_get_active_karplus_pluck_damping()
{
res_kps = settings_manager->get_int_param(AdjSynth::get_instance()->get_active_patch_params(),
"adjsynth.karplus_synth.pluck_damping",
&int_param_kps);
if (res_kps == _SETTINGS_KEY_FOUND)
{
return int_param_kps.value;
}
else
{
return 0;
}
}
int mod_synth_get_active_karplus_string_on_decay()
{
res_kps = settings_manager->get_int_param(AdjSynth::get_instance()->get_active_patch_params(),
"adjsynth.karplus_synth.on_decay",
&int_param_kps);
if (res_kps == _SETTINGS_KEY_FOUND)
{
return int_param_kps.value;
}
else
{
return 0;
}
}
int mod_synth_get_active_karplus_string_off_decay()
{
res_kps = settings_manager->get_int_param(AdjSynth::get_instance()->get_active_patch_params(),
"adjsynth.karplus_synth.off_decay",
&int_param_kps);
if (res_kps == _SETTINGS_KEY_FOUND)
{
return int_param_kps.value;
}
else
{
return 0;
}
}
int mod_synth_get_active_karplus_string_damping_variation()
{
res_kps = settings_manager->get_int_param(AdjSynth::get_instance()->get_active_patch_params(),
"adjsynth.karplus_synth.string_damping_variations",
&int_param_kps);
if (res_kps == _SETTINGS_KEY_FOUND)
{
return int_param_kps.value;
}
else
{
return 0;
}
}
int mod_synth_get_active_karplus_pluck_damping_variation()
{
res_kps = settings_manager->get_int_param(AdjSynth::get_instance()->get_active_patch_params(),
"adjsynth.karplus_synth.pluck_damping_variations",
&int_param_kps);
if (res_kps == _SETTINGS_KEY_FOUND)
{
return int_param_kps.value;
}
else
{
return 0;
}
}
int mod_synth_get_active_karplus_send_filter_1()
{
res_kps = settings_manager->get_int_param(AdjSynth::get_instance()->get_active_patch_params(),
"adjsynth.karplus_synth.send_filter_1",
&int_param_kps);
if (res_kps == _SETTINGS_KEY_FOUND)
{
return int_param_kps.value;
}
else
{
return 0;
}
}
int mod_synth_get_active_karplus_send_filter_2()
{
res_kps = settings_manager->get_int_param(AdjSynth::get_instance()->get_active_patch_params(),
"adjsynth.karplus_synth.send_filter_2",
&int_param_kps);
if (res_kps == _SETTINGS_KEY_FOUND)
{
return int_param_kps.value;
}
else
{
return 0;
}
}