diff options
| -rw-r--r-- | drums.py | 2 | ||||
| -rw-r--r-- | mkiv.py | 12 | 
2 files changed, 13 insertions, 1 deletions
| @@ -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)') @@ -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: | 
