28 lines
No EOL
511 B
Python
28 lines
No EOL
511 B
Python
from core.room import Room
|
|
from core.soundnode import SoundNode
|
|
|
|
R = Room()
|
|
R.left_sink.start_location = (-1, 0, 0)
|
|
R.right_sink.start_location = (2, 0, 0)
|
|
|
|
class SineNode(SoundNode):
|
|
|
|
def __init__(self, freq, room):
|
|
|
|
super().__init__("sine", room)
|
|
self.freq = freq
|
|
self.volume = 0.8
|
|
|
|
def frequency_max_rel_amp(self, f, t):
|
|
|
|
if f == self.freq:
|
|
return self.volume
|
|
|
|
return 0
|
|
|
|
sn = SineNode(440, R)
|
|
|
|
R.link_wire(sn, R.left_sink)
|
|
R.link_wire(sn, R.right_sink)
|
|
|
|
R.record('test5.wav', 0, 2) |