Cracked sound generated when modulation enabled at high frequency
https://github.com/user-attachments/assets/9b397b33-b5a7-4327-8e7e-dd3660340584
Test midi: Crackedsound.zip
Possibly caused by out of range values in pcm multi, but not sure what the fix would be. https://github.com/nukeykt/Nuked-SC55/blob/205ff94eca4ae1f7f7e16de882dc72a251f71c98/src/pcm.cpp#L288-L301
EDIT: Can someone test this midi on real hardware and report what happens?
Gui got more development?
No, this is my own branch.
Possibly caused by out of range values in pcm multi, but not sure what the fix would be.
https://github.com/nukeykt/Nuked-SC55/blob/205ff94eca4ae1f7f7e16de882dc72a251f71c98/src/pcm.cpp#L288-L301
EDIT: Can someone test this midi on real hardware and report what happens?
I tested this out on my SC-88Pro and SC-55mkII, both do not produce this cracked sound. Tested it on the Nuked SC-55 running SC-55mkII roms, produces this cracked sound So it seems this is a Nuked SC-55 issue.
Seems to fix the problem for mk2:
diff --git a/src/pcm.cpp b/src/pcm.cpp
index 0cd1c29..b048fb0 100644
--- a/src/pcm.cpp
+++ b/src/pcm.cpp
@@ -1410,7 +1410,9 @@ void PCM_Update(uint64_t cycles)
int v1 = v2 + (mult2 >> 13) + ((mult2 >> 12) & 1); // 10
int subvar = v1 + (mult3 >> 6) + ((mult3 >> 5) & 1); // 11
- ram1[3] = v1;
+#define Clamp(v, x0, x1) (v < x0 ? x0 : v > x1 ? x1 : v)
+
+ ram1[3] = Clamp(v1, -0x80000, 0x7ffff);
int tests = test;
tests <<= 12;
@@ -1423,7 +1425,7 @@ void PCM_Update(uint64_t cycles)
int v4 = reg1 + (mult4 >> 6) + ((mult4 >> 5) & 1); // 14
int v5 = v4 + (mult5 >> 13) + ((mult5 >> 12) & 1); // 15
- ram1[1] = v5;
+ ram1[1] = Clamp(v5, -0x80000, 0x7ffff);
}
Here's an audio comparison before/after: CrackleFixRenders.zip
The crackling version seems to have a lot more noise overall but I think it's just reverb from the crackling. If you invert one of the tracks and play them simultaneously the only thing left is the crackling.
Kind of offtopic question: where did you get the version with GUI?
He said it was his own branch.
Gui is in my fork and can be downloaded here: https://github.com/mckuhei/Nuked-SC55/releases/tag/gui-v1.0
Seems to fix the problem for mk2:
diff --git a/src/pcm.cpp b/src/pcm.cpp index 0cd1c29..b048fb0 100644 --- a/src/pcm.cpp +++ b/src/pcm.cpp @@ -1410,7 +1410,9 @@ void PCM_Update(uint64_t cycles) int v1 = v2 + (mult2 >> 13) + ((mult2 >> 12) & 1); // 10 int subvar = v1 + (mult3 >> 6) + ((mult3 >> 5) & 1); // 11 - ram1[3] = v1; +#define Clamp(v, x0, x1) (v < x0 ? x0 : v > x1 ? x1 : v) + + ram1[3] = Clamp(v1, -0x80000, 0x7ffff); int tests = test; tests <<= 12; @@ -1423,7 +1425,7 @@ void PCM_Update(uint64_t cycles) int v4 = reg1 + (mult4 >> 6) + ((mult4 >> 5) & 1); // 14 int v5 = v4 + (mult5 >> 13) + ((mult5 >> 12) & 1); // 15 - ram1[1] = v5; + ram1[1] = Clamp(v5, -0x80000, 0x7ffff); }Here's an audio comparison before/after: CrackleFixRenders.zip
The crackling version seems to have a lot more noise overall but I think it's just reverb from the crackling. If you invert one of the tracks and play them simultaneously the only thing left is the crackling.
I'd propose merging this with master branch, no matter how specific this bug might be.