Skip to main content
Participant
Aug 8, 2024 9:12 PM UTC
Answered

Audio Expression Error

Hey there,

I want to link the scatter of a CC Ball Action to my Audio layer (Audio layer is named Audio as well) with this expression:

 

x=thisComp, layer("Audio Amplitude"), effect("Both Channels")("Slider")
linear(x, 20,40, 0, 5)

 

I get this error: "Error: ReferenceError: layer is not defined"

 

I guess it has something to do with the layer part of the expression but i cant really figure out what it is, any ideas?

 

thanks a lot!

This topic is closed to new replies. Start a new post to keep the conversation going.
Airweb_AECorrect answer
Legend
Aug 8, 2024 9:17 PM UTC

replace your commas with dots

x = thisComp.layer("Audio Amplitude").effect("Both Channels")(1);
linear(x, 20,40, 0, 5)

3 replies

Airweb_AECorrect answer
Legend
Aug 8, 2024 9:17 PM UTC

replace your commas with dots

x = thisComp.layer("Audio Amplitude").effect("Both Channels")(1);
linear(x, 20,40, 0, 5)
Translate
Participant
Aug 8, 2024 9:41 PM UTC

thanks that was the problem. Now tho i get this

 

"Error: effect named 'Player Selection' is missing or does not exist. It may have been renamed, moved, deleted or the name may have been mistyped"

 

any ideas?

Translate
Legend
Aug 8, 2024 10:10 PM UTC

I think it's the same problem. If you still have a comma instead of a dot before effect("Player Selection"),
After Effects will search for the effect on the layer where you placed the expression.
If the effect references another layer, it will inevitably cause an error.
To avoid this kind of error, you can use the pickwhip tool,
After Effects will automatically provide the correct path for you.

 

Translate