From 82bce73030735492a017113f0486ebe8aae5fae6 Mon Sep 17 00:00:00 2001 From: amartin Date: Tue, 28 Aug 2007 11:58:27 +0000 Subject: Jam save/load --- (limited to 'Jam/Fillin.py') diff --git a/Jam/Fillin.py b/Jam/Fillin.py index f17fe01..8f31489 100644 --- a/Jam/Fillin.py +++ b/Jam/Fillin.py @@ -21,12 +21,16 @@ class Fillin: self.onsets = [] self.pitchs = [] self.playBackTimeout = None + self.loopId = 0 self.csnd = new_csound_client() def reset( self ): self.barCount = 0 self.gate = 0 + def setLoopId( self, id ): + self.loopId = id + def setProperties( self, tempo, instrument, volume, beats, reverb ): self.setTempo( tempo ) self.setInstrument( instrument ) @@ -70,11 +74,11 @@ class Fillin: def clear( self ): if self.notesList: for n in self.notesList: - self.csnd.loopDelete(n) + self.csnd.loopDelete(n, self.loopId) self.notesList = [] def handleClock( self ): - tick = self.csnd.loopGetTick() + tick = self.csnd.loopGetTick( self.loopId ) if tick < ( Config.TICKS_PER_BEAT / 2 + 1 ): if self.gate == 0: self.gate = 1 @@ -108,5 +112,5 @@ class Fillin: n = Note(0, x.trackId, i, x) self.notesList.append(n) i += 1 - self.csnd.loopPlay(n,1) #add as active + self.csnd.loopPlay(n,1, loopId = self.loopId ) #add as active -- cgit v0.9.1