File: simplecounter.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 (14 lines) | stat: -rw-r--r-- 355 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
local SimpleCounter = pd.Class:new():register("simplecounter")

function SimpleCounter:initialize(sel, atoms)
  self.inlets = 1
  self.outlets = 1
  self.count = 0
  if type(atoms[1]) == "number" then self.count = atoms[1] end
  return true
end

function SimpleCounter:in_1_bang()
  self:outlet(1, "float", {self.count})
  self.count = self.count + 1
end