Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

equalizer get_color: Better thresholding devised by Nephirus

  • Loading branch information...
commit e05a43783f57cbc641325851f26dbe46347d324f 1 parent d98a98e
@pasky pasky authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 host_python/equalizer.py
View
9 host_python/equalizer.py
@@ -81,11 +81,14 @@ def print_usage():
frames_per_buffer = CHUNK_SIZE)
def get_color(volume):
- p = 1-15/(volume)
+ vol_thres = 200
+ if volume <= vol_thres: return (0, 0, 0)
+ p = 1-25/(volume-vol_thres)
if p <= 0: return (0, 0, 0)
+ if p >= 1: return (1.0, 1.0, 1.0)
# Monochromatic mode:
- # p = p * p * p * p * p * p * p
- # return (0, p/4, p) # or any other combination
+ #p = p * p * p * p * p * p * p
+ #return (p, p, 0) # or any other combination
if LAZY == 1:
p *= p
else:
Please sign in to comment.
Something went wrong with that request. Please try again.