Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def reinit(self, signal, rate=1/25.):
self._tablerec.stop()
self._sig = signal
self._chnls = len(signal)
self._calcChnlHeight()
self._table = NewTable(rate, self._chnls)
self._tablerec = TableRec(self._sig*self._vzoom, self._table)
self._trigDraw = TrigFunc(self._tablerec['trig'], self._processBuffer)
self._drawBackground()
self.start()
def TableWrap(audio,duration):
'''
Records a PyoAudio generator into a sound table, returns a tableread object which can play the audio with .out()
'''
# Duration is in ms, so divide by 1000
# See https://groups.google.com/forum/#!topic/pyo-discuss/N-pan7wPF-o
#TODO: Get chnls to be responsive to NCHANNELS in prefs. hardcoded for now
#audio.play()
tab = pyo.NewTable(length=(float(duration)/1000),chnls=2) # Prefs should always be declared in the global namespace
tabrec = pyo.TableRec(audio,table=tab,fadetime=0.01).play()
sleep((float(duration)/1000))
tabread = pyo.TableRead(tab,freq=tab.getRate(), loop=0)
#audio.stop()
#tabrec.stop()
return tabread
def table_wrap(self, audio, duration=None):
'''
Records a PyoAudio generator into a sound table, returns a tableread object which can play the audio with .out()
'''
if not duration:
duration = self.duration
# Duration is in ms, so divide by 1000
# See https://groups.google.com/forum/#!topic/pyo-discuss/N-pan7wPF-o
# TODO: Get chnls to be responsive to NCHANNELS in prefs. hardcoded for now
tab = pyo.NewTable(length=(float(duration) / 1000),
chnls=prefs.NCHANNELS) # Prefs should always be declared in the global namespace
tabrec = pyo.TableRec(audio, table=tab, fadetime=0.005).play()
sleep((float(duration) / 1000))
self.table = pyo.TableRead(tab, freq=tab.getRate(), loop=0)
def table_wrap(self, audio, duration):
'''
Records a PyoAudio generator into a sound table, returns a tableread object which can play the audio with .out()
'''
# Duration is in ms, so divide by 1000
# See https://groups.google.com/forum/#!topic/pyo-discuss/N-pan7wPF-o
# TODO: Get chnls to be responsive to NCHANNELS in prefs. hardcoded for now
tab = pyo.NewTable(length=(float(duration) / 1000),
chnls=1) # Prefs should always be declared in the global namespace
tabrec = pyo.TableRec(audio, table=tab, fadetime=0.01).play()
sleep((float(duration) / 1000))
tabread = pyo.TableRead(tab, freq=tab.getRate(), loop=0)
return tabread
def table_wrap(self, audio, duration=None):
'''
Records a PyoAudio generator into a sound table, returns a tableread object which can play the audio with .out()
'''
if not duration:
duration = self.duration
# Duration is in ms, so divide by 1000
# See https://groups.google.com/forum/#!topic/pyo-discuss/N-pan7wPF-o
# TODO: Get chnls to be responsive to NCHANNELS in prefs. hardcoded for now
tab = pyo.NewTable(length=(float(duration) / 1000),
chnls=prefs.NCHANNELS) # Prefs should always be declared in the global namespace
tabrec = pyo.TableRec(audio, table=tab, fadetime=0.005).play()
sleep((float(duration) / 1000))
self.table = pyo.TableRead(tab, freq=tab.getRate(), loop=0)
tableread object which can play the audio with .out()
Args:
audio:
duration:
"""
if not duration:
duration = self.duration
# Duration is in ms, so divide by 1000
# See https://groups.google.com/forum/#!topic/pyo-discuss/N-pan7wPF-o
# TODO: Get chnls to be responsive to NCHANNELS in prefs. hardcoded for now
tab = pyo.NewTable(length=(float(duration) / 1000),
chnls=prefs.NCHANNELS) # Prefs should always be declared in the global namespace
tabrec = pyo.TableRec(audio, table=tab, fadetime=0.005).play()
sleep((float(duration) / 1000))
self.table = pyo.TableRead(tab, freq=tab.getRate(), loop=0)
def table_wrap(self, audio, duration=None):
'''
Records a PyoAudio generator into a sound table, returns a tableread object which can play the audio with .out()
'''
if not duration:
duration = self.duration
# Duration is in ms, so divide by 1000
# See https://groups.google.com/forum/#!topic/pyo-discuss/N-pan7wPF-o
# TODO: Get chnls to be responsive to NCHANNELS in prefs. hardcoded for now
tab = pyo.NewTable(length=(float(duration) / 1000),
chnls=prefs.NCHANNELS) # Prefs should always be declared in the global namespace
tabrec = pyo.TableRec(audio, table=tab, fadetime=0.005).play()
sleep((float(duration) / 1000))
self.table = pyo.TableRead(tab, freq=tab.getRate(), loop=0)