diff --git a/lv2/sfizz.c b/lv2/sfizz.c index 90df55eb..dc9d8b1b 100644 --- a/lv2/sfizz.c +++ b/lv2/sfizz.c @@ -82,6 +82,7 @@ typedef struct const float *polyphony_port; const float *oversampling_port; const float *preload_port; + const float *freewheel_port; // Atom forge LV2_Atom_Forge forge; ///< Forge for writing atoms in run thread @@ -135,7 +136,8 @@ enum SFIZZ_VOLUME = 4, SFIZZ_POLYPHONY = 5, SFIZZ_OVERSAMPLING = 6, - SFIZZ_PRELOAD = 7 + SFIZZ_PRELOAD = 7, + SFIZZ_FREEWHEELING = 8 }; static void @@ -196,6 +198,9 @@ connect_port(LV2_Handle instance, case SFIZZ_PRELOAD: self->preload_port = (const float *)data; break; + case SFIZZ_FREEWHEELING: + self->freewheel_port = (const float *)data; + break; default: break; } @@ -483,6 +488,9 @@ run(LV2_Handle instance, uint32_t sample_count) if (!self->control_port || !self->notify_port) return; + if (*(self->freewheel_port) > 0) + lv2_log_note(&self->logger, "[run] Freewheeling set!"); + // Set up forge to write directly to notify output port. const size_t notify_capacity = self->notify_port->atom.size; lv2_atom_forge_set_buffer(&self->forge, (uint8_t *)self->notify_port, notify_capacity); diff --git a/lv2/sfizz.ttl.in b/lv2/sfizz.ttl.in index b3f540f9..cc472be7 100644 --- a/lv2/sfizz.ttl.in +++ b/lv2/sfizz.ttl.in @@ -152,4 +152,14 @@ lv2:scalePoint [ rdfs:label "64 Ko"; rdf:value 16384 ] ; lv2:scalePoint [ rdfs:label "128 Ko"; rdf:value 32768 ] ; lv2:scalePoint [ rdfs:label "256 Ko"; rdf:value 65536 ] ; + ], [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 8 ; + lv2:symbol "freewheeling" ; + lv2:name "Freewheeling" ; + lv2:designation lv2:freeWheeling ; + lv2:portProperty lv2:toggled ; + lv2:default 0 ; + lv2:minimum 0 ; + lv2:maximum 1 ; ].