FadeIn Task

We're going to create a task that get's passed the variable %MYVOL and increases the media volume by 1 every so many seconds.

Create a New task named FadeIn

  1. Audio —>Media Volume: set as variable %MYVOL
  2. Task —> If: %MYVOL, less than, 11
    I like maximum volume at 11 but you can make it higher
  3. Variable —> Variable Add: %MYVOL, Value=1
  4. Task —> Wait: 10 seconds
  5. Task —> Goto Action: Number 1
  6. Task —> End If
  7. Variable —> Variable Clear: %MYVOL

Now we'll create a New Profile. Use whatever you like as the Name and Context. Only two steps are required to then execute this task in your profile.

  1. Variable —> Variable set: %MYVOl, To 1
  2. Task —> Perform Task: FadeIn

Ex:
For my alarm clock task i use a time context and start the android media player. It looks a little like this

  • Media Volume = level 0
  • Media Control = Toggle Pause
  • Variable Set = %MYVOL to 1
  • Perform Task = Fadein

Another way of accomplishing this:

Create a task called ChangeMediaVolume:

  • Variable -> Variable Set: %mediaVolume To: %VOLM - 1 [If: %VOLM > %par1]
  • Variable -> Variable Set: %mediaVolume To: %VOLM + 1 [If: %VOLM < %par1]
  • Audio -> Media Volume: Level %mediaVolume
  • Task -> Wait 50ms (more or less to taste)
  • Task -> Goto: Action Number 1 [If: %VOLM != %par1]

Then, when you "Perform Task ChangeMediaVolume" from within another task, set %par1 to your desired volume level. No matter what the volume currently is, it will "fade" to the desired level. You may need to set "Priority: 10" when you set up the "Perform Task" call. If you want to get real fancy, you can use %par2 for the "wait" parameter so you can generate various long or short fades.


Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License