Cave Story Tribute Site Forums

Wedge of Cheese
Wedge of Cheese
Alright, so, according to my sources, during the last postathon, I left off saying that we were going to examine what I called "another more interesting and more important use of the Smoother device, which I didn't become aware of until quite a bit later". This is exactly what we'll do, once I go have lupper.
Wedge of Cheese
Wedge of Cheese
Since it's been a while, let's recap what exactly the Smoother does. It takes two inputs, a signal and a controller. During each sample frame, it does the following:

output+=(signal-output)*controller

Conceptually, what this means is that the output sort of "lags behind" the signal input, moving a certain fraction of the way to the signal input each sample frame. This fraction is, in fact, the controller input.

Recall that my original intent in making the Smoother device was to facilitate non-linear control envelopes (for things like pitch and volume). However, it later occurred to me that I could also put a sound wave through a smoother, and was curious as to how this might sound.

<a href='http://www.mediafire.com/?hejamcz7e2dwvsa' class='bbc_url' title='External link' rel='nofollow external'>http://www.mediafire...hejamcz7e2dwvsa</a>
That's a sawtooth wave put through a smoother, with varying controller values, as well as varying pitch and volume. If you examine the waveform in a program like Audacity or ptnoise, you can see how the shape looks like a somewhat "smoothed out" sawtooth wave.

Now, let's change our thinking of what the smoother is a bit. First, let's assume the controller input is a constant. Also, let's think of it as being a transformation of the function f, the input signal as a function of time (so, the output would be S(f), which itself would be a function of time). This means that it's a continuous function rather than a discrete set of sample frames. We can rewrite the line of code above in function notation, like so:

<a href='http://latex.codecogs.com/png.latex?\bg_white' class='bbc_url' title='External link' rel='nofollow external'>http://latex.codecog...latex?\bg_white</a> S(f)(t)=S(f)(t-\Delta t)+(f(t)-S(f)(t-\Delta t))\cdot k

Where k is the controller input constant and delta_t is the duration of a sample frame.
Let's define K to equal k/delta_t.

<a href='http://latex.codecogs.com/png.latex?\bg_white' class='bbc_url' title='External link' rel='nofollow external'>http://latex.codecog...latex?\bg_white</a> \\ S(f)(t)=S(f)(t-\Delta t)+(f(t)-S(f)(t-\Delta t))\cdot K\cdot\Delta t \\ \\ \frac{S(f)(t)-S(f)(t-\Delta t)}{\Delta t}=(f(t)-S(f)(t-\Delta t))\cdot K

To make it continuous, we take the limit as delta_t approaches 0, to get this differential equation:

<a href='http://latex.codecogs.com/png.latex?\bg_white' class='bbc_url' title='External link' rel='nofollow external'>http://latex.codecog...latex?\bg_white</a> \frac{\mathrm{d} }{\mathrm{d} t}S(f)(t)=(f(t)-S(f)(t))\cdot K

I was gonna do more, but my brain's all tired out from trying to figure out why the math wasn't working out (it turned out to be a really dumb little error) so I'll stop there for today.
Wedge of Cheese
Wedge of Cheese
Ugh, fuck the new system, seriously. Alright, I'll leave you to copypasta those equations into a LaTeX renderer... >_>
Lace
Lace
I assume s(f)(t) means s(f,t)?
Top