29 lines
No EOL
637 B
Python
29 lines
No EOL
637 B
Python
from ..soundnode import *
|
|
|
|
class SinkNode(SoundNode):
|
|
|
|
def __init__(self, name, room):
|
|
|
|
super().__init__(name, room)
|
|
|
|
def calc_r_amps(self, t):
|
|
|
|
# This function returns volumes of each relevant freq
|
|
# at tick t
|
|
|
|
res = dict()
|
|
|
|
for source_node in self.wire_in:
|
|
for freq, vol in self.sample_r_amps_by_wire(source_node, t).items():
|
|
if not freq in res:
|
|
res[freq] = vol
|
|
else:
|
|
res[freq] += vol
|
|
|
|
for source_node in self.air_in:
|
|
for freq, vol in self.sample_r_amps_by_air(source_node, t).items():
|
|
if not freq in res:
|
|
res[freq] = vol
|
|
else:
|
|
res[freq] += vol
|
|
self.r_amps[t] = res |