File: test~.pd_lua

package info (click to toggle)
pd-lua 0.12.23%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,912 kB
  • sloc: ansic: 3,733; lisp: 66; makefile: 64
file content (23 lines) | stat: -rw-r--r-- 558 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
local test = pd.Class:new():register("test~")

function test:initialize(sel, atoms)
  self.inlets = {SIGNAL}
  self.outlets = {SIGNAL}
  return true
end

function test:dsp(samplerate, blocksize, inchans)
  pd.post(string.format("samplerate: %d, block size: %d, input channels: %s",
    samplerate, blocksize, inchans[1]))
  self.blocksize = blocksize
  self:signal_setmultiout(1, 2)
end

function test:perform(in1)
  out1 = {}
  for i = 1, self.blocksize do
    out1[i] = in1[i + self.blocksize]
    out1[i + self.blocksize] = in1[i]
  end
  return out1
end