aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraham Northup <grissess@nexusg.org>2018-09-25 18:47:35 -0400
committerGraham Northup <grissess@nexusg.org>2018-09-25 18:47:35 -0400
commit5afaac2cda949243a98849f6bf7c217a61fbc8e3 (patch)
tree8da97e49f9b3f6286f8966ec9c9d77d8fae9a1d9
parentec177bb81a2a6ab54e05118066364281ebccc318 (diff)
fixed crasher
-rw-r--r--broadcast.py8
-rw-r--r--client.py2
2 files changed, 7 insertions, 3 deletions
diff --git a/broadcast.py b/broadcast.py
index 80e4c59..bd607ca 100644
--- a/broadcast.py
+++ b/broadcast.py
@@ -261,7 +261,7 @@ for num in xrange(options.tries):
s.sendto(str(Packet(CMD.QUIT)), cl)
if options.silence:
for i in xrange(pkt.data[0]):
- s.sendto(str(Packet(CMD.PLAY, 0, 1, 1, 0.0, i)), cl)
+ s.sendto(str(Packet(CMD.PLAY, 0, 0, 0, 0.0, i)), cl)
if pkt.data[0] == OBLIGATE_POLYPHONE:
pkt.data[0] = 1
for i in xrange(pkt.data[0]):
@@ -729,7 +729,11 @@ for fname in args:
spin_phase = 0
if delta >= 0 and not options.spin:
if tap_func is not None:
- if delta >= options.tapper:
+ try:
+ delta_on = factor * min(thr.next_t for thr in threads.values() if thr.next_t is not None and thr.next_t != thr.cur_offt)
+ except ValueError:
+ delta_on = float('inf')
+ if delta_on >= options.tapper:
if options.verbose:
print 'TAP'
tap_func()
diff --git a/client.py b/client.py
index 2c21a9e..1420152 100644
--- a/client.py
+++ b/client.py
@@ -604,13 +604,13 @@ while True:
midi += (random.random() * 2 - 1) * options.chorus
freq = 440.0 * 2 ** ((midi - 69) / 12)
FREQS[voice] = freq
- CUR_PERIODS[voice] = 0.0
amp = pkt.as_float(3)
if options.clamp:
amp = max(min(amp, 1.0), 0.0)
AMPS[voice] = MAX * amp
EXPIRATIONS[voice] = time.time() + dur
if not (pkt.data[5] & PLF.SAMEPHASE):
+ CUR_PERIODS[voice] = 0.0
PHASES[voice] = 0.0
vrgb = [int(i*255) for i in colorsys.hls_to_rgb(float(voice) / STREAMS * 2.0 / 3.0, 0.5, 1.0)]
frgb = rgb_for_freq_amp(pkt.data[2], pkt.as_float(3))