13 December, 2009

Quick Santa Claus rant.

A few ideas I'd like to express.

Christmas is coming. Y'know, that tradition which seems like a pagan tradition which was originally a Roman and/or Catholic tradition which coincided with a pagan tradition. That thing. Yeah. I just had a thought. But first, I have to make something clear.

If you're young enough to believe in Father Christmas / Santa Claus, you shouldn't be on the internet. So, to make sure that you don't accidentally see something you don't want to, I'm going to put some filler material in.

If you're going to make an Amiga MOD player, I have a few optimisation suggestions.

Firstly, pad your samples appropriately. If the sample length is 1 16-bit word, then you pad with 0s, otherwise you pad with the loop data. If you have a loop (that is, the sample length is NOT 1 16-bit word), then you duplicate the loop after the sample data. Once you've done that, add about 2500 bytes (1250 16-bit words) of padding.

Secondly, use a few 2D tables. Scream Tracker 3 uses one for translating waveforms through channel volumes. This would be rather impractical for 16-bit samples, but we aren't using 16-bit for .mod, are we? No, of course not. So we'll just use a 65*256 table (or *64 if we don't mind making a quick check to see if the volume is set to 64). Another idea I wrote down really only applies if you're mixing 8-or-so-channel MODs down to 4 channels on an Amiga, and that is to do a volume * volume table. 65*64 would be your best bet, while comparing if the two channel volumes are the same, unless you don't mind having a 65*128 table. You could also have another 65*64/65*128 table for selecting the actual volume.

Alternatively, if you're using an Amiga, you could do the 14-bit trick (set 0+1 to 64 and 2+3 to 1, then 2+3 hold the lower 6 bits while 0+1 hold the upper 8 bits) using two 65*256 tables. You could also do another 256*64 table for remapping the top and a 256 1D table for remapping the bottom when it gets around to adding stuff together. If you're working with 8-channel mods, you shouldn't have to clip for the bottom; however, the top will probably still need it.

Thirdly, you could use another table to clip your output volumes or something like that - this is probably most appropriate for non-Amiga MOD players. In a lot of cases, this is unnecessary, but if you're doing some reasonably advanced mixing, then this is probably the way to go.

And so on and so on.

I use the first two tricks in my J2ME MOD player. In doing so, I discovered that Blackberry phones suck at handling audio state signals. Oh well, at least it actually plays.

Blah.

E=mc^2.

(Actually, it's delta E = delta m . c^2.)

Still reading this? OK, here we go.

Christmas as we know it is pretty much... mess. A mess with the "Christ" label which the retailers can't seem to remove so they just skirt around the issue and basically say in their minds, "well it's just a name which doesn't actually mean anything". Their hearts? "La de da da I'm not listening (*tongue*)". However, what I've realised is that the retailers aren't the only issue.

Meet Mr Bribery. Mr Consumerism. Mr Claus.

The problem with naturalists is that they have to find some way to teach morals to their children. Santa Claus is one way of doing so. Hey, let's chop down a tree. Hey, let's decorate it. Hey, let's tell the kids that if they're good, they get gifts from Santa. No wait, make it that if they don't behave, then they won't get gifts from Santa.

So, uh, let's make that Mr Blackmail.

And everything's fine and dandy, and you're out there lying, and then eventually--

Midnight strikes. The kids are awake. Pretending to be asleep.

They hear you get out of bed and put the gifts in the lounge.

Game over. Your 10-or-so years of playing games with your children just to teach them at least to behave has, like Santa stuck in a burning fireplace, gone up in smoke.

Here's hoping that the tooth fairy and the Easter bunny have remained... Oh wait, those aren't behaviour bribes. Unless, of course, those have had a domino effect and now they don't believe a damn thing that teaches them at least good behaviour.

And, uh, yeah, we're about to go out to dinner soon. So, here's a couple of things you might be able to ponder: the Santa Claus effect on society, and how to make a really fast MOD player. Yeah.