|
|
@@ -18,6 +18,7 @@ parser.add_option('-r', '--rate', dest='rate', type='int', default=44100, help='
|
|
|
parser.add_option('-u', '--uid', dest='uid', default='', help='User identifier of this client')
|
|
|
parser.add_option('-p', '--port', dest='port', default=13677, type='int', help='UDP port to listen on')
|
|
|
parser.add_option('-c', '--clamp', dest='clamp', action='store_true', help='Clamp over-the-wire amplitudes to 0.0-1.0')
|
|
|
+parser.add_option('--amp-exp', dest='amp_exp', default=2.0, type='float', help='Raise floating amplitude to this power before computing raw amplitude')
|
|
|
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)')
|
|
|
@@ -188,7 +189,7 @@ while True:
|
|
|
amp = options.volume * pkt.as_float(3)
|
|
|
if options.clamp:
|
|
|
amp = max(min(amp, 1.0), 0.0)
|
|
|
- PLAYING.append(SampleReader(rdata, dframes * 4, amp))
|
|
|
+ PLAYING.append(SampleReader(rdata, dframes * 4, amp**options.amp_exp))
|
|
|
if options.max_voices >= 0:
|
|
|
while len(PLAYING) > options.max_voices:
|
|
|
PLAYING.pop(0)
|