Skip to content

Commit

Permalink
Attempt to fix the bug when resetting sound waveforms.
Browse files Browse the repository at this point in the history
  • Loading branch information
sjara committed Feb 3, 2015
1 parent c819a24 commit 174c906
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions plugins/soundclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def create_sound(self,soundParams):
freqEachComp = np.logspace(np.log10(centerFreq/factor),np.log10(centerFreq*factor),nTones)
soundObj = pyo.Fader(fadein=self.risetime, fadeout=self.falltime,
dur=soundParams['duration'], mul=soundAmp)
soundwaveObjs = nTones*[None]
soundwaveObjs = []
for indcomp in range(nTones):
soundwaveObjs.append(pyo.Sine(freq=freqEachComp[indcomp],
mul=soundObj).mix(2).out())
Expand Down Expand Up @@ -210,7 +210,11 @@ def create_sound(self,soundParams):
def play_sound(self,soundID):
# FIXME: check that this sound has been defined
if USEJACK:
#self.soundwaves[soundID].reset() # Reset phase to 0
if isinstance(self.soundwaves[soundID],list):
for sw in self.soundwaves[soundID]:
sw.reset() # Reset phase to 0
else:
self.soundwaves[soundID].reset()
self.sounds[soundID].play()
else:
soundfile = '/tmp/tempsound.wav'
Expand Down

0 comments on commit 174c906

Please sign in to comment.