-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlooptest
More file actions
28 lines (21 loc) · 803 Bytes
/
looptest
File metadata and controls
28 lines (21 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from pyo import *
import os
# Audio inputs must be available.
s = Server(duplex=1).boot()
met = Metro(time=2).play()
# Path of the recorded sound file.
path = os.path.join(os.path.expanduser("~"), "Desktop", "synth.wav")
# Creates a two seconds stereo empty table. The "feedback" argument
# is the amount of old data to mix with a new recording (overdub).
t = NewTable(length=2, chnls=2, feedback=1)
# Retrieves the stereo input
inp = Input([0, 1])
def aloop():
# Table recorder. Call rec.play() to start a recording, it stops
# when the table is full. Call it multiple times to overdub.
rec = TableRec(inp, table=t, fadetime=0.05).play()
# Reads the content of the table in loop.
osc = Osc(table=t, freq=t.getRate(), mul=0.5).out()
func = TrigFunc(met,aloop)
func.play()
s.gui(locals())