Skip to content

Commit 3f04735

Browse files
committed
Merge pull request #2 from ninodewit/master
gain to level
2 parents a181928 + 9b8680a commit 3f04735

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

source/Exporter.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ int main()
2727
fluid_settings_setint(settings, "synth.threadsafe-api", 0);
2828

2929
fluid_synth_t* const synth = new_fluid_synth(settings);
30-
fluid_synth_set_gain(synth, 1.0f);
30+
fluid_synth_set_level(synth, 1.0f);
3131
fluid_synth_set_polyphony(synth, 32);
3232
fluid_synth_set_sample_rate(synth, 48000.0f);
3333

source/FluidPlug.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ typedef struct {
4747

4848
// lv2 data
4949
float* buffers[2];
50-
const float* controlGain;
50+
const float* controlLevel;
5151
const float* controlProgram;
5252
int currentProgram;
5353
const LV2_Atom_Sequence* events;
@@ -59,7 +59,7 @@ typedef enum {
5959
kPortEvents = 0,
6060
kPortAudioOutL,
6161
kPortAudioOutR,
62-
kPortGain,
62+
kPortLevel,
6363
kPortProgram,
6464
} FluidSynthPluginPorts;
6565

@@ -100,7 +100,7 @@ static LV2_Handle lv2_instantiate(const struct _LV2_Descriptor* descriptor, doub
100100
if (synth == NULL)
101101
goto cleanup_settings;
102102

103-
fluid_synth_set_gain(synth, 1.0f);
103+
fluid_synth_set_level(synth, 1.0f);
104104
fluid_synth_set_polyphony(synth, 32);
105105
fluid_synth_set_sample_rate(synth, (float)sampleRate);
106106

@@ -193,8 +193,8 @@ static void lv2_connect_port(LV2_Handle instance, uint32_t port, void* dataLocat
193193
data->buffers[port-1] = dataLocation;
194194
break;
195195

196-
case kPortGain:
197-
data->controlGain = dataLocation;
196+
case kPortLevel:
197+
data->controlLevel = dataLocation;
198198
break;
199199

200200
case kPortProgram:
@@ -232,7 +232,7 @@ static void lv2_run(LV2_Handle instance, uint32_t frames)
232232
data->needsReset = false;
233233
}
234234

235-
fluid_synth_set_gain(data->synth, *data->controlGain);
235+
fluid_synth_set_level(data->synth, *data->controlLevel);
236236

237237
const float currentProgram_f = *data->controlProgram;
238238
const int currentProgram_i = (int)(currentProgram_f+0.5f);

0 commit comments

Comments
 (0)