<p>You need to do a linear map as an Expression.
So the example below would take any value between 0-100 and map it between -100 to 100.</p>
<pre><code>input = effect(&quot;Slider Control&quot;)(&quot;Slider&quot;);
inputLow = 0;
inputHigh = 100;
outputLow = -100;
outputHigh = 100;

linear(input,inputLow,inputHigh,outputLow,outputHigh)
</code></pre>

CC BY-SA 4.0
2020-08-26T08:09:18.523Z
Sorry I'm totally new to expressions, can you please show me how I put that into my rest of the expression?
user152435
CC BY-SA 4.0
2020-08-26T08:39:28.873Z
Edit - Thanks man, after you gave me a primer, I was able to find it on Google...
user152435
CC BY-SA 4.0
2020-08-25T19:30:32.003Z
2020-08-25T19:30:32.003Z
tomh
<p>I want to make a speaker graphic 'wobble' to different frequencies..<br />
Here's what I've done so far</p>
<p>I made a speaker graphic in a comp
And I parented the scale to a null in the main comp</p>
<p><a href="https://i.sstatic.net/3G8kr.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/3G8kr.png" alt="enter image description here" /></a></p>
<p>And I <em>isolated</em> the kick drum with a combo of a band pass filter and a bass-treble.
Then I converted that audio into keyframes and pick whipped that null with that speaker's scale parented to it.</p>
<p><a href="https://i.sstatic.net/i9nVm.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/i9nVm.png" alt="enter image description here" /></a></p>
<p>So here's where I'm stuck at:<br />
I want to <strong>limit</strong> the speaker's scale within some values. Like the speaker should not exceed 75.8% and 76% of scale.</p>
<p>So what I tried so far is something like this ↓<br />
temp = thisComp.layer(&quot;Audio Amplitude&quot;).effect(&quot;Both Channels&quot;)(&quot;Slider&quot;);
[temp, temp]  +[Math.min(73.8-2), Math.min(73.8-2)] [Math.max(23), Math.max(23)]</p>

<after-effects><audio><after-effects-expressions>
Limit the scale of a pick whipped object
user152435
# Limit the scale of a pick whipped object

(Asked by: username_0 on 2020-08-25)

I want to make a speaker graphic 'wobble' to different frequencies..  
Here's what I've done so far

I made a speaker graphic in a comp
And I parented the scale to a null in the main comp

[![enter image description here](https://i.sstatic.net/3G8kr.png)](https://i.sstatic.net/3G8kr.png)

And I *isolated* the kick drum with a combo of a band pass filter and a bass-treble.
Then I converted that audio into keyframes and pick whipped that null with that speaker's scale parented to it.

[![enter image description here](https://i.sstatic.net/i9nVm.png)](https://i.sstatic.net/i9nVm.png)

So here's where I'm stuck at:  
I want to **limit** the speaker's scale within some values. Like the speaker should not exceed 75.8% and 76% of scale.

So what I tried so far is something like this ↓  
temp = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
[temp, temp] +[Math.min(73.8-2), Math.min(73.8-2)] [Math.max(23), Math.max(23)]

**Tags:** after-effects, audio, after-effects-expressions


---

## 1 answers

### Answer by username_1 on 2020-08-25. Score: 2 | Accepted answer

You need to do a linear map as an Expression.
So the example below would take any value between 0-100 and map it between -100 to 100.
input = effect("Slider Control")("Slider");
inputLow = 0;
inputHigh = 100;
outputLow = -100;
outputHigh = 100;

linear(input,inputLow,inputHigh,outputLow,outputHigh)

> **Comments:**
> **username_0**: Sorry I'm totally new to expressions, can you please show me how I put that into my rest of the expression?  
> **username_0**: Edit - Thanks man, after you gave me a primer, I was able to find it on Google...  

---

