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