class_docstr: The Spectrum_Visualizer visualizes spectral FFT data using a simple PyGame GUI
class_docstr_tok: ["The","Spectrum_Visualizer","visualizes","spectral","FFT","data","using","a","simple","PyGame","GUI"]
code: def plot_bars(self):
      bars, slow_bars, new_slow_features = [], [], []
      local_height = self.y_ext[1] - self.y_ext[0]
      feature_values = self.frequency_bin_energies[::-1]
  
      for i in range(len(self.frequency_bin_energies)):
          feature_value = feature_values[i] * local_height
  
          self.fast_bars[i][3] = int(feature_value)
  
          if self.plot_audio_history:
              self.fast_bars[i][3] = int(
                  feature_value + 0.02 * self.HEIGHT
              )
  
          if self.add_slow_bars:
              self.decay = min(
                  0.99,
                  1 - max(0, self.decay_speed * 60 / self.ear.fft_fps),
              )
              slow_feature_value = max(
                  self.slow_features[i] * self.decay, feature_value
              )
              new_slow_features.append(slow_feature_value)
              self.slow_bars[i][1] = int(
                  self.fast_bars[i][1] + slow_feature_value
              )
              self.slow_bars[i][3] = int(
                  self.slow_bar_thickness * local_height
              )
  
      if self.add_fast_bars:
          for i, fast_bar in enumerate(self.fast_bars):
              pygame.draw.rect(
                  self.screen, self.fast_bar_colors[i], fast_bar, 0
              )
  
      if self.plot_audio_history:
          self.prev_screen = self.screen.copy().convert_alpha()
          self.prev_screen = pygame.transform.rotate(
              self.prev_screen, 180
          )
          self.prev_screen.set_alpha(
              self.prev_screen.get_alpha() * self.alpha_multiplier
          )
  
      if self.add_slow_bars:
          for i, slow_bar in enumerate(self.slow_bars):
              pygame.draw.rect(
                  self.screen, self.slow_bar_colors[i], slow_bar, 0
              )
  
      self.slow_features = new_slow_features
  
      # Draw everything:
      self.screen.blit(
          pygame.transform.rotate(self.screen, 180), (0, 0)
      )
  
file_path: rt-audio-fft/src/visualizer.py
imports: import numpy
  import time, sys, math
  import pygame
  from collections import deque
  from src.utils import Button
  from matplotlib import cm
label_desc: Use image node_id 7 for calling the Spectrum_Visualizer obj's underlying member method code with example usage: obj.plot_bars() without return types