Added a new gamma table that seems to work better

This commit is contained in:
Scott Lawson 2016-11-07 17:43:31 -08:00
parent 404a216272
commit 81190a7f4c
2 changed files with 12 additions and 14 deletions

View File

@ -3,13 +3,13 @@ from __future__ import print_function
from __future__ import division from __future__ import division
import os import os
N_PIXELS = 240 N_PIXELS = 60
"""Number of pixels in the LED strip (must match ESP8266 firmware)""" """Number of pixels in the LED strip (must match ESP8266 firmware)"""
GAMMA_TABLE_PATH = os.path.join(os.path.dirname(__file__), 'gamma_table.npy') GAMMA_TABLE_PATH = os.path.join(os.path.dirname(__file__), 'gamma_table_2.npy')
"""Location of the gamma correction table""" """Location of the gamma correction table"""
UDP_IP = '192.168.1.150' UDP_IP = '192.168.0.150'
"""IP address of the ESP8266""" """IP address of the ESP8266"""
UDP_PORT = 7777 UDP_PORT = 7777
@ -18,7 +18,7 @@ UDP_PORT = 7777
MIC_RATE = 44100 MIC_RATE = 44100
"""Sampling frequency of the microphone in Hz""" """Sampling frequency of the microphone in Hz"""
FPS = 70 FPS = 75
"""Desired LED strip update rate in frames (updates) per second """Desired LED strip update rate in frames (updates) per second
This is the desired update rate of the LED strip. The actual refresh rate of This is the desired update rate of the LED strip. The actual refresh rate of
@ -30,15 +30,12 @@ the duration of the short-time Fourier transform. This can negatively affect
low frequency (bass) response. low frequency (bass) response.
""" """
MIN_FREQUENCY = 50
MIN_FREQUENCY = 5
"""Frequencies below this value will be removed during onset detection""" """Frequencies below this value will be removed during onset detection"""
MAX_FREQUENCY = 14000
MAX_FREQUENCY = 12000
"""Frequencies above this value will be removed during onset detection""" """Frequencies above this value will be removed during onset detection"""
ENERGY_THRESHOLD = 14.0 ENERGY_THRESHOLD = 14.0
"""Energy threshold for determining whether a beat has been detected """Energy threshold for determining whether a beat has been detected
@ -65,7 +62,7 @@ One downside to using a variance threshold is that it is an absolute threshold
which is affected by the current volume. which is affected by the current volume.
""" """
N_SUBBANDS = 60 # 240 #48 N_SUBBANDS = 10 # 240 #48
"""Number of frequency bins to use for beat detection """Number of frequency bins to use for beat detection
More subbands improve beat detection sensitivity but it may become more More subbands improve beat detection sensitivity but it may become more
@ -94,10 +91,11 @@ of previous data tends to work well.
GAMMA_CORRECTION = True GAMMA_CORRECTION = True
"""Whether to correct LED brightness for nonlinear brightness perception""" """Whether to correct LED brightness for nonlinear brightness perception"""
N_CURVES = 1
N_CURVES = 2
"""Number of curves to plot in the visualization window""" """Number of curves to plot in the visualization window"""
N_ROLLING_HISTORY = 10
"""Number of past audio frames to include in the rolling window"""
N_ROLLING_HISTORY = 8 MIN_VOLUME_THRESHOLD = 1e-7
"""Number of past audio frames to include in the rolling window""" """No music visualization displayed if recorded audio volume below threshold"""

BIN
python/gamma_table_2.npy Normal file

Binary file not shown.