diff --git a/README.md b/README.md index b5aab93..746af44 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,8 @@ Ratatouille using parallel processing for the neural models, so, loading a second neural model wouldn't be remarkable on the dsp load. Optional, Ratatouille could run the complete process in buffered mode. That reduce the dsp load -even more. Possible been a half (sample buffer) or a full frame. The resulting latency will be reported to the host -so that it could be compensated. For information the resulting latency will be shown on the GUI. +even more. The resulting latency will be reported to the hostso that it could be compensated. +For information the resulting latency will be shown on the GUI. The "Delay" control could add a small delay to overcome phasing issues, or to add some color/reverb to the sound. diff --git a/Ratatouille/Ratatouille.c b/Ratatouille/Ratatouille.c index 848dd65..52d0f14 100644 --- a/Ratatouille/Ratatouille.c +++ b/Ratatouille/Ratatouille.c @@ -325,8 +325,7 @@ void plugin_create_controller_widgets(X11_UI *ui, const char * plugin_uri) { asprintf(&ps->ir1.filepicker->filter ,"%s", ".wav"); ps->ir1.filepicker->use_filter = 1; - ui->widget[15] = add_lv2_slider (ui->widget[15], ui->win, 20, "Buffer", ui, 50, 22, 30, 30); - set_adjustment(ui->widget[15]->adj, 0.0, 0.0, 0.0, 1.0, 0.5, CL_CONTINUOS); + ui->widget[15] = add_lv2_switch (ui->widget[15], ui->win, 20, "Buffer", ui, 50, 22, 30, 30); ui->widget[17] = add_lv2_label (ui->widget[17], ui->win, 22, "Latency", ui, 115, 22, 130, 30); diff --git a/Ratatouille/Ratatouille.cpp b/Ratatouille/Ratatouille.cpp index 0be979a..9e64874 100644 --- a/Ratatouille/Ratatouille.cpp +++ b/Ratatouille/Ratatouille.cpp @@ -158,8 +158,6 @@ class Xratatouille int phaseOffset; bool doit; - uint32_t partialBuffer; - std::string model_file; std::string model_file1; @@ -371,7 +369,6 @@ void Xratatouille::init_dsp_(uint32_t rate) ir_file1 = "None"; bufsize = 0; buffersize = 0; - partialBuffer = 0; phaseOffset = 0; phase_cor = 0; @@ -757,29 +754,11 @@ inline void Xratatouille::runBufferedDsp(uint32_t n_samples) } } - if ((*_buffered) < 0.9) { - memcpy(output0, bufferoutput0, partialBuffer*sizeof(float)); - - // set bufsize for the first part - bufsize = n_samples - partialBuffer; - - // process first part buffer in this cycle and append to output - memcpy(bufferoutput0, input0, bufsize*sizeof(float)); - processDsp(bufsize, bufferoutput0, bufferoutput0); - memcpy(&output0[partialBuffer], bufferoutput0, bufsize*sizeof(float)); - - // process second part buffer in background, use in next cycle - // buffered size may have changed, so recalculate it - partialBuffer = n_samples * (*_buffered); - bufsize = n_samples - partialBuffer; - memcpy(bufferoutput0, &input0[bufsize], partialBuffer*sizeof(float)); - // set bufsize for the second part processed in background - bufsize = partialBuffer; - } else { - partialBuffer = bufsize = n_samples; - memcpy(output0, bufferoutput0, bufsize*sizeof(float)); - memcpy(bufferoutput0, input0, bufsize*sizeof(float)); - } + + bufsize = n_samples; + memcpy(output0, bufferoutput0, bufsize*sizeof(float)); + memcpy(bufferoutput0, input0, bufsize*sizeof(float)); + if (par.getProcess()) par.runProcess(); else { lv2_log_error(&logger,"thread RTBUF missing deadline\n"); @@ -794,9 +773,9 @@ inline void Xratatouille::runBufferedDsp(uint32_t n_samples) } // report latency - if (*(_latency) != static_cast(partialBuffer)) { - *(_latency) = static_cast(partialBuffer); - *(_latencyms) = static_cast(partialBuffer * s_time); + if (*(_latency) != static_cast(bufsize)) { + *(_latency) = static_cast(bufsize); + *(_latencyms) = static_cast(bufsize * s_time); } } else { diff --git a/Ratatouille/Ratatouille.ttl b/Ratatouille/Ratatouille.ttl index af40f9b..00d2e0e 100644 --- a/Ratatouille/Ratatouille.ttl +++ b/Ratatouille/Ratatouille.ttl @@ -279,13 +279,12 @@ and moves the complete processing into a background thread, that reduce the CPU a lv2:InputPort , lv2:ControlPort ; lv2:index 20 ; - + lv2:portProperty lv2:toggled ; lv2:symbol "buffered" ; lv2:name "Buffered" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; - pprop:rangeSteps 3; ], [ a lv2:InputPort , lv2:ControlPort ; diff --git a/Ratatouille/mod/modgui/icon-ratatouille.html b/Ratatouille/mod/modgui/icon-ratatouille.html index 06572ad..5647728 100644 --- a/Ratatouille/mod/modgui/icon-ratatouille.html +++ b/Ratatouille/mod/modgui/icon-ratatouille.html @@ -1,14 +1,14 @@
{{#controls.14}} -
-
+
+
{{name}}
{{/controls.14}} {{#controls.15}} -
-
+
+
{{name}}
{{/controls.15}} diff --git a/Ratatouille/mod/modgui/stylesheet-ratatouille.css b/Ratatouille/mod/modgui/stylesheet-ratatouille.css index 3b8c7fe..f4dc203 100644 --- a/Ratatouille/mod/modgui/stylesheet-ratatouille.css +++ b/Ratatouille/mod/modgui/stylesheet-ratatouille.css @@ -55,41 +55,6 @@ background-position: 0px 0px; } -/* BUFFER SWITCH ON/OFF -================================================*/ -.mod-pedal-ratatouille{{{cns}}} .mod-bufferswitch { - margin-left: 45px ; - margin-top: 12px ; - cursor: pointer; - float: left; - position: absolute; - height: 32px; - width: 30px; - z-index:40; -} - -.mod-pedal-ratatouille{{{cns}}} .mod-bufferswitch-image { - background-image: url(/resources/switches/switch3.png{{{ns}}}); - background-position: 0px 0px; - background-repeat: no-repeat; - background-size: auto 15px; - height: 15px; - width: 30px; -} - -.mod-pedal-ratatouille{{{cns}}} .mod-bufferswitch .mod-switch-title { - font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; - font-size: 10px; - font-weight: bold; - left: 0; - color:#888; - position: absolute; - right: 0; - margin-top: 17px; - top: 0; - z-index: 1; -} - /* LATENCY REPORT ================================================*/ .mod-pedal-ratatouille{{{cns}}} .buffertext { @@ -105,9 +70,9 @@ z-index: 1; } -/* PHASE SWITCH ON/OFF +/* EFFECT SWITCH ON/OFF ================================================*/ -.mod-pedal-ratatouille{{{cns}}} .mod-phaseswitch { +.mod-pedal-ratatouille{{{cns}}} .mod-switch { margin-left: 95px ; margin-top: 12px ; cursor: pointer; @@ -118,7 +83,7 @@ z-index:40; } -.mod-pedal-ratatouille{{{cns}}} .mod-phaseswitch-image { +.mod-pedal-ratatouille{{{cns}}} .mod-switch-image { background-image: url(/resources/switches/powerswitch.png{{{ns}}}); background-position: 0px 0px; background-repeat: no-repeat; @@ -127,15 +92,15 @@ width: 30px; } -.mod-pedal-ratatouille{{{cns}}} .mod-phaseswitch-image.on { +.mod-pedal-ratatouille{{{cns}}} .mod-switch-image.on { background-position: -30px 0px; } -.mod-pedal-ratatouille{{{cns}}} .mod-phaseswitch-image.off { +.mod-pedal-ratatouille{{{cns}}} .mod-switch-image.off { background-position: 0px 0px; } -.mod-pedal-ratatouille{{{cns}}} .mod-phaseswitch .mod-switch-title { +.mod-pedal-ratatouille{{{cns}}} .mod-switch .mod-switch-title { font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; font-size: 10px; font-weight: bold;