Skip to main content
ti.s.cavalcanti
Inspiring
April 30, 2018
Answered

Fade In/Out - Audio Expression

  • April 30, 2018
  • 2 replies
  • 3858 views

I have the expression below and wanted that the transition of audio between -192 and 0, and 0 to -192 be smooth during 2 seconds.

intro = comp("MASTER").layer("Control").effect("Intro")("Slider"); // example: results in 20

preview = comp("MASTER").layer("Control").effect("Preview")("Slider"); // example: results in 10

if(time < intro || time > preview) [-192,-192] else [0,0]; // the duration is 10 secs at 0 dB between 20 and 30 secs

How can I make a fade in, and also a fade out?

This topic has been closed for replies.
Correct answer Dan Ebberts

Something like thismaybe:

intro = comp("MASTER").layer("Control").effect("Intro")("Slider");

preview = comp("MASTER").layer("Control").effect("Preview")("Slider");

if (time < intro)

  linear(time,intro-2,intro,[-192,-192],[0,0])

else

  linear(time,preview-2,preview,[0,0],[-192,-192])

Dan

2 replies

Participant
July 7, 2023

How to automatically fade out audio

 

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
April 30, 2018

Something like thismaybe:

intro = comp("MASTER").layer("Control").effect("Intro")("Slider");

preview = comp("MASTER").layer("Control").effect("Preview")("Slider");

if (time < intro)

  linear(time,intro-2,intro,[-192,-192],[0,0])

else

  linear(time,preview-2,preview,[0,0],[-192,-192])

Dan

ti.s.cavalcanti
Inspiring
April 30, 2018

Sensational; thank you, Dan!