diff options
-rw-r--r-- | TamTamMini.activity/Config.py | 8 | ||||
-rw-r--r-- | common/Util/CSoundClient.py | 6 |
2 files changed, 8 insertions, 6 deletions
diff --git a/TamTamMini.activity/Config.py b/TamTamMini.activity/Config.py index 62aab60..6d164bb 100644 --- a/TamTamMini.activity/Config.py +++ b/TamTamMini.activity/Config.py @@ -78,7 +78,7 @@ for i in range(0,13): KIT_ELEMENT = tuple(KIT_ELEMENT) class Instrument: - def __init__( self, name, instrumentId, csoundInstrumentId, instrumentRegister, soundClass, category, loopStart, loopEnd, crossDur, kit = None ): + def __init__( self, name, instrumentId, csoundInstrumentId, instrumentRegister, soundClass, category, loopStart, loopEnd, crossDur, ampScale = 1, kit = None ): self.name = name self.instrumentId = instrumentId self.csoundInstrumentId = csoundInstrumentId @@ -88,6 +88,7 @@ class Instrument: self.loopStart = loopStart self.loopEnd = loopEnd self.crossDur = crossDur + self.ampScale = ampScale self.kit = kit #print (self.name, self.instrumentId, self.csoundInstrumentId, self.instrumentRegister, self.soundClass, self.category, self.loopStart, self.loopEnd, self.crossDur) @@ -108,9 +109,10 @@ instrumentDB = InstrumentDB.getRef() _nextInstrumentId = [0] INSTRUMENTS = {} def _addInstrument( name, csoundInstrumentId, instrumentRegister, soundClass, category, loopStart, loopEnd, crossDur, kit = None ): + ampScale = 1 if not QUICKLOAD or name[0:4] == "drum" or name in ["flute", "kalimba"]: # quick load - INSTRUMENTS[name] = Instrument( name, _nextInstrumentId[0], csoundInstrumentId, instrumentRegister, soundClass, category, loopStart, loopEnd, crossDur, kit ) - instrumentDB.addInstrumentFromArgs( name, name, instrumentRegister, loopStart, loopEnd, crossDur, name, FILES_DIR+"/Images/"+name+".png", [ category ] ) + INSTRUMENTS[name] = Instrument( name, _nextInstrumentId[0], csoundInstrumentId, instrumentRegister, soundClass, category, loopStart, loopEnd, crossDur, ampScale, kit ) + instrumentDB.addInstrumentFromArgs( name, name, instrumentRegister, loopStart, loopEnd, crossDur, ampScale, name, FILES_DIR+"/Images/"+name+".png", [ category ] ) _nextInstrumentId[0] += 1 diff --git a/common/Util/CSoundClient.py b/common/Util/CSoundClient.py index 969ee55..e626320 100644 --- a/common/Util/CSoundClient.py +++ b/common/Util/CSoundClient.py @@ -328,9 +328,9 @@ class _CSoundClientPlugin: rval[9] = decay rval[10]= filterType rval[11]= filterCutoff - rval[12]= instrument.loopStart - rval[13]= instrument.loopEnd - rval[14]= instrument.crossDur + rval[12]= float(instrument.loopStart) + rval[13]= float(instrument.loopEnd) + rval[14]= float(instrument.crossDur) if instrumentId2 != -1: instrument2 = Config.INSTRUMENTSID[instrumentId2] |