Skip to main content
afshinr68
Participant
May 19, 2019
Answered

sync automatically Compositioin Durration to audio layer

  • May 19, 2019
  • 1 reply
  • 1856 views

Hi.

I want to sync composition duration with my Audio layer   automatically .

for example:  if may composition  and audio length  is 1 Minuet  and then i replace new Audio layer with 2 Minuets then composition Duration must be 2Minuets automatically.

what expression i need to write ?

Thanks.

This topic has been closed for replies.
Correct answer Rick Gerard

You can read out the length of any layer as well as grabbing in and out-point. The trick is to put this information to the time-remap or opacity of your non-audio composition. It's pretty easy, help yourself.

http://expressions.aenhancers.com/

*Martin


There is no direct connection between the length of the composition and the length of a layer in that composition. You cannot write an expression that changes the composition length to match the length of a layer because you cannot keyframe the length of a composition.

Depending on the complexity of your project the best you can hope for would be to develop a script that creates a composition from an audio layer inside a folder in the Project Panel that also contains all of the assets used in the composition. The script would create a new composition then add all of the assets and effects needed to create a new comp.

I assume that you may also be using the keyframe assistant to create keyframes from audio. That tool is also not connected in any way to expressions.

If your project is just a couple of layers and an audio track you can create animation presets that will apply all the effects to each layer individually. If the layers are solids or shape layers the workflow would then be to select the audio track in the Project Panel, select File>New Comp from Selected, make sure that no layers were selected in the timeline, and then apply (run) the animation presets you have saved.

1 reply

Jose Panadero
Community Expert
Community Expert
May 19, 2019

You can create a composition with the exact time of your audio file dropping the audio file from the ProjectPanel to the composition icon on the bottom of the Project Panel. No need to write an expression for this task.

afshinr68
afshinr68Author
Participant
May 19, 2019

thank you for your answer . but i want to create a music player template for users and i need all action will be automatically. 

Martin_Ritter
Legend
May 19, 2019

You can read out the length of any layer as well as grabbing in and out-point. The trick is to put this information to the time-remap or opacity of your non-audio composition. It's pretty easy, help yourself.

http://expressions.aenhancers.com/

*Martin