Thursday, October 12, 2006


20 GOTO 10

There you have it. The first kind of computer program I learned how to write. I could even do it in two versions. The one -WITH- a semi-colon would print horizontally, wrapping the text when it got the edge of the fabulous 80-column green or amber screen (IF YOU WERE LUCKY) or the TV (NOT SO LUCKY NOW, ARE YOU?) that you had your Tandy hooked to. OR -- if you left out the semi-colon then it would just print a single in-line column of your selected slogan.

Simple. Maybe that's why they called it BASIC.

Somewhere along the line, I learned PASCAL, as well. Shortly thereafter (along the line) I forgot anything at all about actually DOING Pascal. I do remember making a fully functional Minesweeper program in my fancy class, however. I also remember having Kingo help me with some part of an assignment and we got some kind of crazy error message upon running whatever the program was. We dug deep into the manual and found a reference to it - which stated specifically, "You should never see this error."

So yeah, even way back, I was perfectly adept at ruining the innards of computers.

Around about 1998, I stumbled upon VBScript. VBScript is an offshoot of Microsoft's Visual Basic language. Visual Basic is a souped up version of the old standby which I first learned - only now it has Windows form components so you can drag-n-drop buttons and text boxes and menus and assign some code to events - like when the user clicks on the "OK" button.

VBScript left out most of the GUI garbage and focused on getting shit done - shit in a "sneaking around behind the beast" way of administratinizing Windows machines.

I managed to cobble together some VBScript tools for my job and realized a new sense of satisfaction. Sure, they were simple tools but -- no one else had done it (and many had tried) and, most importantly, they fucking worked. In one instance my VBScript which took a few days of learning-while-coding saved the company a lot of money by negating the purchase of some outside tool.

I also played around a little bit with the full-fledge Visual Basic, but not much. And then I left that job and didn't touch any programming for the next 8 years.

Which brings me to my new job. I'm helpdesking, and over the course of any given day, I can be called on to execute the same task, or set of tasks, a number of times. Since I hate repetition of labor, my mind instantly starts churning and looking for a way to make it easier, faster, better, or more fun.

In the sense of most of the jobs I've had, the "more fun" option is the only one which ever seems feasible, but is usually out of the question due to some shitty policy like, "no throwing cakes" or "don't ride the shopping carts."

In the sense of Windows administration, this line of thinking leads to creating working tools that cut repetition out of the picture. Never mind that the actual task only takes 3 minutes. If I have to do it three times in a day, I become furious and frustrated. So, I take the time, away from work, or on breaks, to dust off my scripting skills and create a utility to do my job for me. In the sense of this particular utility, all of my co-workers will also benefit.

But that brings me to the deeper problem. I'm never really content with any one thing. I've always been flighty when it comes to my interests and I've never managed to acquire any real mastery of all the things I pursue. Except for fixing the hardware side of computers. On that count, I will dare you to find an equal.

But with everything else, I manage to attain some modicum of proficiency and that's usually good enough for me. I can play the guitar, but I don't have mastery of music theory. I can bash out a beat on a drumset, but I lack the nuance and feel of a good drummer. I can make a guitar or write a story, but all of these efforts seem as if they're forced into existence as half-assed creations and not the true artistic expressions they could be.

The same goes for the various jobs I've had - but over these years I've recognized a certain feeling of belonging. A feeling of "this is right" that rarely comes along. In the eight years since I stumbled upon VBscript programming, I've only consistently maintained an interest in one thing. Race cars and toys and bands have all come and gone - but I've been unable to go more than a few days without futzing with some kind of audio recording. I get a feeling that says "this is it" and it seems right.

I get that same feeling when some program I wrote actually does what it's supposed to do.

I tried to make a living at the audio recording. It might have worked, but I took too big a step - more like a giant fucking leap - to actually maintain any momentum in the cold, harsh real world of bill collectors.

And now I've made the switch from fixing computer hardware (remember - I said up above that it's the one skill I've attained any real mastery in) and I'm back in the kind of environment I was in back in 1998 when my utility programs saved the day.

And I've done it again. And I want more. And I've developed a plan.

My plan is this:

1. Learn by doing.

That's it. That's the whole plan. If I set out to -DO- programming, I'll be able to do it. But in order to make it work and make it stick if it gets tough, it has to be interesting, it has to fit together and it has to bring back that feeling.

So how better to do that than to make some kind of program which records audio?

And that, ladies and germs, is why I try not to make plans.

Because - I have an understanding of how to put things together in Visual Basic - it's easy to follow since it kinda reads like English. Broken, terribly formatted English, but English nonetheless.

What I'm finding is that PEOPLE DON'T MAKE REAL PROGRAMS IN VISUAL BASIC. Actually, I pretty much already knew that. I just chose to ignore it and hope it would go away.
And -- it seems like it's trying to go away. Microsoft has revamped their line of Development tools and Visual Basic is -SUPPOSEDLY- capable of doing anything the others can do.

But I cannot for the life of me find any way to access a soundcard device through Visual Basic.

I can make it play a sound. That's easy. But I'm using system defaults for that. I'm not telling it WHAT DEVICE to use to play the sound. I'm letting Windows pick the device. I WANT TO PICK THE FUCKING DEVICE.

Which leads me to the whole point of this idiotic rant.

Real people use real tools to create real programs.

Real tools in this case means C++

I don't know shit from C++. Not nothing. Not one fucking bit. It strikes me as pathetic that I can copy a few lines of text from a tutorial and make the C++ pop up a box with a message on it, BUT I STILL HAVE NO FUCKING CLUE HOW THE SYNTAX AND STRUCTURE WORKS.

With Visual Basic and VBScript I was able to look at a few lines of code and adapt them to whatever my actual need was. Not so with these crazy bracketses and double colons.

I guess I need a book. Or maybe a class. I fucking hate a class.

#include "unintelligible.h"
#include "make_no_sense.h"
#include "lots of fucking brackets.h"

Don't forget the fucking semi-colons.

static int sound_scream;
static int sound_shout;
static int sound_yell;
static int sound_punch;
static int sound_curse;
static int sound_fuck;

void any_kind_of_sense_at_all (edict_t *self, edict_t *other)
gi.sound (self, CHAN_VOICE, sound_fuck, 1, ATTN_NORM, 0);

void what_the_fuck (edict_t *self)
gi.sound (self, CHAN_VOICE, sound_scratchy, 1, ATTN_NORM, 0);

void fuckit (edict_t *self);
mframe_t berserk_frames_stand [] =
ai_stand, 0, berserk_fidget,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL


I promise, I didn't make this last part up.


Running -> Arm raised in air

void() berserk_runb1 =[ $r_att1 , berserk_runb2 ] {ai_run(21);};
void() berserk_runb2 =[ $r_att2 , berserk_runb3 ] {ai_run(11);};
void() berserk_runb3 =[ $r_att3 , berserk_runb4 ] {ai_run(21);};
void() berserk_runb4 =[ $r_att4 , berserk_runb5 ] {ai_run(25);};
void() berserk_runb5 =[ $r_att5 , berserk_runb6 ] {ai_run(18);};
void() berserk_runb6 =[ $r_att6 , berserk_runb7 ] {ai_run(19);};
// running with arm in air : start loop
void() berserk_runb7 =[ $r_att7 , berserk_runb8 ] {ai_run(21);};
void() berserk_runb8 =[ $r_att8 , berserk_runb9 ] {ai_run(11);};
void() berserk_runb9 =[ $r_att9 , berserk_runb10 ] {ai_run(21);};
void() berserk_runb10 =[ $r_att10 , berserk_runb11 ] {ai_run(25);};
void() berserk_runb11 =[ $r_att11 , berserk_runb12 ] {ai_run(18);};
void() berserk_runb12 =[ $r_att12 , berserk_runb7 ] {ai_run(19);};
// running with arm in air : end loop


Phoooiee said...

This post makes me feel very happy.

i, squub said...

You must be outchyour cottonpickin' mind.

At any rate, I don't think you need to go to C++ to do what you're talking about; not that I'd really know for sure. But in .NET everything is basically the same as everything else, aside from the differences of what actual language you're typing into the damned thing. It all gets compiled into the same exactly thing, whether you're using C-sharp or VB.

What you maybe want is some kind of component that offers access to audio hardware through code, like a library deal or a com component or whatever. There should be such a thing, but I don't know where or how to get it cuz i've never gone very far into looking into it cuz my plan is different from yours.

My plan is: I don't know what my plan is.

Programming Audio in Microsoft Windows and on Web Pages: An Overview

If you haven't read that, it might be worth a look-thru.

Liquid Pork Gun said...

You don't need C++, but Java would probably help a bit. "Digital Audio with Java" is a book that would probably tell you what you need to know, if you're good at adapting book examples to your application. Worst case, you'd probably need to check out a book on Java from the library (I'd recommend it anyhow - Java's not quite as fast as C++, but it's a hell of a lot easier to work with (and cross-platform), especially with GUIs)