Tuesday, February 10, 2015

Episode 10: sctweet 20131004 (POKEY filter simulation)

I did this over a year ago, but I must have forgotten to post it here...

mp3 file: capmikee_sctweet_20131004.mp3 (4.1 MB)
Full Supercollider source: play{i=Impulse;f=Stepper.kr(i.kr(5),0,[57,66],75,LFClipNoise.kr(2,12,7)).midicps;SetResetFF.ar(i.ar(f),i.ar(f.rotate*2));}// #sctweets (134 characters)

Inspired by the "high-pass filter" on the Atari POKEY chip and rendered using Supercollider, this is not 8-bit music but 1-bit music. No post-processing of any kind was applied before mp3 conversion, not even to remove DC offset.

A note on the POKEY "high-pass filter." For years I was mystified by what this effect actually does. It clearly has beating or sweep effects not consistent with its description in "De Re Atari." After looking at some waveforms, doing some experiments and reading the sparse information available online about the chip, I concluded that what it is actually doing is a sort of pulse-width modulation. This synth, I believe, will perfectly emulate the effect in Supercollider:

    var inputFreq = MouseX.kr(100, 1000, warp:1);
    var cutoffFreq = MouseY.kr(100, 1000, warp:1);
    var in = Impulse.ar(inputFreq);
    var modulator = Impulse.ar(cutoffFreq) + Impulse.ar(inputFreq, phase:0.5);
    SetResetFF.ar(in, modulator);

For the tweet, I have eliminated code that is only really relevant when the "cutoff" frequency is lower than the "input" frequency.

Twitter: @capmikee #sctweets #supercollider #sc140

No comments: