Spaces:
Running
Running
Commit
·
644e3c2
1
Parent(s):
d922102
feat: return direct and wet signals separately
Browse files- modules/fx.py +16 -11
modules/fx.py
CHANGED
@@ -907,10 +907,9 @@ class SendFXsAndSum(FX):
|
|
907 |
di = x
|
908 |
|
909 |
if len(self.params) == 0:
|
910 |
-
return reduce(
|
911 |
lambda x, y: x[..., : y.shape[-1]] + y[..., : x.shape[-1]],
|
912 |
map(lambda f: f(x), self.effects),
|
913 |
-
di,
|
914 |
)
|
915 |
|
916 |
def f(states, ps):
|
@@ -927,15 +926,21 @@ class SendFXsAndSum(FX):
|
|
927 |
),
|
928 |
)
|
929 |
|
930 |
-
return
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
939 |
|
940 |
|
941 |
class UniLossLess(nn.Module):
|
|
|
907 |
di = x
|
908 |
|
909 |
if len(self.params) == 0:
|
910 |
+
return di, reduce(
|
911 |
lambda x, y: x[..., : y.shape[-1]] + y[..., : x.shape[-1]],
|
912 |
map(lambda f: f(x), self.effects),
|
|
|
913 |
)
|
914 |
|
915 |
def f(states, ps):
|
|
|
926 |
),
|
927 |
)
|
928 |
|
929 |
+
return (
|
930 |
+
di,
|
931 |
+
reduce(
|
932 |
+
f,
|
933 |
+
zip(
|
934 |
+
self.effects,
|
935 |
+
[self.params[f"sends_{i}"] for i in range(len(self.effects) - 1)]
|
936 |
+
+ [None],
|
937 |
+
),
|
938 |
+
(
|
939 |
+
torch.zeros_like(x),
|
940 |
+
x.unsqueeze(0).expand(len(self.effects), -1, -1, -1),
|
941 |
+
),
|
942 |
+
)[0],
|
943 |
+
)
|
944 |
|
945 |
|
946 |
class UniLossLess(nn.Module):
|