Achieving Serum's "Remap" warp mode

While we wait for Matt to reappear from his self-imposed exile and implement this feature properly (along with a custom waveshaper, please!), here’s a hack that I’ve never seen mentioned which allows you implement custom phase distortion curves by hand.

If you know Serum, you may know the “Remap” warp mode, which is in a certain sense the grand-daddy of all warp modes. Serum’s (and Vital’s) phase warp modes all essentially just manipulate the output phase of the oscillator relative to the input phase in different ways, and remap allows you to specify a custom curve that relates input phase to output phase using a multi-breakpoint envelope, rather than using a pre-specified curve.

I wished I could do this in Vital, being that Vital is a visually-oriented synth where so many things can be manipulated by drawing curves, but sadly I cannot. However, since Vital supports audio-rate modulation via its keytracked LFOs (which is amazing, by the way), we can hack this together using a couple of fun tricks, provided we are prepared to give up two LFOs to do it.

Imagine an oscillator in Vital as having a “playhead”, which scrubs linearly from the start of the current waveform to the end of it. The rate of this scrubbing is controlled by the frequency of the oscillator (typically, the note you are playing). What we want to achieve is to control the path that playhead takes as the oscillator completes its 0-1 loop of the playhead when it reproduces the note. In order to do that, the first thing we need to do is to cancel the automatic motion of the playhead, and we will use an LFO to do it.

STEP 1
(PIC 1)

Create an LFO with a reverse (1-0) linear ramp. Set it to Keytrack with a 0-semitone shift (it defaults to -12 semitones, or one octave below) and set smoothing to 0. Map this LFO’s output to the phase of the oscillator we wish to warp. (Note: for some reason, Vital treats a phase of 180 as “waveform start” based on the GUI visual of the waveform. I’m not sure why. Leave it as-is; don’t worry about the range, modulating 100% will wrap past 360 phase and keep going correctly, even if the visual doesn’t show it)

EDIT: This is actually wrong, be sure to set the Osc 1 phase to 0% as there are artifacts that will appear if you do not when using more complex waveforms. It’s just not apparent with the basic shapes, presumably due to their rotational symmetry.

If you play a note, and you did it correctly, you will hear nothing. That’s because we’re doing a complete cancellation of the automatic linear INCREASE that playing the oscillator produces; as Vital drives the “phase playhead” from 0 to 1, we’re forcing it to sum with a 1-0 signal, and it gets stuck at the start. That means it never leaves the waveform’s zero-crossing and just produces silence.

STEP 2
(PIC 2)

Now, we create a second LFO. This one is similar to the first; keytracked with a 0-semitone shift, no smoothing, mapped to phase with full intensity. But this one is an inverse of the first; a linear ramp from 0-1. If you did it right, the original waveform will be back again, playing as normal.

It might seem like we’ve accomplished nothing; we’ve modulated the phase one way, and modulated the phase in the opposite way, and now the effect is cancelled out. So what was the point?

Well, now we can think about the LFO 2 “ramp” as a 1:1 mapping between the “phase playhead position” coming in and the “phase playhead position” coming out. As we manipulate the points and curves of this LFO, we can create any arbitrary phase distortion we want* and see the results applied to the output waveform in real time.

(note: for best results, you may want to set phase randomization to 0% on the oscillator itself. Because the LFO phase is not randomized with the same seed as the oscillator, the distortion effect will change with each note

(PIC 3)

If you look closely at the waveform output in the above pictures, you can see how the curve defines where the parts of the basic sine wave will be “spit out” as we scrub through the wave shape with each oscillator cycle

*we are technically limited by the range of the LFO to a single phase cycle of the oscillator. Some warp modes, such as sync, get their effect from wrapping phase around past 360 multiple times. We can achieve this effect by drawing multiple complete ramps in the phase map but it will necessitate changing the curve already generated.

STEP 3

One limitation that this method has is that modulating the amount of this phase distortion is a bit cumbersome, as we can’t automate LFO points directly (another feature request, wink wink), meaning manipulating the way that the phase distortion comes out is limited. We can use the mod remap to fade both LFO mappings so that our manual phase playhead is replaced by the ordinary one (as we remove the cancellation effect) but this limits how the phase transition is applied.

If we want more control, what we can do is replace the LFO playhead with a waveform playhead from an oscillator, using the FM distortion knob.

To begin, remove the LFO 2 mapping from Osc 1’s phase. Now, use a line source to make a wavetable in Osc 2 that draws a ramp from 0 to 1. NOT from -1 to 1, mind you. From unity/middle to maximum only. Make sure you uncheck DC offset and normalize; we are not drawing a waveform here, but a control signal, and we need the range to be absolute. Also make sure you turn this oscillator’s level down to 0 so that you don’t blast your speakers with DC offset.

From here, set Osc 1 to “FM from 2” and the amount slider to 40.65 (I have no idea why, this has something to do with the total range covered by the FM knob, which exceeds the 0-1 range you might expect, but this is the closest decimal approximation to the reproduced waveform). This works because FM in Vital, as in most synths, is not TRUE “Frequency Modulation” but instead phase modulation. In essence, it uses an oscillator to do what we’ve already been doing, though it combines the resultant phase offset with the oscillator’s usual “phase playhead” instead of replacing it.

(PIC 4)

Now you should have your original waveform back again. But what we can do this time is use keyframes in the wavetable to “manipulate LFO points”, adjusting how the playhead shape should deform over time between a linear ramp and our desired final result.

From here, you could save these wavetable shapes as presets and use them for various warp mode effects achieved by dragging/modulating the wavetable frame.

NOTE: New users are limited in images/pics so I’ve uploaded all 4 screenshots for this tutorial here, and marked the images in the text
https://imgur.com/a/89g7OWO

1 Like

A note here from experimentation: it seems there is some (unavoidable) aliasing that results from using the FM operator to accomplish this. I don’t know why, I suspect it has to do with Vital attempting to reinterpret Line Source wavetables harmonically? I get very, VERY pure results manipulating LFO 2 shape as described above, but attempting to accomplish the same thing using FM always results in some very subtle noise (sometimes not so subtle on very harmonically rich waveforms) in the output which can be seen with an oscilloscope even if not easily heard, at the moment where the waveform’s phase resets back to 0.

I’m currently experimenting with techniques that will allow me to “morph” an LFO shape from a ramp to some arbitrary shape in a modulatable way… but this would all be easier if LFO points could be automated. OR, of course, if a Remap modifier of this kind could be coded in as a phase distortion algorithm directly to Vital, which would be ideal (but less broadly useful than modulatable LFO points).

EDIT:

Two other notes:

  1. Your “phase cancelling” LFO 1 must start/end with the 1 point, and have the “mid” point stuffed at the end of the ramp at 0. If you start at 0 and use the “mid” point at the beginning for 1, you’ll get artifacts. Presumably there is a minimum time between LFO points (one sample, maybe?) so if your first two points go 0-1, then end back at 0 (rather than starting at one, then ending 0-1) it won’t sound right.

  2. If you decide to shift the oscillator in question, you will have to shift ALL of the oscillators in question. If Osc 1 is dropped by -12, you need to drop your phase cancelling LFO AND your playhead LFO (or FM oscillator) -12. If these are not kept in sync, the result is sometimes sonically interesting, but it won’t be a true representation of the phase distortion you have drawn.

1 Like

The noise is probably due to—I would expect—that LFOs are rendered as is but oscillators are likely to be rendered first into an array of numbers (sampled phase to amplitudes) once, then when playing it being resampled for each note. That would require filtering out all frequencies above the Nyquist, so perfect ramps, square waves and all angles in the waveform will be replaced with Gibbs ringing. On the other hand because LFOs aren’t usually sound sources, they can be rendered as is—moreso rendering them as is is the strategy we usually want. If it’s that way in Vital. I’d expect this of most synths.

Very nice writeout, thanks for making some things clear (and making a solid reference)! I heard about something like this but that was about just doing FM with a single LFO, not doing waveshaping in general, so I wouldn’t probably think about this at all despite knowing half of the things.

I suspect you’re correct re: waveforms-as-audible vs LFOs-as-data, but the effect does not improve noticeably with increased oversampling, at least that I was able to detect. Which is strange. Normally when doing stuff like this, that’s the case (e.g. doing audio-rate filter modulation in MSoundFactory, you get artifacts unless you bump the oversampling since the modulation of that knob is not explicitly oversampled or antialiased)

It may also be the case that it’s a float precision error with the FM knob… the knob doesn’t cover a nice clean 0-1 range, and if you go in and change it from, say, 40.65 to 40.647, there’s no effect that I can see. Normally FM is used for audible manipulation and not as a way of processing a control signal so it may not have a position that’s a super-precise “exactly one cycle” value.

Also, GAME CHANGER MOMENT, you can apparently map the same LFO to the same parameter multiple times, with unique remaps for each!

I didn’t realize this. So you only have to use one LFO to generate both the “Phase reverser” and the new desired phase curve. It also makes it much easier to keep your keytracked LFOs in tune.

You can also use multiple remaps to control “keyframes” of the phase distortion (i.e. 0%, 25%, 50%, 75%, 100%) and use a macro to build a multi-step crossfader between them. The results still aren’t as good as modulating the LFO points directly or using the Line Source editor, since they’re always vertical translations (not horizontal or some other shape) but since it only costs one LFO to do it it’s not so bad.

I still want to see if I can figure a way to get good results from the FM oscillator approach though… but I picked this technique up by watching a video where the same thing is done in Phase Plant, and in that video you can see some of the same cycle-point artifacts as well.

EDIT: Even with the artifacts, buried in a patch you don’t wind up really hearing it too badly and you can do some really nifty stuff with it. I made a patch just to sort of show off what is possible with the FM approach… less “correct” phase distortion but control over how the phase remapping behaves over time is far more powerful for all that. But the forums won’t let me upload it:
https://file.io/8F87cCw1IMnB

(just automating Phase Distortion amount from 0 to 100 twice)

Maybe the real feature request here should be more like “allow me to put an oscillator into ‘naive mode’ so I can do this properly”… and, for that, allow an oscillator to have a frequency of zero! Save me the LFO entirely!

1 Like

Oh wow, I didn’t ever think about that either! :open_mouth:

Related:

Instead of freezing your oscillator playhead and using a ramp to drive it via FM, you can freeze a ramp playhead and use your oscillator to drive it via FM. If you do this, instead of the ramp shape being a phase distortion curve, it’s a waveshaper curve. Albeit one which is forcibly asymmetric and you have to use a symmetric shape if you want symmetric waveshaping.

Pull your FM knob on the (frozen) ramp to about 25% maximum for this; below that value, it’s your “gain”. Above that value, it’s undefined (because a real waveshaper is not bounded except by clipping, a value cannot be “too loud”, but this cobbled-together one wraps back to -1 after a value exceeds 1). I think technically the signal “peaks” at 28.81% (after this is when the wrapping starts) but you get a lot of noise at that level, presumably because that’s where the ramp’s harmonic representation stops looking like a straight line in any meaningful way.

You can “hard clip” with a 0-slope line in your frozen ramp. Any negative-slope line in the ramp becomes a wavefolder, mirroring the wave back as the shape exceeds it.

Perhaps not as broadly useful as a phase distortion curve (and certainly not as useful as a custom waveshaper as a selectable distortion algorithm or filter drive algorithm, which would be ideal), mostly since it’s not responding to dynamics correctly, and also because (as with the phase distortion example) there are some artifacts on a “clean” signal. But it’s still interesting that you can achieve this result in this way.

1 Like

For those of us who unfortunately can’t use v1.5.x, can you please elaborate on the mod remap setup? I’ve tried my damnest, but I get dead spots when I’m trying to modulate between the default playhead and the lfo.