aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrissess <grissess@nexusg.org>2018-09-05 23:54:52 -0400
committerGrissess <grissess@nexusg.org>2018-09-05 23:54:52 -0400
commit44e1966aee28210facd2435a2289295eab157900 (patch)
tree9c278ad2c439a84ba7b4e70b7b2bbe64da16335c
parent5b9c97505fa359907d35d2dfed9fa49df27edf6d (diff)
Fixed drums, mkiv
mkiv now drops empty streams, avoiding a crasher in broadcast. drums now starts on the alternate port scanned by the broadcaster so as to not conflict with client.py.
-rw-r--r--drums.py2
-rw-r--r--mkiv.py12
2 files changed, 13 insertions, 1 deletions
diff --git a/drums.py b/drums.py
index d3c1a58..812b883 100644
--- a/drums.py
+++ b/drums.py
@@ -16,7 +16,7 @@ parser.add_option('-v', '--verbose', dest='verbose', action='store_true', help='
parser.add_option('-V', '--volume', dest='volume', type='float', default=1.0, help='Set the volume factor (nominally [0.0, 1.0], but >1.0 can be used to amplify with possible distortion)')
parser.add_option('-r', '--rate', dest='rate', type='int', default=44100, help='Audio sample rate for output and of input files')
parser.add_option('-u', '--uid', dest='uid', default='', help='User identifier of this client')
-parser.add_option('-p', '--port', dest='port', default=13676, type='int', help='UDP port to listen on')
+parser.add_option('-p', '--port', dest='port', default=13677, type='int', help='UDP port to listen on')
parser.add_option('--repeat', dest='repeat', action='store_true', help='If a note plays longer than a sample length, keep playing the sample')
parser.add_option('--cut', dest='cut', action='store_true', help='If a note ends within a sample, stop playing that sample immediately')
parser.add_option('-n', '--max-voices', dest='max_voices', default=-1, type='int', help='Only support this many notes playing simultaneously (earlier ones get dropped)')
diff --git a/mkiv.py b/mkiv.py
index 0c87372..b2384b1 100644
--- a/mkiv.py
+++ b/mkiv.py
@@ -651,6 +651,18 @@ for fname in args:
i += 1
print '...culled', ev_cnt, 'events'
+ print 'Culling empty streams...'
+ st_cnt = 0
+ for group in notegroups:
+ torem = set()
+ for ns in group.streams:
+ if not ns.history:
+ torem.add(ns)
+ st_cnt += len(torem)
+ for rem in torem:
+ group.streams.remove(rem)
+ print '...culled', st_cnt, 'empty streams'
+
if options.verbose:
print 'Final group mappings:'
for group in notegroups: