diff options
author | Oli <olivier.belanger@umontreal.ca> | 2007-10-20 17:25:17 (GMT) |
---|---|---|
committer | Oli <olivier.belanger@umontreal.ca> | 2007-10-20 17:25:17 (GMT) |
commit | cd62e6af4d8f4dda887f1aac15abb13128a7f447 (patch) | |
tree | 13fc523fa1f9d1555c7d235e3bf6c5a8bcfbaf25 /common/Util/CSoundClient.py | |
parent | 138653b35fe9ed1ccc651fd988fac4b14e83f71a (diff) |
removed csound table's load from startup
Diffstat (limited to 'common/Util/CSoundClient.py')
-rw-r--r-- | common/Util/CSoundClient.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/common/Util/CSoundClient.py b/common/Util/CSoundClient.py index c2ca4ff..b3729d8 100644 --- a/common/Util/CSoundClient.py +++ b/common/Util/CSoundClient.py @@ -14,6 +14,7 @@ from common.Util.Clooper.aclient import * from common.Util import NoteDB import common.Util.InstrumentDB as InstrumentDB +loadedInstruments = [] _note_template = array.array('f', [0] * 19 ) def _new_note_array(): @@ -98,6 +99,22 @@ class _CSoundClientPlugin: instrumentId = Config.INSTRUMENT_TABLE_OFFSET + self.instrumentDB.instNamed[ instrumentSoundFile ].instrumentId sc_inputMessage( Config.CSOUND_LOAD_INSTRUMENT % (instrumentId, fileName) ) + def load_instrument(self, inst): + if not inst in loadedInstruments: + fileName = Config.SOUNDS_DIR + "/" + inst + instrumentId = Config.INSTRUMENT_TABLE_OFFSET + self.instrumentDB.instNamed[ inst ].instrumentId + sc_inputMessage( Config.CSOUND_LOAD_INSTRUMENT % (instrumentId, fileName) ) + loadedInstruments.append(inst) + + def load_drumkit(self, kit): + if not kit in loadedInstruments: + for i in self.instrumentDB.instNamed[kit].kit.values(): + fileName = Config.SOUNDS_DIR + "/" + i + instrumentId = Config.INSTRUMENT_TABLE_OFFSET + self.instrumentDB.instNamed[ i ].instrumentId + sc_inputMessage( Config.CSOUND_LOAD_INSTRUMENT % (instrumentId, fileName) ) + loadedInstruments.append(i) + loadedInstruments.append(kit) + def connect( self, init = True ): def reconnect(): if sc_start(self.periods_per_buffer) : @@ -355,6 +372,6 @@ def new_csound_client(): _Client = _CSoundClientPlugin() _Client.connect(True) _Client.setMasterVolume(100.0) - _Client.load_instruments() + #_Client.load_instruments() time.sleep(0.2) return _Client |