Highlighted

Expression error 1 of 1 - Audio Spectrum Code

Community Beginner ,
May 04, 2019

Copy link to clipboard

Copied

This is so ridiculous. If you haven't watched the video I watched, the link: After Effects Tutorial: Audio Spectrum Effect in After Effects - No Plugin - YouTube

I did everything he stated, but on the last and final step when I entered the code:

value + (comp("Music").layer("Audio Amplitude").effect("Both Channels")("Slider")) / 5

It told me error in expression, and this code I assume makes the audio spectrum pop out with the drums/beat.

This is so frustrating because I literally have this project done and yet the code is holding me back, it's also the main problem for others according to this guys comment section. If anyone knows the ACTUAL code that WON'T give me an error message, that would be great. I'm sorry if I'm being a little hard on the person reading this but does anyone know the fix?

(Everyone thinks they know the real code but none of them work)

Screenshot (416).png

[Here is the list of all Adobe forums... https://forums.adobe.com/welcome]

[Comments is to ask about the operation of the Forum, not a specific program]

[Moved from the Comments forum to the specific Program forum... Mod]

[What Adobe page sent you to Comments instead of After Effects?]

Adobe Community Professional
Correct answer by Rick Gerard | Adobe Community Professional

OussK, the error is not a Javascript or syntax error. The expression is looking for a composition named Music. DouglasAnderson111,  you don't have a comp named Music in the Project Panel. If you can find the comp and re-name it or create the Music Comp, and the music comp contains a layer Called Audio Spectrum, and that layer has an effect named Both Channels the error will go away. Let's take a closer look at the expression:

Screenshot_2019-05-04 23.46.02_WQ8gmV.png

All you have to do is find or create the Music comp and make sure the name is spelled correctly.

A cleaner technique would have been to apply the Keyframe Assistant>Audio to Keyframes tool to the audio track in the main comp and work the Magnify effect right in the main comp. There is no reason to create a separate comp with a duplicate of the audio channel. The other problem with the technique is that you will not be able to find the comp the expression is referring to by using the flow chart. It is never a good idea to have a comp in a project that can't be easily found.

A better approach would be to use the ease(t, tMin, tMax, value1, value2) method to modify the values of the slider in the Audio Amplitude layer. If you really wanted to create a ghost comp that is only referred to by an expression and that is not discoverable in a flowchart, then you can do that, but the best approach is to look at the graph editor with the Both Channels property selected, determine the values you want to use for the start of the Magnify effect and the maximum value of the magnify effect and write an expression for that. Take a look at the graph editor and check out the values of the Both Channels slider and make a decision. Here's an example:

Screenshot_2019-05-05 00.23.54_Qztgsl.png

I decided that the Magnify effect should start at .7 and reach the max value when the value of the Both Channels slider reaches 1.75. Now the expression looks like this:

t = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");

ease(t, .8, 1.75, 100, 150)

The Graph for magnify looks like this:

Screenshot_2019-05-05 00.33.22_AVlDT4.png

Magnify>Size now changes from 100 to 150. If I want to change the ratio or the reaction time I can simply change the tMin and tMax values or the value1 and value2 values for magnification.

That is a terrible tutorial. There are no explanations. It is a perfect example of a tutorial presented by an amateur that picked up some technique from the internet and copied the technique. It is about as useful as a Dollar Store Paint By Number book is at teaching you how to be an artist. You should spend a little time vetting the people you take advice from. You should also spend some time with the User Guide. That would have led you to the technique for expanding the error message so that it told you that it couldn't find the comp it was looking for.

Views

700

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Expression error 1 of 1 - Audio Spectrum Code

Community Beginner ,
May 04, 2019

Copy link to clipboard

Copied

This is so ridiculous. If you haven't watched the video I watched, the link: After Effects Tutorial: Audio Spectrum Effect in After Effects - No Plugin - YouTube

I did everything he stated, but on the last and final step when I entered the code:

value + (comp("Music").layer("Audio Amplitude").effect("Both Channels")("Slider")) / 5

It told me error in expression, and this code I assume makes the audio spectrum pop out with the drums/beat.

This is so frustrating because I literally have this project done and yet the code is holding me back, it's also the main problem for others according to this guys comment section. If anyone knows the ACTUAL code that WON'T give me an error message, that would be great. I'm sorry if I'm being a little hard on the person reading this but does anyone know the fix?

(Everyone thinks they know the real code but none of them work)

Screenshot (416).png

[Here is the list of all Adobe forums... https://forums.adobe.com/welcome]

[Comments is to ask about the operation of the Forum, not a specific program]

[Moved from the Comments forum to the specific Program forum... Mod]

[What Adobe page sent you to Comments instead of After Effects?]

Adobe Community Professional
Correct answer by Rick Gerard | Adobe Community Professional

OussK, the error is not a Javascript or syntax error. The expression is looking for a composition named Music. DouglasAnderson111,  you don't have a comp named Music in the Project Panel. If you can find the comp and re-name it or create the Music Comp, and the music comp contains a layer Called Audio Spectrum, and that layer has an effect named Both Channels the error will go away. Let's take a closer look at the expression:

Screenshot_2019-05-04 23.46.02_WQ8gmV.png

All you have to do is find or create the Music comp and make sure the name is spelled correctly.

A cleaner technique would have been to apply the Keyframe Assistant>Audio to Keyframes tool to the audio track in the main comp and work the Magnify effect right in the main comp. There is no reason to create a separate comp with a duplicate of the audio channel. The other problem with the technique is that you will not be able to find the comp the expression is referring to by using the flow chart. It is never a good idea to have a comp in a project that can't be easily found.

A better approach would be to use the ease(t, tMin, tMax, value1, value2) method to modify the values of the slider in the Audio Amplitude layer. If you really wanted to create a ghost comp that is only referred to by an expression and that is not discoverable in a flowchart, then you can do that, but the best approach is to look at the graph editor with the Both Channels property selected, determine the values you want to use for the start of the Magnify effect and the maximum value of the magnify effect and write an expression for that. Take a look at the graph editor and check out the values of the Both Channels slider and make a decision. Here's an example:

Screenshot_2019-05-05 00.23.54_Qztgsl.png

I decided that the Magnify effect should start at .7 and reach the max value when the value of the Both Channels slider reaches 1.75. Now the expression looks like this:

t = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");

ease(t, .8, 1.75, 100, 150)

The Graph for magnify looks like this:

Screenshot_2019-05-05 00.33.22_AVlDT4.png

Magnify>Size now changes from 100 to 150. If I want to change the ratio or the reaction time I can simply change the tMin and tMax values or the value1 and value2 values for magnification.

That is a terrible tutorial. There are no explanations. It is a perfect example of a tutorial presented by an amateur that picked up some technique from the internet and copied the technique. It is about as useful as a Dollar Store Paint By Number book is at teaching you how to be an artist. You should spend a little time vetting the people you take advice from. You should also spend some time with the User Guide. That would have led you to the technique for expanding the error message so that it told you that it couldn't find the comp it was looking for.

Views

701

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
May 04, 2019 0
Adobe Community Professional ,
May 04, 2019

Copy link to clipboard

Copied

i think this because the new Java script engine in the latest AE so try to use the legacy ExtendScript,

go to file/project settings and follow the below screen

Screen Shot 2019-03-31 at 8.49.26 PM.png

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 04, 2019 0
Community Beginner ,
May 05, 2019

Copy link to clipboard

Copied

Changed it to Legacy before, doesn't work.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 05, 2019 0
Adobe Community Professional ,
May 05, 2019

Copy link to clipboard

Copied

OussK, the error is not a Javascript or syntax error. The expression is looking for a composition named Music. DouglasAnderson111,  you don't have a comp named Music in the Project Panel. If you can find the comp and re-name it or create the Music Comp, and the music comp contains a layer Called Audio Spectrum, and that layer has an effect named Both Channels the error will go away. Let's take a closer look at the expression:

Screenshot_2019-05-04 23.46.02_WQ8gmV.png

All you have to do is find or create the Music comp and make sure the name is spelled correctly.

A cleaner technique would have been to apply the Keyframe Assistant>Audio to Keyframes tool to the audio track in the main comp and work the Magnify effect right in the main comp. There is no reason to create a separate comp with a duplicate of the audio channel. The other problem with the technique is that you will not be able to find the comp the expression is referring to by using the flow chart. It is never a good idea to have a comp in a project that can't be easily found.

A better approach would be to use the ease(t, tMin, tMax, value1, value2) method to modify the values of the slider in the Audio Amplitude layer. If you really wanted to create a ghost comp that is only referred to by an expression and that is not discoverable in a flowchart, then you can do that, but the best approach is to look at the graph editor with the Both Channels property selected, determine the values you want to use for the start of the Magnify effect and the maximum value of the magnify effect and write an expression for that. Take a look at the graph editor and check out the values of the Both Channels slider and make a decision. Here's an example:

Screenshot_2019-05-05 00.23.54_Qztgsl.png

I decided that the Magnify effect should start at .7 and reach the max value when the value of the Both Channels slider reaches 1.75. Now the expression looks like this:

t = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");

ease(t, .8, 1.75, 100, 150)

The Graph for magnify looks like this:

Screenshot_2019-05-05 00.33.22_AVlDT4.png

Magnify>Size now changes from 100 to 150. If I want to change the ratio or the reaction time I can simply change the tMin and tMax values or the value1 and value2 values for magnification.

That is a terrible tutorial. There are no explanations. It is a perfect example of a tutorial presented by an amateur that picked up some technique from the internet and copied the technique. It is about as useful as a Dollar Store Paint By Number book is at teaching you how to be an artist. You should spend a little time vetting the people you take advice from. You should also spend some time with the User Guide. That would have led you to the technique for expanding the error message so that it told you that it couldn't find the comp it was looking for.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 05, 2019 2
Community Beginner ,
May 05, 2019

Copy link to clipboard

Copied

You're the freaking man. Rock on!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 05, 2019 0
New Here ,
Aug 20, 2020

Copy link to clipboard

Copied

This is still not working, do help me asap.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 20, 2020 0