Problem when using pow~ with oversampling

    Oct 31 2012 | 1:17 pm
    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

    • Oct 31 2012 | 2:51 pm
      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...
    • Oct 31 2012 | 3:17 pm
      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.
    • Oct 31 2012 | 3:28 pm
      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
    • Feb 11 2013 | 10:39 am
      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 :(
    • Feb 11 2013 | 12:18 pm
      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.
    • Mar 13 2014 | 10:17 pm
      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?
    • Apr 07 2014 | 8:08 pm
      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~
    • Apr 08 2014 | 6:08 pm
      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
    • Apr 08 2014 | 6:11 pm
      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~