grame-cncm / faust

Functional programming language for signal processing and sound synthesis
http://faust.grame.fr
Other
2.58k stars 322 forks source link

[JACK] [JAQT] ADSR release not working #516

Closed clementTal closed 4 years ago

clementTal commented 4 years ago

I'm stuggleling with a stange bug. It seems that ADSR Release parameter do not apply in my DSP when compiled using faust2jack or faust2jaqt tools (compiling in local or with faust editor). The same DSP works on faust online IDE.

Here is the DSP:

declare options "[midi:on][nvoices:4][osc:on]";

import("stdfaust.lib");

midigate = button("gate[hidden]");
midifreq = nentry("freq[unit:Hz][hidden]", 440, 20, 20000, 1) : si.polySmooth(midigate,0.001,2);
midigain = nentry("gain[hidden]", 0.5, 0, 10, 0.01);// : si.polySmooth(midigate,0.001,2); 

pitchwheel = hslider("bend [midi:pitchwheel][hidden]",1,0.001,2,0.01): si.smoo; 

env = en.adsr(a, d, s, r, gate)
with {
    a = hslider("A_1[midi:ctrl 73] [style:knob] [osc:/fm/env/1/a 0.01 2]", 0.01, 0.01, 2, 0.01); 
    d = hslider("D_1[midi:ctrl 75] [style:knob] [osc:/fm/env/1/d 0.01 2]", 0.01, 0.01, 2, 0.01);
    s = hslider("S_1[midi:ctrl 79] [style:knob] [osc:/fm/env/1/s 0.01 1]", 0.99, 0, 1, 0.01);
    r = hslider("R_1[midi:ctrl 72] [style:knob] [osc:/fm/env/1/r 0.01 5]", 0.01, 0.01, 5, 0.01);
    gate = midigate;
};

process = os.osc(midifreq) * env;

compilation command line: 'faust2jaqt -midi -nvoices 4 -osc test.dsp'

Any idea of what i'm wrong ?

Thanks

sletz commented 4 years ago

Fixed in https://github.com/grame-cncm/faust/commit/977d979ef66647aaa2206922a3fe29cf5f650faa, can you test and report? Thanks.

clementTal commented 4 years ago

It works, thanks a lot :+1: