79
79
def __init__(self, table, freq=1000, phase=0, interp=2, mul=1, add=0):
80
PyoObject.__init__(self)
80
PyoObject.__init__(self, mul, add)
81
81
self._table = table
83
83
self._phase = phase
84
84
self._interp = interp
87
85
table, freq, phase, interp, mul, add, lmax = convertArgsToLists(table, freq, phase, interp, mul, add)
88
86
self._base_objs = [Osc_base(wrap(table,i), wrap(freq,i), wrap(phase,i), wrap(interp,i), wrap(mul,i), wrap(add,i)) for i in range(lmax)]
91
return ['table', 'freq', 'phase', 'interp', 'mul', 'add']
93
88
def setTable(self, x):
95
90
Replace the `table` attribute.
234
229
def __init__(self, table, freq=1000, feedback=0, mul=1, add=0):
235
PyoObject.__init__(self)
230
PyoObject.__init__(self, mul, add)
236
231
self._table = table
237
232
self._freq = freq
238
233
self._feedback = feedback
241
234
table, freq, feedback, mul, add, lmax = convertArgsToLists(table, freq, feedback, mul, add)
242
235
self._base_objs = [OscLoop_base(wrap(table,i), wrap(freq,i), wrap(feedback,i), wrap(mul,i), wrap(add,i)) for i in range(lmax)]
245
return ['table', 'freq', 'feedback', 'mul', 'add']
247
237
def setTable(self, x):
249
239
Replace the `table` attribute.
314
304
def feedback(self, x): self.setFeedback(x)
306
class OscTrig(PyoObject):
308
An oscillator reading a waveform table with sample accurate reset signal.
310
Parentclass: PyoObject
314
table : PyoTableObject
315
Table containing the waveform samples.
317
Trigger signal. Reset the table pointer position to zero on
319
freq : float or PyoObject, optional
320
Frequency in cycles per second. Defaults to 1000.
321
phase : float or PyoObject, optional
322
Phase of sampling, expressed as a fraction of a cycle (0 to 1).
324
interp : int, optional
325
Choice of the interpolation method. Defaults to 2.
333
setTable(x) : Replace the `table` attribute.
334
setTrig(x) : Replace the `trig` attribute.
335
setFreq(x) : Replace the `freq` attribute.
336
setPhase(x) : Replace the `phase` attribute.
337
setInterp(x) : Replace the `interp` attribute.
338
reset() : Resets the reading pointer to 0.
342
table : PyoTableObject. Table containing the waveform samples.
343
trig : PyoObject, Trigger signal, reset pointer position to zero.
344
freq : float or PyoObject, Frequency in cycles per second.
345
phase : float or PyoObject, Phase of sampling (0 -> 1).
346
interp : int {1, 2, 3, 4}, Interpolation method.
348
See also: Osc, Phasor, Sine
352
>>> s = Server().boot()
354
>>> tab = SndTable(SNDS_PATH+"/transparent.aif")
355
>>> tim = Phasor([-0.2,-0.25], mul=tab.getDur()-0.005, add=0.005)
356
>>> rst = Metro(tim).play()
357
>>> a = OscTrig(tab, rst, freq=tab.getRate(), mul=.4).out()
360
def __init__(self, table, trig, freq=1000, phase=0, interp=2, mul=1, add=0):
361
PyoObject.__init__(self, mul, add)
366
self._interp = interp
367
table, trig, freq, phase, interp, mul, add, lmax = convertArgsToLists(table, trig, freq, phase, interp, mul, add)
368
self._base_objs = [OscTrig_base(wrap(table,i), wrap(trig,i), wrap(freq,i), wrap(phase,i), wrap(interp,i), wrap(mul,i), wrap(add,i)) for i in range(lmax)]
370
def setTable(self, x):
372
Replace the `table` attribute.
377
new `table` attribute.
381
x, lmax = convertArgsToLists(x)
382
[obj.setTable(wrap(x,i)) for i, obj in enumerate(self._base_objs)]
384
def setTrig(self, x):
386
Replace the `trig` attribute.
391
new `trig` attribute.
395
x, lmax = convertArgsToLists(x)
396
[obj.setTrig(wrap(x,i)) for i, obj in enumerate(self._base_objs)]
398
def setFreq(self, x):
400
Replace the `freq` attribute.
404
x : float or PyoObject
405
new `freq` attribute.
409
x, lmax = convertArgsToLists(x)
410
[obj.setFreq(wrap(x,i)) for i, obj in enumerate(self._base_objs)]
412
def setPhase(self, x):
414
Replace the `phase` attribute.
418
x : float or PyoObject
419
new `phase` attribute.
423
x, lmax = convertArgsToLists(x)
424
[obj.setPhase(wrap(x,i)) for i, obj in enumerate(self._base_objs)]
426
def setInterp(self, x):
428
Replace the `interp` attribute.
433
new `interp` attribute.
437
x, lmax = convertArgsToLists(x)
438
[obj.setInterp(wrap(x,i)) for i, obj in enumerate(self._base_objs)]
442
Resets current phase to 0.
445
[obj.reset() for i, obj in enumerate(self._base_objs)]
447
def ctrl(self, map_list=None, title=None, wxnoserver=False):
448
self._map_list = [SLMapFreq(self._freq),
449
SLMapPhase(self._phase),
451
PyoObject.ctrl(self, map_list, title, wxnoserver)
455
"""PyoTableObject. Table containing the waveform samples."""
458
def table(self, x): self.setTable(x)
462
"""PyoObject. Trigger signal. Reset pointer position to zero"""
465
def trig(self, x): self.setTrig(x)
469
"""float or PyoObject. Frequency in cycles per second."""
472
def freq(self, x): self.setFreq(x)
476
"""float or PyoObject. Phase of sampling."""
479
def phase(self, x): self.setPhase(x)
483
"""int {1, 2, 3, 4}. Interpolation method."""
486
def interp(self, x): self.setInterp(x)
316
488
class OscBank(PyoObject):
318
490
Any number of oscillators reading a waveform table.
425
597
self._arnda = arnda
426
598
self._fjit = fjit
430
600
table, freq, spread, slope, frndf, frnda, arndf, arnda, num, fjit, mul, add, lmax = convertArgsToLists(table, freq, spread, slope, frndf, frnda, arndf, arnda, num, fjit, mul, add)
431
601
self._base_objs = [OscBank_base(wrap(table,i), wrap(freq,i), wrap(spread,i), wrap(slope,i), wrap(frndf,i), wrap(frnda,i), wrap(arndf,i), wrap(arnda,i), wrap(num,i), wrap(fjit,i), wrap(mul,i), wrap(add,i)) for i in range(lmax)]
434
return ['table', 'freq', 'spread', 'slope', 'frndf', 'frnda', 'arndf', 'arnda', 'fjit', 'mul', 'add']
436
603
def setTable(self, x):
438
605
Replace the `table` attribute.
698
865
def __init__(self, table, freq=1, loop=0, interp=2, mul=1, add=0):
699
PyoObject.__init__(self)
866
PyoObject.__init__(self, mul, add)
700
867
self._table = table
701
868
self._freq = freq
702
869
self._loop = loop
703
870
self._interp = interp
706
871
table, freq, loop, interp, mul, add, lmax = convertArgsToLists(table, freq, loop, interp, mul, add)
707
872
self._base_objs = [TableRead_base(wrap(table,i), wrap(freq,i), wrap(loop,i), wrap(interp,i), wrap(mul,i), wrap(add,i)) for i in range(lmax)]
708
873
self._trig_objs = Dummy([TriggerDummy_base(obj) for obj in self._base_objs])
711
return ['table', 'freq', 'loop', 'interp', 'mul', 'add']
713
875
def setTable(self, x):
715
877
Replace the `table` attribute.
873
1035
def __init__(self, table, env, freq=100, frac=0.5, phase=0, interp=2, mul=1, add=0):
874
PyoObject.__init__(self)
1036
PyoObject.__init__(self, mul, add)
875
1037
self._table = table
877
1039
self._freq = freq
878
1040
self._frac = frac
879
1041
self._phase = phase
880
1042
self._interp = interp
883
1043
table, env, freq, frac, phase, interp, mul, add, lmax = convertArgsToLists(table, env, freq, frac, phase, interp, mul, add)
884
1044
self._base_objs = [Pulsar_base(wrap(table,i), wrap(env,i), wrap(freq,i), wrap(frac,i), wrap(phase,i), wrap(interp,i), wrap(mul,i), wrap(add,i)) for i in range(lmax)]
887
return ['table', 'env', 'freq', 'frac', 'phase', 'interp', 'mul', 'add']
889
1046
def setTable(self, x):
891
1048
Replace the `table` attribute.
1370
1515
def __init__(self, input, table, fadetime=0):
1371
1516
PyoObject.__init__(self)
1517
self._time_dummy = []
1372
1518
self._input = input
1373
1519
self._table = table
1374
1520
self._in_fader = InputFader(input)
1375
1521
in_fader, table, fadetime, lmax = convertArgsToLists(self._in_fader, table, fadetime)
1376
1522
self._base_objs = [TableRec_base(wrap(in_fader,i), wrap(table,i), wrap(fadetime,i)) for i in range(len(table))]
1377
1523
self._trig_objs = Dummy([TriggerDummy_base(obj) for obj in self._base_objs])
1524
self._time_objs = [TableRecTimeStream_base(obj) for obj in self._base_objs]
1380
return ['input', 'table', 'mul', 'add']
1526
def __getitem__(self, i):
1528
self._time_dummy.append(Dummy([obj for obj in self._time_objs]))
1529
return self._time_dummy[-1]
1530
return PyoObject.__getitem__(self, i)
1382
1532
def out(self, chnl=0, inc=1, dur=0, delay=0):
1383
1533
return self.play(dur, delay)
1648
1787
self._dur = dur
1649
1788
self._grains = grains
1650
1789
self._basedur = basedur
1653
1790
table, env, pitch, pos, dur, grains, basedur, mul, add, lmax = convertArgsToLists(table, env, pitch,
1654
1791
pos, dur, grains, basedur, mul, add)
1655
1792
self._base_objs = [Granulator_base(wrap(table,i), wrap(env,i), wrap(pitch,i), wrap(pos,i), wrap(dur,i),
1656
1793
wrap(grains,i), wrap(basedur,i), wrap(mul,i), wrap(add,i)) for i in range(lmax)]
1659
return ['table', 'env', 'pitch', 'pos', 'dur', 'grains', 'basedur', 'mul', 'add']
1661
1795
def setTable(self, x):
1663
1797
Replace the `table` attribute.
1879
2017
in_fader, in_fader2, table, fadetime, lmax = convertArgsToLists(self._in_fader, self._in_fader2, table, fadetime)
1880
2018
self._base_objs = [TrigTableRec_base(wrap(in_fader,i), wrap(in_fader2,i), wrap(table,i), wrap(fadetime,i)) for i in range(len(table))]
1881
2019
self._trig_objs = Dummy([TriggerDummy_base(obj) for obj in self._base_objs])
2020
self._time_objs = [TrigTableRecTimeStream_base(obj) for obj in self._base_objs]
1884
return ['input', 'trig', 'table', 'mul', 'add']
2022
def __getitem__(self, i):
2024
self._time_dummy.append(Dummy([obj for obj in self._time_objs]))
2025
return self._time_dummy[-1]
2026
return PyoObject.__getitem__(self, i)
1886
2028
def out(self, chnl=0, inc=1, dur=0, delay=0):
1887
2029
return self.play(dur, delay)
2063
2201
self._startfromloop = startfromloop
2064
2202
self._interp = interp
2065
2203
self._autosmooth = autosmooth
2068
2204
table, pitch, start, dur, xfade, mode, xfadeshape, startfromloop, interp, autosmooth, mul, add, lmax = convertArgsToLists(
2069
2205
table, pitch, start, dur, xfade, mode, xfadeshape, startfromloop, interp, autosmooth, mul, add)
2070
2206
self._base_objs = [Looper_base(wrap(table,i), wrap(pitch,i), wrap(start,i), wrap(dur,i), wrap(xfade,i), wrap(mode,i),
2071
2207
wrap(xfadeshape,i), wrap(startfromloop,i), wrap(interp,i), wrap(autosmooth,i), wrap(mul,i), wrap(add,i)) for i in range(lmax)]
2074
return ['table', 'pitch', 'start', 'dur', 'xfade', 'mode', 'xfadeshape', 'startfromloop', 'interp', 'autosmooth', 'mul', 'add']
2076
2209
def setTable(self, x):
2078
2211
Replace the `table` attribute.
2289
2422
return self._autosmooth
2290
2423
@autosmooth.setter
2291
2424
def autosmooth(self, x): self.setAutoSmooth(x)
2426
class TablePut(PyoObject):
2428
Writes values, without repetitions, from an audio stream into a DataTable.
2430
See `DataTable` to create an empty table.
2432
TablePut takes an audio input and writes values into a DataTable but
2433
only when value changes. This allow to record only new values, without
2436
The play method is not called at the object creation time. It starts
2437
the recording into the table until the table is full. Calling the
2438
play method again restarts the recording and overwrites previously
2441
Parentclass: PyoObject
2446
Audio signal to write in the table.
2448
The table where to write values.
2452
setInput(x, fadetime) : Replace the `input` attribute.
2453
setTable(x) : Replace the `table` attribute.
2454
play() : Start the recording at the beginning of the table.
2455
stop() : Stop the recording. Otherwise, record through the
2460
input : PyoObject. Audio signal to write in the table.
2461
table : DataTable. The table where to write values.
2465
The out() method is bypassed. TablePut returns no signal.
2467
TablePut has no `mul` and `add` attributes.
2469
TablePut will sends a trigger signal at the end of the recording.
2470
User can retrieve the trigger streams by calling obj['trig'].
2472
See also: DataTable, NewTable, TableRec
2476
>>> s = Server().boot()
2478
>>> t = DataTable(size=16)
2479
>>> rnd = Choice(range(200, 601, 50), freq=16)
2480
>>> rec = TablePut(rnd, t).play()
2481
>>> met = Metro(.125).play()
2482
>>> ind = Counter(met, max=16)
2483
>>> fr = TableIndex(t, ind, mul=[1,1.005])
2484
>>> osc = SineLoop(fr, feedback=.08, mul=.3).out()
2487
def __init__(self, input, table):
2488
PyoObject.__init__(self)
2491
self._in_fader = InputFader(input)
2492
in_fader, table, lmax = convertArgsToLists(self._in_fader, table)
2493
self._base_objs = [TablePut_base(wrap(in_fader,i), wrap(table,i)) for i in range(len(table))]
2494
self._trig_objs = Dummy([TriggerDummy_base(obj) for obj in self._base_objs])
2496
def out(self, chnl=0, inc=1, dur=0, delay=0):
2497
return self.play(dur, delay)
2499
def setMul(self, x):
2502
def setAdd(self, x):
2505
def setInput(self, x, fadetime=0.05):
2507
Replace the `input` attribute.
2512
New signal to process.
2513
fadetime : float, optional
2514
Crossfade time between old and new input. Defaults to 0.05.
2518
self._in_fader.setInput(x, fadetime)
2520
def setTable(self, x):
2522
Replace the `table` attribute.
2527
new `table` attribute.
2531
x, lmax = convertArgsToLists(x)
2532
[obj.setTable(wrap(x,i)) for i, obj in enumerate(self._base_objs)]
2536
"""PyoObject. Audio signal to write in the table."""
2539
def input(self, x): self.setInput(x)
2543
"""DataTable. The table where to write values."""
2546
def table(self, x): self.setTable(x)