Mercurial > code > home > repos > light9
annotate Nodes/sine.py @ 51:71489bb71528
- Meet Fader. He is going to grow up and be a crossfader some day
- Meet Fader. He is going to grow up and be a crossfader some day
(tomarrow)
- Tkinter -> Tix so we can use ScrolledListBox which has a command
- Some improvements to Cue
- Cues need to specify their final values
- Cues are imported by subs. This should be fixed for style points.
- Some other cleanups
author | dmcc |
---|---|
date | Sun, 07 Jul 2002 15:40:45 +0000 |
parents | 45b12307c695 |
children |
rev | line source |
---|---|
0 | 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') |