From 9583b21dae8041c6544fb37de00ca42b034ebc98 Mon Sep 17 00:00:00 2001 From: Oli Date: Fri, 26 Oct 2007 05:50:30 +0000 Subject: miniT tabs cleanup, loop settings moved to Jam --- (limited to 'common/Util/InstrumentDB.py') diff --git a/common/Util/InstrumentDB.py b/common/Util/InstrumentDB.py index fd276ae..82c0e56 100644 --- a/common/Util/InstrumentDB.py +++ b/common/Util/InstrumentDB.py @@ -30,17 +30,17 @@ class Instrument: magic = f.readline()[:-1] if (magic != 'TamTam idf v1'): raise 'given file has wrong header' - self.name = f.readline() - self.csoundInstrumentId = f.readline() - self.register = f.readline() - self.loopStart = float( f.readline()) - self.loopEnd = float( f.readline()) - self.crossDur = float( f.readline()) - self.ampScale = float( f.readline()) + self.name = f.readline()[:-1] + self.csoundInstrumentId = float(f.readline()[:-1]) + self.register = f.readline()[:-1] + self.loopStart = float( f.readline()[:-1]) + self.loopEnd = float( f.readline()[:-1]) + self.crossDur = float( f.readline()[:-1]) + self.ampScale = float( f.readline()[:-1]) self.kit = None - self.wav = f.readline() - self.img = f.readline() - self.category = f.readline().split() + self.wav = f.readline()[:-1] + self.img = f.readline()[:-1] + self.category = f.readline() f.close() class InstrumentDB: @@ -68,16 +68,19 @@ class InstrumentDB: # add an instrument to the DB by reading from an instrument definition file def addInstrument( self, path ): + from common.Util.CSoundClient import new_csound_client + csnd = new_csound_client() i = Instrument(len(self.inst)) self.inst += [ i ] i.loadFromPath( path ) self.instNamed[ i.name ] = i - self.instId[self.instNamed[i].instrumentId] = i + self.instId[i.instrumentId] = i #print 'labelSet... ', self.labelSet self.labelSet['All'].add(i) if not self.labelSet.has_key(category): self.labelSet[category] = set([]) self.labelSet[category].add( i ) + csnd.load_instrument(i.name) # try to load each file in a given folder as an instrument def. file def scanInstrumentDir( self, path ): -- cgit v0.9.1