sonnum/core/nodes/sinenode.py
2025-08-10 23:55:07 +03:00

20 lines
343 B
Python

import math
from ..soundnode import SoundNode
class SineNode(SoundNode):
def __init__(self, freq, room):
super().__init__("sine", room)
self.freq = freq
self.active = False
self.volume = 1
def calc_r_amps(self, t):
if not self.active:
self.r_amps[t] = dict()
return
self.r_amps[t] = {self.freq: self.volume}