musikinformatik / Steno

Concatenative little metalanguage for live coding
GNU General Public License v2.0
65 stars 7 forks source link

input leaks past filter, when synth is replaced only #43

Open telephon opened 6 years ago

telephon commented 6 years ago

// problem in attack phase: input leaks past filter

t = Steno.push(2);

t.filter(\f, { |in| (100, 200..1000).sum { |freq| BPF.ar(in, freq, 0.01) } });
t.quelle(\n, { WhiteNoise.ar(0.4) });

--!nf // evaluate this line several times

// each time, the noise comes through

t.fadeTime = 1;

--!nf // evaluate this line several times …
telephon commented 6 years ago

@LFSaw do you have an idea where we have introduced this problem? I'll try and fix it, but maybe you have a hint.

telephon commented 6 years ago

There is a problem around here: https://github.com/musikinformatik/Steno/blob/master/Classes/StenoSignal.sc#L108

LFSaw commented 6 years ago

minor revelation it is not an order of execution (caused by the force-reload of everything):

s.boot;
t = Steno.push(2);

t.filter(\f, { |in| (100, 200..1000).sum { |freq| BPF.ar(in, freq, 0.01) } });
t.filter(\g, { |in| (100, 200..1000).sum { |freq| BPF.ar(in, freq, 0.01) } });
t.quelle(\n, { WhiteNoise.ar(0.4) });

t.settings.globalSettings // nothing set, also no proto or parent

--nf // evaluate alternate between these two lines
--ng

// each time, the noise comes through, still.

If I change the filter definition to something simple, the burst gets shorter

t.filter(\f, { |in| 0.5 * in });
t.filter(\g, { |in| 0.2 * in });
t.quelle(\n, { WhiteNoise.ar(0.4) });

--!ng
telephon commented 6 years ago

probably the silence is detected earlier and the synth freed earlier then …

LFSaw commented 6 years ago

why is the freeselfwhensilent happening before the mix? https://github.com/musikinformatik/Steno/blob/1288832a78249503a5370ffd5e3ca40dafde7b34/Classes/StenoSignal.sc#L96

LFSaw commented 6 years ago

for the sake of ease of understanding, I'd appreciate tackling naming issues first.

Specifically, I'd like to get a definition of what is associated with variables

inputSignal // input to filter (first argument in user-settable function)
oldSignal // previous signal on bus (not necessarily the same as inputSignal)
signal // signal routed to outBus
tailSignal // signal routed to tailBus

is this correct for all?

telephon commented 6 years ago

some corrections:

  1. inputSignal – input to filter (first argument in user-settable function) (maps to in arg).
  2. oldSignal – previous signal on bus (not necessarily the same as inputSignal, and not necessarily the filter input) (maps to out arg).
  3. signal – signal routed to outBus (currently, no. currently, this is also routed partly to tailBus, in the method writeToBus)
  4. tailSignal – signal read from tailBus (tailBus arg).
telephon commented 6 years ago

why is the freeselfwhensilent happening before the mix?

because after the mix of the previous bus signal (oldSignal), it might never become silent. Probably we need to combine the mix parameter with the envelope. Because otherwise, we add the oldSignal to the mix twice (but this is unrelated to the current issue).

telephon commented 6 years ago

btw. I've just moved the routing function from Steno to StenoSignal, for clarity.

telephon commented 6 years ago

This is now almost fixed …

just adding/removing parentheses leaks a little:

t = Steno.push(2);
t.filter(\f, { |in, e| BPF.ar(in, 600 * (e[\index] + 1), 0.01)  * 8 });
t.quelle(\n, { WhiteNoise.ar(0.4) });
--n[f f f]
--nf