music-practice-tools / bbs-mixer

A simple web audio mixer
https://mixer.musicpracticetools.net
Other
0 stars 0 forks source link

Add peak floaters or text to meters #19

Open SteveALee opened 1 month ago

SteveALee commented 1 month ago

Which? Both?

SteveALee commented 1 month ago
  // bouncers left
      if (measurement > leftBouncer.measurement) {
      leftBouncer.measurement = measurement
      leftBouncer.opacity = 1
    } else {
      if (leftBouncer.opacity > 0.1) {
        // fade out
        leftBouncer.opacity = leftBouncer.opacity - 0.1
      } else {
        leftBouncer.opacity = 0
      }
      leftBouncer.measurement-- // make it fall
    }
    if (measurement > 0)
      ctx.fillRect(
        0,
        METERHEIGHT - leftBouncer.measurement * (METERHEIGHT / 100) - 2,
        METERWIDTH,
        leftBouncer.opacity,
      )