Skip to content

Commit

Permalink
Fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
josiah-wolf-oberholtzer committed Mar 26, 2024
1 parent 5274d05 commit e67b6aa
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 17 deletions.
2 changes: 1 addition & 1 deletion supriya/ugens/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1295,7 +1295,7 @@ def __getitem__(self, i):
return UGenVector(*self._values[i])

def __len__(self) -> int:
return len(self._values)
return self._channel_count

def __repr__(self):
return f"<{type(self).__name__}.{self.calculation_rate.token}()>"
Expand Down
43 changes: 28 additions & 15 deletions supriya/ugens/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,17 +761,18 @@ def with_gate(self, attack_time=0.02, release_time=0.02):
synthdef:
name: ...
ugens:
- Control.ir:
out: 0.0
- In.ar:
bus: Control.ir[0:out]
- Control.kr: null
- Control.kr:
gate: 1.0
- Linen.kr:
gate: Control.kr[0:gate]
attack_time: 0.02
sustain_level: 1.0
release_time: 0.02
done_action: 2.0
- Control.ir:
out: 0.0
- In.ar:
bus: Control.ir[0:out]
- ExpRand.ir/0:
minimum: 0.01
maximum: 0.1
Expand Down Expand Up @@ -1050,6 +1051,7 @@ def with_input(self, feedback=False, private=False, windowed=False):
name: ...
ugens:
- Control.ir:
duration: 1.0
out: 0.0
- Line.kr:
start: 0.0
Expand Down Expand Up @@ -1108,6 +1110,7 @@ def with_input(self, feedback=False, private=False, windowed=False):
name: ...
ugens:
- Control.ir:
duration: 1.0
out: 0.0
- Line.kr:
start: 0.0
Expand Down Expand Up @@ -1306,11 +1309,12 @@ def with_output(
synthdef:
name: ...
ugens:
- Control.kr:
mix: 0.0
- Control.ir:
out: 0.0
- In.ar:
bus: Control.ir[0:out]
- Control.kr: null
- ExpRand.ir/0:
minimum: 0.01
maximum: 0.1
Expand Down Expand Up @@ -1355,11 +1359,12 @@ def with_output(
synthdef:
name: ...
ugens:
- Control.kr:
level: 1.0
- Control.ir:
out: 0.0
- In.ar:
bus: Control.ir[0:out]
- Control.kr: null
- ExpRand.ir/0:
minimum: 0.01
maximum: 0.1
Expand Down Expand Up @@ -1410,6 +1415,7 @@ def with_output(
name: ...
ugens:
- Control.ir:
duration: 1.0
out: 0.0
- Line.kr:
start: 0.0
Expand Down Expand Up @@ -1467,7 +1473,10 @@ def with_output(
synthdef:
name: ...
ugens:
- Control.kr:
level: 1.0
- Control.ir:
duration: 1.0
out: 0.0
- Line.kr:
start: 0.0
Expand All @@ -1476,12 +1485,11 @@ def with_output(
done_action: 2.0
- UnaryOpUGen(HANNING_WINDOW).kr:
source: Line.kr[0]
- In.ar:
bus: Control.ir[1:out]
- Control.kr: null
- BinaryOpUGen(MULTIPLICATION).kr:
left: UnaryOpUGen(HANNING_WINDOW).kr[0]
right: Control.kr[0:level]
- In.ar:
bus: Control.ir[1:out]
- ExpRand.ir/0:
minimum: 0.01
maximum: 0.1
Expand Down Expand Up @@ -1526,7 +1534,10 @@ def with_output(
synthdef:
name: ...
ugens:
- Control.kr:
level: 1.0
- Control.ir:
duration: 1.0
out: 0.0
- Line.kr:
start: 0.0
Expand All @@ -1535,15 +1546,14 @@ def with_output(
done_action: 2.0
- UnaryOpUGen(HANNING_WINDOW).kr:
source: Line.kr[0]
- BinaryOpUGen(MULTIPLICATION).kr:
left: UnaryOpUGen(HANNING_WINDOW).kr[0]
right: Control.kr[0:level]
- In.ar:
bus: Control.ir[1:out]
- BinaryOpUGen(MULTIPLICATION).ar:
left: In.ar[0]
right: UnaryOpUGen(HANNING_WINDOW).kr[0]
- Control.kr: null
- BinaryOpUGen(MULTIPLICATION).kr:
left: UnaryOpUGen(HANNING_WINDOW).kr[0]
right: Control.kr[0:level]
- ExpRand.ir/0:
minimum: 0.01
maximum: 0.1
Expand Down Expand Up @@ -2166,6 +2176,7 @@ def with_rand_id(self, rand_id=0):
ugens:
- Control.ir:
out: 0.0
rand_id: 23.0
- RandID.ir:
rand_id: Control.ir[1:rand_id]
- In.ar:
Expand Down Expand Up @@ -2417,7 +2428,10 @@ def with_silence_detection(self):
synthdef:
name: ...
ugens:
- Control.kr:
level: 1.0
- Control.ir:
duration: 1.0
out: 0.0
- Line.kr:
start: 0.0
Expand All @@ -2428,7 +2442,6 @@ def with_silence_detection(self):
source: Line.kr[0]
- In.ar:
bus: Control.ir[1:out]
- Control.kr: null
- ExpRand.ir/0:
minimum: 0.01
maximum: 0.1
Expand Down
2 changes: 1 addition & 1 deletion supriya/ugens/inout.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def _postprocess_kwargs(
if not isinstance(default, Sequence):
default = [default]
kwargs["default"] = list(
repeat_to_length([float(x) for x in default], len(self))
repeat_to_length([float(x) for x in default], self._channel_count)
)
return calculation_rate, kwargs

Expand Down

0 comments on commit e67b6aa

Please sign in to comment.