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 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=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 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()
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)
assert rate>0, "'rate' attribute must be greater than 0."
wx.Panel.__init__(self, parent, -1, pos, size)
self.SetMinSize((200,150))
self.SetBackgroundColour("#000000")
if signal == None:
self._sig = Sig([0 for i in range(nchnls)])
else:
self._sig = signal
self._chnls = len(self._sig)
self._chnl_space = 4
self._calcChnlHeight()
self._hzoom = 1
self._vzoom = 1
self.RUNNING = False
self._table = NewTable(rate, self._chnls)
self._tablerec = TableRec(self._sig, self._table)
self._trigDraw = TrigFunc(self._tablerec['trig'], self._processBuffer)
self._initPoints()
self._drawBackground()
self.Bind(wx.EVT_PAINT, self.OnPaint)
self.Bind(wx.EVT_CLOSE, self.OnQuit)
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)