-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathOfflineBufferProcesses.sc
27 lines (27 loc) · 1.38 KB
/
OfflineBufferProcesses.sc
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
// adds 2 instance methods to the Buffer class: 'reverse' and 'chunkSwap'
+ Buffer {
mul { arg gain = -1.0;
if(bufnum.isNil) { Error("Cannot call % on a % that has been freed".format(thisMethod.name, this.class.name)).throw };
server.listSendMsg([\b_gen, bufnum, "mul", gain])
}
add { arg offset = 0.0;
if(bufnum.isNil) { Error("Cannot call % on a % that has been freed".format(thisMethod.name, this.class.name)).throw };
server.listSendMsg([\b_gen, bufnum, "add", offset])
}
removeDC { arg coef = 0.995;
if(bufnum.isNil) { Error("Cannot call % on a % that has been freed".format(thisMethod.name, this.class.name)).throw };
server.listSendMsg([\b_gen, bufnum, "removeDC", coef])
}
reverse {
if(bufnum.isNil) { Error("Cannot call % on a % that has been freed".format(thisMethod.name, this.class.name)).throw };
server.listSendMsg([\b_gen, bufnum, "reverse"])
}
chunkSwap { arg srcStartAt = 0, dstStartAt = -1, numFrames = 0;
if(bufnum.isNil) { Error("Cannot call % on a % that has been freed".format(thisMethod.name, this.class.name)).throw };
server.listSendMsg([\b_gen, bufnum, "chunkSwap", srcStartAt, dstStartAt, numFrames])
}
waveSetCopyTo { arg dstBuf, repetitions = 0;
if(bufnum.isNil) { Error("Cannot call % on a % that has been freed".format(thisMethod.name, this.class.name)).throw };
server.listSendMsg([\b_gen, dstBuf.bufnum, "waveSetCopyTo", bufnum, repetitions])
}
}