Skip to content

Commit

Permalink
Implementing lagged
Browse files Browse the repository at this point in the history
  • Loading branch information
josephine-wolf-oberholtzer committed Apr 21, 2024
1 parent ca4c4c7 commit a756bea
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions supriya/ugens/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2972,16 +2972,21 @@ def lagged(
lag_time_down: 1.5
"""
from . import Lag, LagUD, Lag2, Lag2UD, Lag3, Lag3UD
from . import Lag, Lag2, Lag2UD, Lag3, Lag3UD, LagUD

if factor not in [1, 2, 3]:
raise ValueError(factor)

if lag_time_down is None:
ugen = [Lag, Lag2, Lag3][factor - 1]
ugen: Type[UGen] = [Lag, Lag2, Lag3][factor - 1]
return _compute_ugen_map(self, cast(Type[UGen], ugen), lag_time=lag_time_up)
ugen = [LagUD, Lag2UD, Lag3UD][factor - 1]
return _compute_ugen_map(self, cast(Type[UGen], ugen), lag_time_up=lag_time_up, lag_time_down=lag_time_down)
return _compute_ugen_map(
self,
cast(Type[UGen], ugen),
lag_time_up=lag_time_up,
lag_time_down=lag_time_down,
)

def lin_rand(self) -> "UGenOperable":
"""
Expand Down

0 comments on commit a756bea

Please sign in to comment.