comparison attic/Nodes/sine.py @ 299:6931479b657a

Make attic, move a bunch of old files to it
author David McClosky <dmcc@bigasterisk.com>
date Mon, 20 Jun 2005 18:52:21 +0000
parents Nodes/sine.py@45b12307c695
children
comparison
equal deleted inserted replaced
298:d0f29e247af4 299:6931479b657a
1 """node that generates a sine wave"""
2
3
4 class SineGenerator(Node):
5 def op(self, input, output, stateaccess):
6
7 # input and output have names
8 output.sin = stateaccess.magnitude * math.sin(stateaccess.phase+input.time)
9
10 """
11 # dict-style access for names with spaces
12 output['sin'] = input['ti me']
13 # underscore magic for accessing names with spaces-- the port object makes
14 # this work
15 output.sin=input.ti_me
16
17 input.time = input.money
18 """
19
20 def getports(self):
21 return OutputPort('sin'), InputPort('time'), InputPort('money')