Skip to content

Commit

Permalink
Don't show program control on AVL kits; Make program optional
Browse files Browse the repository at this point in the history
  • Loading branch information
falkTX committed Oct 19, 2016
1 parent c397db1 commit f2e7524
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 84 deletions.
13 changes: 0 additions & 13 deletions AVL_Drumkits_Perc.lv2/FluidPlug.ttl
Expand Up @@ -37,19 +37,6 @@
lv2:default 1.0 ;
lv2:minimum 0.0 ;
lv2:maximum 2.0 ;
] , [
a lv2:InputPort, lv2:ControlPort ;
lv2:index 4 ;
lv2:symbol "program" ;
lv2:name "Program" ;
lv2:portProperty lv2:enumeration , lv2:integer ;
lv2:default 0 ;
lv2:minimum 0 ;
lv2:maximum 1 ;
lv2:scalePoint [
rdfs:label "Drumkits Percussion" ;
rdf:value 0 ;
] ;
] ;

mod:brand "AV Linux" ;
Expand Down
13 changes: 0 additions & 13 deletions Black_Pearl_4A.lv2/FluidPlug.ttl
Expand Up @@ -37,19 +37,6 @@
lv2:default 1.0 ;
lv2:minimum 0.0 ;
lv2:maximum 2.0 ;
] , [
a lv2:InputPort, lv2:ControlPort ;
lv2:index 4 ;
lv2:symbol "program" ;
lv2:name "Program" ;
lv2:portProperty lv2:enumeration , lv2:integer ;
lv2:default 0 ;
lv2:minimum 0 ;
lv2:maximum 1 ;
lv2:scalePoint [
rdfs:label "Black Pearl 4" ;
rdf:value 0 ;
] ;
] ;

mod:brand "AV Linux" ;
Expand Down
13 changes: 0 additions & 13 deletions Black_Pearl_4B.lv2/FluidPlug.ttl
Expand Up @@ -37,19 +37,6 @@
lv2:default 1.0 ;
lv2:minimum 0.0 ;
lv2:maximum 2.0 ;
] , [
a lv2:InputPort, lv2:ControlPort ;
lv2:index 4 ;
lv2:symbol "program" ;
lv2:name "Program" ;
lv2:portProperty lv2:enumeration , lv2:integer ;
lv2:default 0 ;
lv2:minimum 0 ;
lv2:maximum 1 ;
lv2:scalePoint [
rdfs:label "Black Pearl 4 Alt" ;
rdf:value 0 ;
] ;
] ;

mod:brand "AV Linux" ;
Expand Down
13 changes: 0 additions & 13 deletions Black_Pearl_5.lv2/FluidPlug.ttl
Expand Up @@ -37,19 +37,6 @@
lv2:default 1.0 ;
lv2:minimum 0.0 ;
lv2:maximum 2.0 ;
] , [
a lv2:InputPort, lv2:ControlPort ;
lv2:index 4 ;
lv2:symbol "program" ;
lv2:name "Program" ;
lv2:portProperty lv2:enumeration , lv2:integer ;
lv2:default 0 ;
lv2:minimum 0 ;
lv2:maximum 1 ;
lv2:scalePoint [
rdfs:label "Black Pearl 5" ;
rdf:value 0 ;
] ;
] ;

mod:brand "AV Linux" ;
Expand Down
13 changes: 0 additions & 13 deletions Red_Zeppelin_4.lv2/FluidPlug.ttl
Expand Up @@ -37,19 +37,6 @@
lv2:default 1.0 ;
lv2:minimum 0.0 ;
lv2:maximum 2.0 ;
] , [
a lv2:InputPort, lv2:ControlPort ;
lv2:index 4 ;
lv2:symbol "program" ;
lv2:name "Program" ;
lv2:portProperty lv2:enumeration , lv2:integer ;
lv2:default 0 ;
lv2:minimum 0 ;
lv2:maximum 1 ;
lv2:scalePoint [
rdfs:label "Red Zeppelin 4" ;
rdf:value 0 ;
] ;
] ;

mod:brand "AV Linux" ;
Expand Down
13 changes: 0 additions & 13 deletions Red_Zeppelin_5.lv2/FluidPlug.ttl
Expand Up @@ -37,19 +37,6 @@
lv2:default 1.0 ;
lv2:minimum 0.0 ;
lv2:maximum 2.0 ;
] , [
a lv2:InputPort, lv2:ControlPort ;
lv2:index 4 ;
lv2:symbol "program" ;
lv2:name "Program" ;
lv2:portProperty lv2:enumeration , lv2:integer ;
lv2:default 0 ;
lv2:minimum 0 ;
lv2:maximum 1 ;
lv2:scalePoint [
rdfs:label "Red Zeppelin 5" ;
rdf:value 0 ;
] ;
] ;

mod:brand "AV Linux" ;
Expand Down
18 changes: 12 additions & 6 deletions source/FluidPlug.c
Expand Up @@ -167,6 +167,9 @@ static LV2_Handle lv2_instantiate(const struct _LV2_Descriptor* descriptor, doub
data->midiEventURID = uridMap->map(uridMap->handle, LV2_MIDI__MidiEvent);
data->needsReset = false;

// null control values, connection optional
data->controlProgram = NULL;

// boostrap synth engine
float l[1024];
float r[1024];
Expand Down Expand Up @@ -244,13 +247,16 @@ static void lv2_run(LV2_Handle instance, uint32_t frames)

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

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

if (currentProgram_i != data->currentProgram && currentProgram_i >= 0)
if (data->controlProgram != NULL)
{
data->currentProgram = currentProgram_i;
fluid_synth_program_select(data->synth, 0, data->synthId, data->programs[currentProgram_i].bank, data->programs[currentProgram_i].prog);
const float currentProgram_f = *data->controlProgram;
const int currentProgram_i = (int)(currentProgram_f+0.5f);

if (currentProgram_i != data->currentProgram && currentProgram_i >= 0)
{
data->currentProgram = currentProgram_i;
fluid_synth_program_select(data->synth, 0, data->synthId, data->programs[currentProgram_i].bank, data->programs[currentProgram_i].prog);
}
}

uint32_t frameOffset = 0;
Expand Down

0 comments on commit f2e7524

Please sign in to comment.