Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #2 from ninodewit/master
gain to level
  • Loading branch information
falkTX committed Jan 18, 2016
2 parents a181928 + 9b8680a commit 3f04735
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion source/Exporter.c
Expand Up @@ -27,7 +27,7 @@ int main()
fluid_settings_setint(settings, "synth.threadsafe-api", 0);

fluid_synth_t* const synth = new_fluid_synth(settings);
fluid_synth_set_gain(synth, 1.0f);
fluid_synth_set_level(synth, 1.0f);
fluid_synth_set_polyphony(synth, 32);
fluid_synth_set_sample_rate(synth, 48000.0f);

Expand Down
12 changes: 6 additions & 6 deletions source/FluidPlug.c
Expand Up @@ -47,7 +47,7 @@ typedef struct {

// lv2 data
float* buffers[2];
const float* controlGain;
const float* controlLevel;
const float* controlProgram;
int currentProgram;
const LV2_Atom_Sequence* events;
Expand All @@ -59,7 +59,7 @@ typedef enum {
kPortEvents = 0,
kPortAudioOutL,
kPortAudioOutR,
kPortGain,
kPortLevel,
kPortProgram,
} FluidSynthPluginPorts;

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

fluid_synth_set_gain(synth, 1.0f);
fluid_synth_set_level(synth, 1.0f);
fluid_synth_set_polyphony(synth, 32);
fluid_synth_set_sample_rate(synth, (float)sampleRate);

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

case kPortGain:
data->controlGain = dataLocation;
case kPortLevel:
data->controlLevel = dataLocation;
break;

case kPortProgram:
Expand Down Expand Up @@ -232,7 +232,7 @@ static void lv2_run(LV2_Handle instance, uint32_t frames)
data->needsReset = false;
}

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

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

0 comments on commit 3f04735

Please sign in to comment.