Scriptnode square wave sounds really bad?
-
The square waveform in the scriptnode synth osc sounds really awful for me. Sounds like aliasing maybe?
When I compare the square waveform in the waveform generator I don't hear the same issues.
I also don't hear any issues when comparing the other waveforms.
Does this happen for anyone else?
Here is a simple project snippet
HiseSnippet 3132.3oc6bs0aaibElx1irkSxtY2j8BJ5C5gsEI.IBjCuihEwIw16Zz0IZsbytEn.FLRir3ZJRsjT1VaaeuuUzeC809ZetK5eh9ZesEn.8eP6Y3EyYzMSIKqHkXEf.OW3LmyYNW9Nb3LU88pSBB77EJT5vdcHBEtMpVO2vVOukksqvdaKT3CP0p6a2I7EdMHQMI7rdcrBBHMDJTX0uf1sBkVSH52+8IOyxwxsNIqJAgW4YWm7U1ssCyps5V+RaGmcsZPNztMSuU1Zu5dtO2ywqKPRqhDE5XU+DqiIuvh1sUPBEJtSC6PO+ZgVgj.gBq8LuF8p0x6L239+J6.6W6PnEjDpACTb0654zfRwzZEddKamFUSY8.AXPqlIHVMVPbez91Mrun9LAxciZnb1SvJOJrBO4sJG4IwRdhLj2PHoBLjzZwjT5RQVKT54Vn8bCI9Ms.wNKoD2WgB+H54dPGbCqz15Dxt9PgKdfGnIJ9nxv+8veQytt0Cs8bK649BuPxKcevC272tYoM+8aVt+lZ1bnsQmFeOGGh+PaltR6OtG7Atca+Zh+iJepkSWxEcDXedYJZzxT1k75wbMSG8b2y0N7kcHtiRQPHQTA+0uZussBsnKDI0A8qCwOzlRBE1lbJnUGurTBsMI3jPuNfd8.qYf1hWitNVg7pPT6ljF.Y.25FcwwMvNrGqc0LSuJuj3GfpZGVu0vowUFBMBRpqCZLwZ7NncZ1jTOLi.WCs62NGL8Pwy+lnm5Z4zKfjZykVThiFdVWfJ8qY+CL9z9wsp5CZKjyRzVRp9taUX0bSvRiWdcfW2Pa2i22Jz29bfleQ210.On0If3x0k3PMZJrBU8NtrHsLkHpQbaDU3+A+RZThVtPRiRoMxtlTJcMI1ESbTApX4SSpwEhUTlVMIvd.YzTFxnStCYj536QnIw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rjIvm
and here is a video link with spectrum analyzer
https://www.dropbox.com/scl/fi/8ut60cbsvgo4iqvqtp5h2/Square-Sound-Bad.mp4?rlkey=ocs2wwkihanq2pyd7t45iqi81&dl=0 -
@ally have you tried oversampling?
-
Hmm, I'm pretty sure that both oscillators are using the same band-limiting technique (Poly-BLEP), but the scriptnode one sounds like a naive waveform generator. I'll take a look, ideally they shouldn't sound this different.
-
Oops you were right, it was in fact using the naive waveform generation algorithm. It's fixed now and should sound just the same as the Waveform Generator.
-
@Christoph-Hart Awesome news! Thanks for looking into it.
-
@Lindon I did and it doesn't appear to work? If I try to add an oversample node I get an error message about oversampling not working with polyphonic scriptnodes. But I could be doing something wrong there...Did you use the scriptnode synth in your Horizen synth with oversampling?
-
@ally using per voice oversampling is hugely ineffective so it‘s deliberately deactivated.
You can enable a global oversampler with Engine.setMinimumSampleRate() if you need that but usually aliasing on the oscillator level should be fixed otherwise.