Very minor PEP8 formatting changes
This commit is contained in:
parent
e677742584
commit
b6551e04a2
@ -65,4 +65,4 @@ N_ROLLING_HISTORY = 2
|
|||||||
"""Number of past audio frames to include in the rolling window"""
|
"""Number of past audio frames to include in the rolling window"""
|
||||||
|
|
||||||
MIN_VOLUME_THRESHOLD = 1e-7
|
MIN_VOLUME_THRESHOLD = 1e-7
|
||||||
"""No music visualization displayed if recorded audio volume below threshold"""
|
"""No music visualization displayed if recorded audio volume below threshold"""
|
||||||
|
@ -27,7 +27,6 @@ class GUI:
|
|||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
N = 48
|
N = 48
|
||||||
gui = GUI(title='Test')
|
gui = GUI(title='Test')
|
||||||
|
|
||||||
# Sin plot
|
# Sin plot
|
||||||
gui.add_plot(title='Sin Plot')
|
gui.add_plot(title='Sin Plot')
|
||||||
gui.add_curve(plot_index=0)
|
gui.add_curve(plot_index=0)
|
||||||
@ -38,9 +37,8 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
while True:
|
while True:
|
||||||
t = time.time()
|
t = time.time()
|
||||||
x = np.linspace(t, 2 * np.pi + t, N);
|
x = np.linspace(t, 2 * np.pi + t, N)
|
||||||
gui.curve[0][0].setData(x=x, y=np.sin(x))
|
gui.curve[0][0].setData(x=x, y=np.sin(x))
|
||||||
gui.curve[1][0].setData(x=x, y=np.cos(x))
|
gui.curve[1][0].setData(x=x, y=np.cos(x))
|
||||||
gui.app.processEvents()
|
gui.app.processEvents()
|
||||||
time.sleep(1.0 / 30.0)
|
time.sleep(1.0 / 30.0)
|
||||||
|
|
||||||
|
@ -28,4 +28,4 @@ def update():
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
pixels *= 0
|
pixels *= 0
|
||||||
update()
|
update()
|
||||||
|
@ -129,7 +129,7 @@ def visualize_scroll(y):
|
|||||||
g = int(max(y[len(y) // 3: 2 * len(y) // 3]))
|
g = int(max(y[len(y) // 3: 2 * len(y) // 3]))
|
||||||
b = int(max(y[2 * len(y) // 3:]))
|
b = int(max(y[2 * len(y) // 3:]))
|
||||||
p = np.roll(p, 1, axis=1)
|
p = np.roll(p, 1, axis=1)
|
||||||
p*= 0.98
|
p *= 0.98
|
||||||
p = gaussian_filter1d(p, sigma=0.2)
|
p = gaussian_filter1d(p, sigma=0.2)
|
||||||
p[0, 0] = r
|
p[0, 0] = r
|
||||||
p[1, 0] = g
|
p[1, 0] = g
|
||||||
|
@ -30,7 +30,6 @@ Functions
|
|||||||
---------
|
---------
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
from numpy import abs, append, arange, insert, linspace, log10, round, zeros
|
from numpy import abs, append, arange, insert, linspace, log10, round, zeros
|
||||||
|
|
||||||
|
|
||||||
@ -88,7 +87,6 @@ def melfrequencies_mel_filterbank(num_bands, freq_min, freq_max, num_fft_bands):
|
|||||||
lower_edges_mel = frequencies_mel[:-2]
|
lower_edges_mel = frequencies_mel[:-2]
|
||||||
upper_edges_mel = frequencies_mel[2:]
|
upper_edges_mel = frequencies_mel[2:]
|
||||||
center_frequencies_mel = frequencies_mel[1:-1]
|
center_frequencies_mel = frequencies_mel[1:-1]
|
||||||
|
|
||||||
return center_frequencies_mel, lower_edges_mel, upper_edges_mel
|
return center_frequencies_mel, lower_edges_mel, upper_edges_mel
|
||||||
|
|
||||||
|
|
||||||
@ -132,7 +130,6 @@ def compute_melmat(num_mel_bands=12, freq_min=64, freq_max=8000,
|
|||||||
num_fft_bands
|
num_fft_bands
|
||||||
)
|
)
|
||||||
|
|
||||||
len_fft = float(num_fft_bands) / sample_rate
|
|
||||||
center_frequencies_hz = mel_to_hertz(center_frequencies_mel)
|
center_frequencies_hz = mel_to_hertz(center_frequencies_mel)
|
||||||
lower_edges_hz = mel_to_hertz(lower_edges_mel)
|
lower_edges_hz = mel_to_hertz(lower_edges_mel)
|
||||||
upper_edges_hz = mel_to_hertz(upper_edges_mel)
|
upper_edges_hz = mel_to_hertz(upper_edges_mel)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user