Problem when using pow~ with oversampling
I programmed a few wave shaper and wave folder modules for my digital modular synthesizer. Because these modules can add lots of harmonics, they all use oversampling (implemented with poly~). They all work, except the most simple one.
See the attached ZIP file:
1. download the ZIP file
2. extract the ZIP file
3. open "test_power_shaper~.maxpat" in Max
4. see the instructions in the patch
What’s the problem?
Surprisingly, some other shapers I programmed use several pow~ objects and work normally (when tested one by one)
Tested with Max 6.0.7 on Windows 7 64-bit
It does work if you set poly~‘s resampling attribute to 0.
This reminds me this old topic:
and after one year, it doesn’t sound to have been corrected…
Thanks for your answer Patrick
But when the resampling attribute is set to zero, there are no more resampling filters. As far as I understand, these filters are anti-aliasing filters, though this is not clearly stated in the manual. I am using oversampling ONLY for reducing the aliasing when the synthesis introduces some frequencies that are higher than sample_rate/2, so turning these filters off is not really possible. Or do I have to program my own anti-aliasing filter, as you do in Pure Data? In this case, which kind of filter is recommended?
About the problem you mentioned with groove~, I confirm it still does not work either :(
To complicate things, I had some other problems with oversampling in Max (still when using poly~), but I don’t really want to post them immediately because it may confuse things a lot.
Seriously, removing aliasing can improve the sound a lot, and in some cases, I don’t know how to reduce aliasing besides "hardcore" oversampling and anti-aliasing filters.
Just a precision
From a musical result’s point of view, something is missing in the shaper I posted: the input signal (from -1 to 1) should be scaled between 0 and 1 before the shaper processing, and re-scaled between -1 and 1 after the shaper.
But this does not correct the problem
still no serious answer about this
and as I said I found other problems related to oversampling
makes me think it’s actually not possible to use oversampling in Max :(
did you report this to cycling74 bug reporting?
because to me it seems like a weird pow~ bug. all my other up/down antialiasing sampling works perfectly, but i cannot get your examples to work at all, just as you say.
no idea what it could be.
Today I tested it again (I check this regularly). It still does not work at all. In the attachment:
* "main2.maxpat" contains an FM oscillator processed into a ring modulator, both 16x oversampled; this patch works
* "main.maxpat" contains an FM oscillator processed into a power function waveshaper, both 16x oversampled; this patch does not work
Sorry for messy patches, I don’t have much time for making them look nice. But if there is a programming error, please tell me
I’m going to report the bug, good idea PID
By the way, what are these "high-quality resampling filters" mentioned in the reference manual? Are they used on the inputs or the outputs of the poly~ container?
AFAICT, it would appear to be an issue with vb.cheby~ If I add an extra outlet to this poly patcher it works again. So likely, the way vb.cheby~ makes use of input and output signals doesn’t take into account that the input may be reused as the output or something like that.
Please let us know if you can reproduce with a separate patcher that does not use vb.cheby~
----------begin_max5_patcher---------- 470.3ocyUtsaiCBDF9Z7SAhq8FADmCp20mippHrMaCQ1fEfSS2plm8kCgsoq 5AuIdSyM1leFC+74YF+bF.Up1wMH3Mv6f.vyY.PPxK.NLFfZY6pZXlPXHI+Q U4FTdbJKemMHq5s6gzj7OURqQ7KteJBcB9frruUHa31vJQdUz8xI0TncLa0Z g7gUZdkM5OBk3VIHo.6uUT3uRcOCu+ncUxZC6J5Vsf0j7inNZxxM+XFxK8RV l+R94cn2VNoZMu7o8PxLLFOAtDhg3IK+Wv.8cwPRMJYepiGY.xHdP5OWPTiv 3bw8eLulE3DgDuUL+z30zwDXgrDx+0rDJdDRRJRZF1Vd8Jmja8WwrVsnr2FK X.+4nCP9YVUoZa4x3AMvrHzFIzIjiR8E4KRr9rDpE3DMygSWbhoSWmjk78RV 5HPV50GY6TOt+76Ed9fcYrY.9z.K43FfgW006U92+0Lr4d82hIipWWkL7g9o 4vWcPM2XERlUnjGETwahYsntlKOtuWsvvJa3AOhe2uWC1NCvMjKlanCzMjKh aHCvMytXrYHtY5oZmXZMqqaKWaNrlAm3py2nz9gyyCCEx3vPUIRy2JRwuHnv ztZPqq.rWGKq1sbtq.xsOuj8a7.BqEA -----------end_max5_patcher-----------
The latest on this is that we have found a bug with NANs in pow~ and will have a fix in Max 6.1.7 for it
Thanks for your perseverance, and sorry for the inconvenience
Actually, upon further investigation, it turns out that it is from pow~ generating a nan with certain values and blowing up the recursive filters. Sorry for shifting the blame. We can squash nans in pow~ In a future update, but for now you might be able to solve by filtering input to pow and/or using bitsafe~