Graham Northup 7 жил өмнө
parent
commit
5afaac2cda
2 өөрчлөгдсөн 7 нэмэгдсэн , 3 устгасан
  1. 6 2
      broadcast.py
  2. 1 1
      client.py

+ 6 - 2
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()

+ 1 - 1
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))