Is there any reason not to just store the entire sequence of samples? This `lastLast` thing is a bit hacky. Even if you are only using the last two to interpolate, this would get a lot more readable if you just store all the samples.