Sfoglia il codice sorgente

Partial commit (sorry :( )

Grissess 10 anni fa
parent
commit
833f48aba6
2 ha cambiato i file con 6 aggiunte e 38 eliminazioni
  1. 6 32
      broadcast.py
  2. 0 6
      voice.py

+ 6 - 32
broadcast.py

@@ -320,7 +320,6 @@ for fname in args:
         for route in routeset.routes:
             print route
 
-<<<<<<< b1e54746e876a4ed485e2ed1bbc1d8b302e908ab
 class NSThread(threading.Thread):
         def drop_missed(self):
             nsq, cl = self._Thread__args
@@ -331,14 +330,10 @@ class NSThread(threading.Thread):
             if options.verbose:
                 print self, 'dropped', cnt, 'notes due to miss'
             self._Thread__args = (nsq, cl)
-=======
-    class NSThread(threading.Thread):
->>>>>>> Partial commit (last from cosi02!)
         def wait_for(self, t):
             if t <= 0:
                 return
             time.sleep(t)
-<<<<<<< b1e54746e876a4ed485e2ed1bbc1d8b302e908ab
 	def run(self):
 		nsq, cl = self._Thread__args
 		for note in nsq:
@@ -352,18 +347,6 @@ class NSThread(threading.Thread):
                         if options.verbose:
                             print (time.time() - BASETIME), cl, ': PLAY', pitch, dur, vel
 			self.wait_for(dur - ((time.time() - BASETIME) - factor*ttime))
-=======
-        def run(self):
-            nsq, cl = self._Thread__args
-            for note in nsq:
-                ttime = float(note.get('time'))
-                pitch = int(note.get('pitch'))
-                vel = int(note.get('vel'))
-                dur = factor*float(note.get('dur'))
-                while time.time() - BASETIME < factor*ttime:
-                    self.wait_for(factor*ttime - (time.time() - BASETIME))
-                s.sendto(str(Packet(CMD.PLAY, int(dur), int((dur*1000000)%1000000), int(440.0 * 2**((pitch-69)/12.0)), vel*2)), cl)
->>>>>>> Partial commit (last from cosi02!)
                 if options.verbose:
                     print (time.time() - BASETIME), cl, ': PLAY', pitch, dur, vel
                 self.wait_for(dur - ((time.time() - BASETIME) - factor*ttime))
@@ -382,21 +365,12 @@ class NSThread(threading.Thread):
         for thr in threads:
             print thr._Thread__args[1]
 
-    BASETIME = time.time()
-    for thr in threads:
-        thr.start()
+    BASETIME = time.time() - (options.seek*factor)
+    if options.seek > 0:
+        for thr in threads:
+            thr.drop_missed()
     for thr in threads:
-        thr.join()
-
-<<<<<<< b1e54746e876a4ed485e2ed1bbc1d8b302e908ab
-BASETIME = time.time() - (options.seek*factor)
-if options.seek > 0:
+            thr.start()
     for thr in threads:
-        thr.drop_missed()
-for thr in threads:
-	thr.start()
-for thr in threads:
-	thr.join()
-=======
+            thr.join()
     print fname, ': Done!'
->>>>>>> Partial commit (last from cosi02!)

+ 0 - 6
voice.py

@@ -114,9 +114,3 @@ class VSumMixer(Voice):
         self.voices = list(voices)
     def __call__(self, theta):
         return norm_amp(sum([i(theta) for i in self.voices]))
-
-class object(object):
-    def __init__(self):
-        this_obj = object()
-
-foo = object()