Skip to main content
Participant
August 8, 2024
Answered

Audio Expression Error

  • August 8, 2024
  • 1 reply
  • 450 views

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 has been closed for replies.
Correct answer Airweb_AE

replace your commas with dots

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

1 reply

Airweb_AECorrect answer
Legend
August 8, 2024

replace your commas with dots

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

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?

Legend
August 8, 2024

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.