From 46e3316abd38001f86f3e8006a1c4d6f6e346f51 Mon Sep 17 00:00:00 2001 From: Oli Date: Sun, 04 Feb 2007 08:22:43 +0000 Subject: loading of snds after building interface --- (limited to 'Util/CSoundClient.py') diff --git a/Util/CSoundClient.py b/Util/CSoundClient.py index f70d6f2..0862282 100644 --- a/Util/CSoundClient.py +++ b/Util/CSoundClient.py @@ -184,23 +184,32 @@ class CSoundClientPlugin( CSoundClientBase ): self.on = False self.masterVolume = 80.0 + def load_instruments( self ): + for instrumentSoundFile in Config.INSTRUMENTS.keys(): + if instrumentSoundFile[0:3] == 'mic' or instrumentSoundFile[0:3] == 'lab': + fileName = Config.PREF_DIR + '/' + instrumentSoundFile + else: + fileName = Config.SOUNDS_DIR + "/" + instrumentSoundFile + instrumentId = Config.INSTRUMENT_TABLE_OFFSET + Config.INSTRUMENTS[ instrumentSoundFile ].instrumentId + sc_inputMessage( Config.CSOUND_LOAD_INSTRUMENT % (instrumentId, fileName) ) + def connect( self, init = True ): def reconnect(): - def load_instruments( ): - for instrumentSoundFile in Config.INSTRUMENTS.keys(): - if instrumentSoundFile[0:3] == 'mic' or instrumentSoundFile[0:3] == 'lab': - fileName = Config.PREF_DIR + '/' + instrumentSoundFile - else: - fileName = Config.SOUNDS_DIR + "/" + instrumentSoundFile - instrumentId = Config.INSTRUMENT_TABLE_OFFSET + Config.INSTRUMENTS[ instrumentSoundFile ].instrumentId - sc_inputMessage( Config.CSOUND_LOAD_INSTRUMENT % (instrumentId, fileName) ) +# def load_instruments( ): +# for instrumentSoundFile in Config.INSTRUMENTS.keys(): +# if instrumentSoundFile[0:3] == 'mic' or instrumentSoundFile[0:3] == 'lab': +# fileName = Config.PREF_DIR + '/' + instrumentSoundFile +# else: +# fileName = Config.SOUNDS_DIR + "/" + instrumentSoundFile +# instrumentId = Config.INSTRUMENT_TABLE_OFFSET + Config.INSTRUMENTS[ instrumentSoundFile ].instrumentId +# sc_inputMessage( Config.CSOUND_LOAD_INSTRUMENT % (instrumentId, fileName) ) if sc_start() : print 'ERROR connecting' else: self.on = True sc_setMasterVolume(self.masterVolume) - load_instruments() + #load_instruments() time.sleep(0.2) def disconnect(): if sc_stop() : -- cgit v0.9.1