phaser effect

    Aug 10 2011 | 7:10 pm
    I need some help on this one. I'm trying to build a phaser effect, but don't know how exactly this is supposed to work.
    What I've tried so far is line up four allpass objects and throw a chord through it. This delivers something that sounds like a phaser. But yet I don't know how to feed the signal back into the allpass filters. Should I use tapin~ tapout~ for this? And am I supposed to set different delay times for the allpass filters? Or is changing the delay time useless?
    Can someone explain?
    Here's what I've come up with for now:

    • Aug 10 2011 | 8:09 pm
      Hi Dave for a feedback loop, just use [send~] and [receive~]; scale the output of [receive~] by
      Varying the delaytime of the filters will take you into reverberation territory, leave them all at 0.
      I stand to be corrected (as my filter maths is weak), but using feedback filters with varying delays is for reverb building or for flanging/comb-filtering.
      Ps take care what you call subpatches/abstractions. DO NOT use MaxMSP native names (like allpass, for example). Max don't likee! I always use names such as "my_XXXXX"
      pps, nice sounding phaser btw, love your [phasor~] chord! Brendan
    • Aug 10 2011 | 10:05 pm
      Hey Brendan,
      Thanks. Not varying the delaytime of the allpass filter makes sense. I had some trouble visualising what the allpass filter actually does to a signal. But I think I've got it now.
      The feedback loop works now. What I tried with the tapin~ tapout~ was setting tapin~ to 0 and tapout~ to 1 by the way. Works equally well as the send~ and receive~ right?
      The phasor chord thing was actually copied from Miller Puckettes PD tutorial about the phaser effect. So all props to him.
    • Aug 10 2011 | 10:22 pm
      Hi I don't know what [tapin~ 0] would give you re frequency response, but [tapin~ 1] will give a delay of 1ms; [receive~] introduces a delay of one vector (measured in samples), dependent on how that is set in your DSP settings (mine is 64 samples). At a sample rate of 44.1kHz 64 samples is, erm, well you know the rest....1.45ms -ish.
      [tapin~] will not go lower than your vector size, and may well introduce other non-phaser pitch/spectrum effects, stick with [send~]/[receive~] in this context.
      Go here for my description of filters/delays formulae:
    • Aug 11 2011 | 9:04 am
      Ok. I thought this set up for the tapin~ tapout~ would give me a delay of exactly one vector size just like the send~ and receive~ does. But I'll stick to the send~ and receive~ just to be shure.
      Nice video. Good to see the algorithm of an allpass filter in a max msp patch. I can see now an allpass filter can be used as a notch comb filter. But I don't understand what happens exactly when you have no delay in the network at all.
    • Aug 11 2011 | 9:40 am
      it is only exact one vector when the delay time you set it to is smaller than one vector.
      but you (and noobmeister) mixed up in and out; it is [tapin~ 100] [tapout~ 0] not [tapin~ 0] [tapout~ 1].
      but however you make the delay, delays will never make a phasor.
    • Aug 11 2011 | 11:14 am
      Thanks Roman, you're right. But does this mean you can't make a phaser in MSP? That would be kind of a bummer.
    • Aug 11 2011 | 11:27 am
      maybe this is not your goal, but there are objects for phaserotation, so that you dont have to build it yourself. what was the name again ...
    • Aug 11 2011 | 12:38 pm
      check out [phaseshift~], it is what you need i think.
    • Aug 11 2011 | 5:03 pm
      I didn't know about phaseshift~. Nice object, but it doesn't really solve the feedback problem. I've searched around for externals but could only find multiallpass~. And that one's not available any more.
    • Aug 11 2011 | 5:54 pm
      Hi Are you hoping to achieve the 'classic' studio phaser sound of the 60's and 70's, as found in hardware racks and guitar pedals? Then I can't see why [allpass~] isn't sufficient. It will shift the phase of a signal's frequency content, dependent on the spectum of that source. Adding delay-times > 0. (as argument or input), as I said earlier, will transform the effect into flanging/comb-filtering/reverberation depending on delay-time range and how the filters are stacked. I suppose you could stack [phasorshift~] objects, and also use feedback. What's I'm not sure about though (as you are too I guess), is "if no delay time is specified for [allpass~] or [phaseshift~], does it fix to vectorsize delay?". Maybe post a new question.
      I adapted your original patch and got some really nice phasing on a variety of soundfiles (drums not so good tho, obviously).
    • Aug 11 2011 | 6:09 pm
      There's almost always going to be delay in feedback unless you want to really get into the arcana of delay-free loops; the question is whether you can make it negligible enough. You can always wrap your patch inside a poly~ set to run at a smaller vectorsize, so you could do a sample delay of 1 if you wanted to.
      Alternatively, you could take a more emprical approach; what does a phaser do? The key thing seems to be a set of moving notch filters. You could still include the phase-shifting, but focus on implementing the notch, and then worry about the shift.
      Here's a four-stage phaser. I'm using reson~ and -~ to create a notch filter (the inverse of a reson) because it's more efficient than using filtercoeff~ and biquad~. Notice that the feedback is negative, and relatively small. I also found that putting the phaseshift~ after the reson~ (just phase-shifting the bandpassed portion) gave me a more pronounced effect than putting it after the -~. Notice that this design has feedback in every stage. The idea was to emphasize the phase shift. (you could do global feedback)
      You could also make this more efficient. I would wrap the mtof~ objects into a poly~ and downsample it fairly severely. If you need interpolation, you can always throw slide~ on the outputs.
    • Aug 11 2011 | 8:24 pm
      I suddenly thought this delay of one vector size, introduced by the feedback loop, would create comb filters and affect the sound. But I guess it does not. So maybe it just works perfectly fine this way.
      And Peter, I like the tuneable notch filters. Definitely improves on the control over the sound. I think I should just fool around with what I've got here so far.
      Thanks for your help.
    • Aug 11 2011 | 8:38 pm
      Just to clarify: it does create comb filters (equal to vector size), and it does affect the sound, but it may be well within tolerable limits. Things are almost never clean in DSP; only clean enough.
      In my patch, I found that negativefeedback was substantially less comb-y than positive feedback because it pushed the first resonant peak further out (check out the Wikipedia page on comb-filters for graphs of positive and negative feedback). HTH.
    • Aug 11 2011 | 8:57 pm
      Never thought of using that. But does it change that much. Say I might play a bunch of different chords through the phaser. Then one would sound better with negative feedback the other with positive, no?
    • Aug 11 2011 | 9:23 pm
      It's definitely a matter of finding good test cases for your effect. Try several and see what works best. (and it may have to be a compromise solution)
      In the case of my example, it made a difference because the feedback tended to overly boost the low frequencies. You could try alternating the feedback as well; first stage is positive, second stage is negative, etc.
      The really great thing about Max is that it makes it easy to experiment, so play around with it and see what works. Also, remember that it's way easier to build for specific cases than general ones, so if you know what you're building it for, it only has to be good enough for that case.
    • Aug 12 2011 | 6:35 am
      i agree that putting [phaseshift~] in series will create almost what he was looking for with the feddback loop.
      otherwise teeth~ or allpass~ will of course also do it. or use 2 comb~ objects to build your own allpass.
      what will never go away is the minimum delay time of 1 vector, which is just not enough for this application.
      you will be able to build such things with max6, but for now try to work with comb, allpass, teeth ...