COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 03-05-2016, 11:25 AM   #1
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default 'offset' an LFO output ?

My LFO outputs values between [-1, 1].

I know I can scale (normalize) it to [0, 1] (0.5 as center point) with scaled_Output = (LFO_Output + 1) * 0.5.

(Thanks Tale btw,
http://forum.cockos.com/showpost.php...1&postcount=18)

But how can I arbitrarily offset it ?
Say, make the center point not 0.5 but e.g. 0.7 ?
(wouldn't matter if the output gets 'clamped', as long as it stays between [0, 1].

(probably relatively easy math for others, but well... )
nofish is offline   Reply With Quote
Old 03-05-2016, 11:43 AM   #2
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

Something like this you mean?

Code:
center = 0.7;
scaled_Output = max(0, min(1, LFO_Output * 0.5 + center));
Tale is offline   Reply With Quote
Old 03-05-2016, 04:11 PM   #3
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

Had to modify it a bit to get what I wanted, but yeah, that was basically it.
Thanks.
nofish is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 06:16 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.