-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
35 lines (31 loc) · 721 Bytes
/
Copy pathtest.py
File metadata and controls
35 lines (31 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from strips.gui_strip import GuiStrip
from strips.led_strip import LEDStrip
import sounddevice as sd
import numpy as np
N = 300
FS = 44100
# duration = 10 # seconds
#
# #s = GuiStrip()
s = LEDStrip(N, "LEDZeppelin.local")
#
# sd.query_devices()
#
# def print_sound(indata, outdata, frames, time, status):
# volume_norm = np.linalg.norm(indata)
# res = int(np.interp(volume_norm, [0, 50], [0, 255]))
# s.setSame(res, 0, 0)
# s.update()
#
# # print ("|" * int(volume_norm))
#
# with sd.Stream(callback=print_sound, samplerate=FS):
# while True:
# test = np.random.randint(0, high=255, size=(150, 3))
# s.setStrip(test)
# s.update()
# sd.sleep(100)
#
s.white()
while True:
s.rainbow(0.01)