Spreading from single value to a range

For general discussion related FlowStone
Post Reply
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Spreading from single value to a range

Post by tulamide »

I almost feel like flooding the website, but before I need a week just to recognize that I won't find an answer, I better ask you guys.

An LFO spits out values in the range [-1, +1]
A second LFO does the same.

The second one shall be multiplied with the first one, but following a knob that spits out [0, 1].

If the knob is at zero, the first LFO runs according to its settings, not influenced at all by the second.
If the knob is at one, the first LFO's output is multiplied by the second LFO's output.
If the knob is somewhere in between, the first LFO is only to a part influenced by the second LFO. (for example, at 0.5 only 50% of the second LFO's strength is applied)

It seems to me that the multiplier must be 1, if the first LFO isn't influenced by the second. And the same multiplier would be non-constant anymore, but from the range of the second LFO, when it influences the first LFO fully.

Help me avoiding a headache! :D
"There lies the dog buried" (German saying translated literally)
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Spreading from single value to a range

Post by KG_is_back »

I think the best thing to do (and probably what you mean) is to use the knob to mix "dry" LFO1 and LFO1*LFO2

Code: Select all

streamin knob;
streamin LFO1;
streamin LFO2;
streamout out;

out=LFO1*(1-knob)+LFO1*LFO2*knob;

tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Spreading from single value to a range

Post by tulamide »

KG_is_back wrote:I think the best thing to do (and probably what you mean) is to use the knob to mix "dry" LFO1 and LFO1*LFO2

Code: Select all

streamin knob;
streamin LFO1;
streamin LFO2;
streamout out;

out=LFO1*(1-knob)+LFO1*LFO2*knob;


Thanks once again. I'm not sure if this has the effect I had in mind, but I tested it and it resulted in quite some interesting patterns, so I will stick to it!
"There lies the dog buried" (German saying translated literally)
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Spreading from single value to a range

Post by KG_is_back »

With knob at 0 you only get signal from LFO1. With knob at 1 you get signal from LFO1*LFO2. With knob at 0.5 you get LFO1*LFO2*0.5+LFO1*0.5 = LFO1*(LFO2*0.5*+(1-0.5) ).
Off course, the intermediate states may be implemented in different way. This is basically weighted arithmetic average (with weight being the knob).
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Spreading from single value to a range

Post by tulamide »

KG_is_back wrote:With knob at 0 you only get signal from LFO1. With knob at 1 you get signal from LFO1*LFO2. With knob at 0.5 you get LFO1*LFO2*0.5+LFO1*0.5 = LFO1*(LFO2*0.5*+(1-0.5) ).
Off course, the intermediate states may be implemented in different way. This is basically weighted arithmetic average (with weight being the knob).

Yes, that's how I understood it as well. What I was trying to do was more like this (but still not 100% correct):

Code: Select all

for knob = 1.0
LFO1*LFO2*1.0+LFO1*0

for knob = 0.5
LFO1*LFO2*0.5+LFO1*0

for knob = 0.0
LFO1*LFO2*0.0+LFO1*1.0


The knob was supposed to add the amount at which LFO1 is modulated by LFO2. At knob 0, LFO2 doesn't modulate, at knob 0.1 LFO2 kicks in with 10% modulation (of LFO1's signal), etc. up to knob 1, where it is modulating 100%

Maybe LFO2's range has to be 0-1 rather than -1 to +1? At least it would be easy then to map knob to it (LFO2 * KNOB)

But if I multiply LFO2 and LFO1 then I need the value 1 to not modulate LFO1. And if I add them (LFO2*KNOB + LFO1) the range gets out of bounds or reverses, etc.

It's ok though. Your solution is musically interesting, so I don't miss anything :)
"There lies the dog buried" (German saying translated literally)
Post Reply