Tuesday, October 27, 2009

Analog Phaser first pass -- Code

Here's something that seems to work reasonably well. It's modeled after the MXR Phase180 type circuit. Typical JFET phaser. I have not modeled the nonlinear effects yet, as I'm contemplating a CPU-friendly way to do this. The technically correct way would make this a cycle hog as it requires the math functions are applied to every sample in every phase stage.

Here's the code:

Download and replace your existing Phaser.C and Phaser.h files in your working Rakarrack source directory and

$ su
# make
# make install

or for those with sudo user:
sudo make
sudo make install

Please notice that L/R crossing is unused in this version, and I have also disabled panning. I need to figure out a way to implement these that does not negatively effect the intensity of the phasing effect.

Here is a more detailed description of what this model attempts to accomplish.

The basic operation is derived from a bilinear transformation of a FET all-pass stage similar to what is found in the MXR phase180 stompbox, and the feedback network matches this circuit topology, but with more extreme settings available. The Rakarrack Phaser (imported from Paul Octavian) employs positive and negative feedback, where a setting of 64 is zero feedback. This feature has been maintained in the analog model. Some more complex analog phasers implement this kind of flexibility.

The modulation characteristic employs math to approximate the transfer function between modulation voltage at the JFET gate to small-signal resistance seen between the source and drain.

In its present form I have not included any input-dependent modeling to approximate the effect of distortion introduced by the JFET's, nor effects of random variance between JFET's that normally cause each stage to vary somewhat from the ideal case when JFET's are meticulously matched.

I may end up modeling the old Ross Phaser tri/sine modulation waveform. It's pretty interesting --- it has the sine wave shape for the negative half of the cycle and the triangle wave shape for the positive half cycle. It was an OTA-based phaser, so the application of this to my phaser model will be entirely unique, but this phaser model isn't supposed to sound like any specific analog phaser. It's just modeled according to typical analog circuit blocks. Just the fact that the number of phase stages can be modified with a click of a mouse makes it unique.

Here are the features that make it most like an Analog Phaser:
a) Wet/Dry mix performs the phase cancellation, so that 50% wet/dry results in the deepest filtering.
b)Turning more to wet generates that classic vibrato sound when the speed is turned up, so it can create a little bit of a pitch shift.
c) Modulation sweep has that effect of dwelling at the low end of the sweep, and then creates a fast "swoosh" when it "comes up for air".

All in all I think this could be a nicely flavored addition to Rakarrack when I am done twiddling and tweaking.

No comments:

Post a Comment