Activity models the decay of perceived activity level over time. Can be used to track how active some playing interface is being used, and slowly winding down a process if it gets no playing attention.
decaytime |
time after which level will have decayed by -60dB. |
dt |
delta time at which model calculation steps happen |
a skipjack running the calculation
a minimum value below which energy is set to 0.
get and set decaytime, i.e. time after which level has decayed by -60dB.
get and set delta time at which model calculation steps happen.
the current activity level
play or stop skipjack that runs calculation.
add a value to current level. When current level is > 1, added level will be scaled down by 1/level.
val |
the value to add |
an action to perform after each calculation step. can be used for debugging, or informing related processes about level updates.
next model step: calculate new level based on dt and decaytime.