[sharing if fun] waveform morphing

    Apr 01 2009 | 10:47 pm
    This patch uses jit.buffer~s to mix 8 buffers into a single buffer~. I wanted to create an arbitrary mix of different waveforms for LFOs (or synthesis). This also has an example of linearly mixing between the waveforms, too. Has anyone out there come up with better ways (i.e., less patching) to do this? It would seem there are, but this is what I came up with.
    This patch uses Lror and Lmask from the Lobjects. Although I've attached both, you should probably just download the set http://arts.ucsc.edu/ems/music/research/Lobjects.readme.html Windows users will need to download the set, since I'm too lazy to start up my XP box and grab those for you. Also worth noting, the patch assumes the examples directory is in your search path, since waveforms from the examples/synths/FMsynth/lib are used for many of the buffer~s

    • Apr 02 2009 | 5:01 am
      How exactly does one read this? I checked out the lookup~ help file and all, and I've had success using the g17 Cheby stuff with peek~/lookup~ from the Percolate pack. Here's a patch that doesn't work, though.
      I tried it with a cycle~ instead of a phasor~ and that also didn't work--everything sounded like a sinusoid, whereas phasor~ even makes a sine wave (cosine, I think?) sound like it has a few harmonics. Very cool, though. I promise to use it.
    • Apr 02 2009 | 5:17 am
      cycle~ should make it easy. but, I am noticing that, at least in my beta version of max, the buffer "interp" that cycle~ plays doesn't update, even though I alter its contents (and the display window for "interp" updates).
    • Apr 02 2009 | 6:39 am
      Right, but even when I toggle dac~ to re-load the accurate waveform, I end up with a sine wave (if I have that full-power) that also has some higher harmonics, and they sound like just a blip every 512 samples. But when I begin with a sine wave-loaded buffer, then decrease the volume of "sine" on the multislider I get a pure sine wave, and "interp" reads a flat line.
      It seems that the buffer takes the waveform articulated in the multislider when you START the dac and adds that to the waveform that is currently visible in the multislider. This would be the only coherent explanation for why booting the dac with sine full (which gives a sine wave buffer to cycle~) gives a wave with harmonics, while then after decreasing the sine slider to 0 (giving a flat-0 buffer) causes a sine wave output (as 0 + sine = pure sine). This is from about 10-15 minutes of button-mashing, and I've never used Jitter, so who knows if there's not a stupid mistake in there.
      I'm on Max 5.0.6, latest public stable release OSX.5.6, MacBook Pro 2.4 Ghz PreSonus FireStudio through some nice speakers
    • Apr 02 2009 | 3:39 pm
      That's all very odd.Quote: But when I begin with a sine wave-loaded buffer, then decrease the volume of "sine" on the multislider I get a pure sine wave, and "interp" reads a flat line.
      This doesn't happen for me! What do you see in the o-scope? What do you see in the interp window? Does this match what you hear?
    • Apr 02 2009 | 10:13 pm
      hmmm...well, this could be a source of a problem on my end, using cycle~. I got this response from c74:Quote:Maybe we should document this, but you've never been able to use cycle~ for dynamic waveform interpolation, because, for optimization purposes, its wavetable is only updated when you turn on the audio. Use wave~ instead.
      So here it is with wave~:
    • Apr 02 2009 | 11:14 pm
      Fantastic. Yeah, I didn't realize how it would just sound like multiple waveforms combined, and how "noise" and "rand" would actually sound like a tone because of repeated playing of the same wavetable. I guess I should learn something about waves or whatever. Also, the artifacts are fixed in the sine wave. Thanks for your help.