diff options
author | Oli <olivier.belanger@umontreal.ca> | 2007-10-09 05:42:59 (GMT) |
---|---|---|
committer | Oli <olivier.belanger@umontreal.ca> | 2007-10-09 05:42:59 (GMT) |
commit | 7400fb60ca6b454330996cc5b2c425b8c1e366c9 (patch) | |
tree | 00f74d6b7a4eca2245b782771296a688140dd679 /common/Util/CSoundClient.py | |
parent | d823a57aec432898701f136da37e7aecabf3ac34 (diff) |
work on meta algo, amplitude scaled on transposition
Diffstat (limited to 'common/Util/CSoundClient.py')
-rw-r--r-- | common/Util/CSoundClient.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/common/Util/CSoundClient.py b/common/Util/CSoundClient.py index 7a9e6e3..969ee55 100644 --- a/common/Util/CSoundClient.py +++ b/common/Util/CSoundClient.py @@ -5,6 +5,7 @@ import sys import threading import time import array +from math import sqrt import common.Config as Config @@ -301,19 +302,19 @@ class _CSoundClientPlugin: instrument_id_offset = 0 elif mode == 'edit': instrument_id_offset = 100 - + if instrument.csoundInstrumentId == Config.INST_SIMP: if mode == 'mini': instrument_id_offset = 0 elif mode == 'edit': - if instrument.soundClass == 'drum': + if instrument.name[0:4] == 'drum': instrument_id_offset = 0 else: instrument_id_offset = 100 - amplitude = amplitude * instrument.ampScale - print "%f * %f = %f" % (amplitude, instrument.ampScale, amplitude * instrument.ampScale) - print "instrument %s final amplitude: %f" % (instrument.name, amplitude) + amplitude = amplitude / sqrt(pitch) #instrument.ampScale + #print "%f * %f = %f" % (amplitude, instrument.ampScale, amplitude * instrument.ampScale) + #print "instrument %s final amplitude: %f" % (instrument.name, amplitude) rval[0] = (instrument.csoundInstrumentId + \ (trackId+1) + instrument_id_offset) + trackId * 0.01 rval[1] = onset |