Computers: April 2006 Archives

DirecTV Lameness

| | Comments (0)
When DirecTV first made it so you could add subscription packages through the web site, I thought it was very cool. Now, however, you can only remove the package by talking to someone. Obviously, they want to make it easier for you to subscribe than to unsubscribe. The guy asks me why I want to unsubscribe. "Because I don't want it anymore."

Jerks. use.perl.org
The PODxt guitar amp/fx modeler was recently updated with a bunch of new stuff, including a bass expansion pack. Well, I play bass and guitar, and I liked the idea of not having to buy a Bass PODxt to go with my regular one. So I got the expansion pack to test it out, and wrote this program to do it. It requires the following steps, apart from having all the proper modules and software installed:
  • Create glues for QuickTime Player, MidiPipe, and Sound Studio (the latter only if you want to record the result)
  • Set your default audio output to the PODxt
  • If recording, set Sound Studio's audio input to the PODxt
  • In System Preferences, set the PODxt to do reamping (cmd-3)
  • Create a MidiPipe file that has a MIDI In named 'MidiPipe Input 1' and has MIDI Out set to the PODxt, and save it in the same directory as this program, with a '.mipi' extension
  • In main_loop(), set the programs you want to try out; the demo here first loops over some programs, then switches to a blank program, then tries out a bunch of different amps by themselves
  • If you want each program to be announced with speech, set the $SPEECH variable to true
  • Run the program, as 'podxt-soundtest.plx path/to/someaudiofile.aif', where the audio file is a recording of clean guitar/bass; it will save the files in 'path/to/someaudiofile-samples/'
That's basically it. It will play the given sound file through the PODxt for each program or amp you tell it you want to hear. This can easily be extended to also sample anything else in the PODxt: different effects, different settings for the effects, and so on, using the MIDI CC Reference guide (for example, amp changes are CC #11, stomp box changes are CC #75, modulation changes are CC #58, etc.). I figure I will use this quite a bit as I pick up recording again soon, so I can quickly and easily sample different amps and effects to find the sound I want.

#!/usr/bin/perl
# podxt-soundtest.plx
use strict;
use warnings;

use File::Basename;
use File::Spec::Functions qw(catdir catfile);
use FindBin '$Bin';
use Mac::Errors '$MacError';
use Mac::Glue ':all';
use Mac::Speech;
use Time::HiRes 'sleep';

my $DEBUG = 1;
my $RECORD = 1;
my $SPEECH = 0;

use constant {
    CC        => 176,
    PROGRAM        => 192,

    AMP_ENABLE    => 111,
    AMP_SELECT    => 11,
};

my @voice = qw(Damien Diane Vicki Victoria);
my $midi_port  = 'MidiPipe Input 1';
my $sound_file = shift;
my($sound_name, $sound_dir) = fileparse($sound_file, qr/\..+/);
my($qt_player, $midi_pipe, $sound_studio, $voice, $speech, $recording, $movie, $done);

init();
main_loop();
finish();

sub main_loop {
    for my $n (111, 32 .. 79) {
        doit(program => $n);
    }

    # blank program
    midi({ program => 127 });

    for my $n (73 .. 100) {
        doit(amp => $n);
    }
}

sub doit {
    my($what, $which) = @_;
    get_sound_files();
    start_recording();

    say($what, $which);
    midi({ $what, $which });
    play();

    stop_recording();
    save_recording($what, $which);
}

sub finish {
    print "Done.\n";
    exit;
}

sub init {
    $qt_player  = new Mac::Glue 'QuickTime Player';
    $midi_pipe  = new Mac::Glue 'MidiPipe';
    $sound_studio = new Mac::Glue 'Sound Studio' if $RECORD;

    if ($SPEECH) {
        my $V;
        for (@voice) {
            last if $V = $Mac::Speech::Voice{$_};
        }
        $speech = NewSpeechChannel( $V );
    }

    if ($DEBUG) {
        $qt_player->ERRORS(1);
        $midi_pipe->ERRORS(1);
        $sound_studio->ERRORS(1) if $RECORD;
    }

    $sound_studio->launch if $RECORD;

    my($pipe) = fileparse($0, qr/\..+/);
    $midi_pipe->open(catfile($Bin, $pipe . '.mipi'));

    $qt_player->activate;
    open_sound_file();

    # preload voice
    if ($SPEECH) {
        SpeakText($speech, '');
        sleep 0.1 while SpeechBusy();
    }

    $movie = $qt_player->obj(movie => 1, window => 1);
    $done  = $movie->prop('done');
}

sub midi {
    my($params) = @_;
    my $opts = {
        toPort    => $midi_port
    };

    if (defined $params->{program}) {
        $opts->{withData} = [ PROGRAM, $params->{program} ];

    } elsif (defined $params->{amp}) {
        $opts->{withData} = [ CC, AMP_ENABLE, 0 ];
        $midi_pipe->MIDISend(%$opts);
        $opts->{withData} = [ CC, AMP_SELECT, $params->{amp} ];
    }

    $midi_pipe->MIDISend(%$opts);
}

sub say {
    return unless $SPEECH;
    my($what, $which) = @_;

    my $text = "$what number $which";
    print "$text\n";

    midi({ program => 127 });

    SpeakText($speech, $text);
    sleep 0.1 while SpeechBusy();
}

sub play {
    $movie->start;
    while (1) {
        last if $done->get;
        sleep 0.5;
    }
    sleep 1.5;
}

sub get_sound_files {
    if ($RECORD) {
        $recording = $sound_studio->make(new => 'document');
    }

    open_sound_file();
}

sub open_sound_file {
    $qt_player->obj(file => $sound_file)->open;
}

sub start_recording {
    return unless $RECORD;
    $recording->record;
}

sub stop_recording {
    return unless $RECORD;
    $recording->stop;
}

sub save_recording {
    return unless $RECORD;
    my($what, $which) = @_;

    my $dir = catdir($sound_dir, $sound_name . '-samples');
    mkdir $dir;

    sleep 5;
    $recording->save(
        in    => $recording->obj(file => catfile($dir, "$what-$which.aiff")),
        as    => enum('AIFF')
    );
    sleep 5;
    $recording->close;
}

use.perl.org

Homo erectus

| | Comments (0)
I want to write a short story about how an ancient predecessor of man, Homo erectus, comes to live in our century. Doesn't matter how. But he learns to speak, read, write, and practice law, and then sues anyone who actually CALLS him "Homo erectus," as it is hate speech. He'll have some lovable catchphrase, like "ME NOT GAY!" use.perl.org

Re: Mencken lives

| | Comments (0)
TorgoX links to an article that actually claims the "mainstream media" does not lean strongly left.

It does. There is no reasonable denying of it. As "evidence" it cites the notion that "It's obvious, from the speed with which White House scandals drop from the radar, and the lack of outrage over clearly illegal executive policies, that the 'MSM' has been much, much softer on this president than the last, considering their respective performances."

Putting your begging-the-question fallacy at the end of your sentence doesn't make what precedes and depends on it any less fallacious. I'd argue the White House scandals dropped off the radar because they were almost entirely phony, and that time proved them to be such.

The fact is that no matter how you measure the bias of the mainstream media as a whole, if you do any attempt at an objective study, it comes out on the left.

The real problem, however, is that the liberal bias is relatively isignificant. Contrary to popular belief, reporters and editors are professionals and their personal political bias usually doesn't play a significant role in what stories they cover, or how they cover them.

The "mainstream media" problems are far deeper than mere political bias. The main one is simply the bias toward what sells. Going into war, who wants to hear anything negative about the military? OK, some of you reading this might, and most of you probably just want the "truth" (whatever that is), but most people want to "support the troops."

And so, that's what most of the coverage was. And this has not a jot to do with political bias on the part of the media, and everything to do with the fact that news is a business.

There are other biases too, of course. Reporters are crusaders, and will hop on any juicy or controversial story. This is why the press hopped all over every story that hinted "scandal" for Clinton and Bush. But almost all those stories go away when the press and people get bored, because they lack substance.

Anyway, all that said, the search for "balance" does run afoul, and often. But he overstates the case and puts blame on one side of the political fence, where it clearly does not belong. Witness his blindness:

But the real distinction in my eyes between the bias complaints from the right and from the left is in their very nature. Liberal complaints mainly focus on lies, distortions, and sins of omission, while conservatives complain about "balance." The left wants a press that insists on facts, while the right wants an even presentation of partisan versions of reality.
It's quite cunning to claim about ignoring reality while you're ignoring reality. The "equal time" complaints on the right mostly died out in the 90s. Once the Internet and Fox News went mainstream, those complaints faded away. Now the right complains about 60 Minutes omitting the fact that some of their sources told them the documents were forged before the story aired, and about the media continually repeating the lie that Joe Wilson's trip to Niger had anything to do with Bush's "16 words," and omitting the fact that the Butler Report called thsoe "16 words" "well-founded," and so on.

But he really exposes his argument as the nonsense it is with this gem:

Presenting every issue as a he said/she said dispute, an unending, irresolvable argument, sounds fair, but what happens when one side really is wrong? Some questions are not eternal. Pretending that they are is a disservice to the public.
OK, I'll bite: such as?

He goes on to talk about the notion that "Abramoff and his associates" had given money to Democrats. While he is correct to say that Abramoff did not give money to Democrats, and that there's no reason to think tribes associated with Abramoff were giving money at his direction, or that the money otherwise had anything to do with Abramoff, the problem is that Harry Reid and the Democrats started that line of reasoning. There are many Republicans who got lots of money from tribes associated with Abramoff, and Reid and the Democrats presented that, late last year, as evidence the Republicans in question were corrupt. The BEAST and the Democrats didn't complain when the press bought that "scandal" and ran with it, but when it's found out that the exact same logic applies to Democrats too, now the press is being wrong and unfair.

This is not an example of balance or bias, it is an example of an ignorant sensationalistic press gullibly buying a story from the Democrats, and it coming back to bite them in the ass.

He continues:

Of course, the Democratic Party isn't a morally pure bastion of integrity. It's pretty much impossible to get elected to congress without engaging in some influence-peddling and favor-trading. But to say that they share equal guilt, or really any guilt, in the Abramoff scandal is to tell a lie -- a lie we are being told daily ...
True. But it is also a lie to say that the Republican Party has any guilt in the Abramoff scandal. What's true is that some Republican officials are likely guilty, but to extend that guilt to the Republican Party is to use the same logic that makes people think the Democratic Party is also guilty.

See how that works?

[NOTE: it is true that the Republican Party helped create the system that could be abused to create this scandal (although, so did the Democrats, laying the groundwork from the 60s through the 80s), and further could have prevented things like this from happening, and did not do so, but that's certainly a different type and measure of guilt than what the BEAST and the Democrats are talking about.]

So, is there any other example?

fter Bush's lackluster State of the Union Address Tuesday night, MSNBC's Chris Matthews hosted a panel that consisted of himself, Pat Buchanan, Tucker Carlson, and a sole Democrat, Hilary Rosen -- a former record industry lobbyist whose only apparent qualification for representing the Left is that she's a lesbian. The panel on CNN was similarly skewed three to one, with the more capable Dem hack Paul Begala weathering the ideological beatdown. Fox News is becoming redundant.
Wait a minute. I thought he was trying to show where balance was the problem; now he is saying lack of balance is the problem? My head's spinning.

And that he says Matthews is on the right is mind-boggling. Chris Matthews is a lifelong leftwing Democrat. He has worked in the White House and Congress for prominent Democrats, he is for big federal spending on social programs, for increased taxes on rich people, and he has been one of the harshest critics of the War in Iraq. A lot of people on the left think Matthews is on the right simply because Matthews is a likeable guy who likes everyone, which means Matthews doesn't hate Bush, and actually says nice things about Bush. Horrors.

So it wasn't even 3-to-1, it was 2-to-2. And one of the people actually on the right, Pat Buchanan, doesn't even really like Bush.

This guy's thinking could not be more muddled:

"Where does it end? Will news agencies ever have enough of this bullshit, or will they allow themselves to be pushed further and further right, until they're trying to achieve 'balance' between Neocons and Christian Dominionists? Will Joe Lieberman be marginalized as a 'far left liberal?" So, you want balance then?

"Or will journalists finally be forced to address the fact that some people are just wrong, and that their opinions shouldn't be heeded, and remember the fact that they're supposed to be informing, not indoctrinating, their audience?" Right, and the only example you gave of that was the result of the Democrats convincing the press of the lie that you later complained of when it came to apply to the people on your side. Cry me a river.

"Do we really want to be this stupid?" Oooo, that hurts. Really.

"The truth is not partisan. But sometimes it reflects poorly on one party more than the other. That's not bias; that's reality." And truth normally requires evidence, and none was provided. Funny, that. use.perl.org

The "Perl" Conference

| | Comments (0)
So I am looking at the Perl track for OSCON, and I am wondering where the technical sessions are.

No offense to any of the speakers or topics, because I am only speaking personally, but I don't really care about most of the non-meaty topics, like Perl Bliss and so on. And I don't care about Perl 6. Feed Aggregation is so 5 years ago. I never pay extra for the tutorials.

Setting aside the standards -- Lightning Talks and The Conway Channel -- that leaves me with What's New in Perl DBI, Devel::Cover, Plagger: Pluggable RSS/Atom Aggregation, Mason Components for Ajax, A Relational Object Driver That Doesn't Suck, and Perl Hacks You Never Knew Existed.

I don't care about feed aggregation (well, I do, but not in any new tools to deal with it), I don't use Mason (although maybe I could learn something more about how to deal with Ajax), and I sure as hell don't need another DB abstraction layer (although it might be an interesting talk anyway, at least get me thinking about issues with our own custom layer?).

So being very generous with my interest, I could go to all the above sessions, which means four sessions Wednesday, three Thursday, and one Friday.

And that's with no options for other possibilities. So if one was a dud or I decided I really didn't care about a new syndication aggregation toolkit, I'd have nothing to go to.

Of course, I might very well find sessions in the Apache and MySQL tracks. And I will likely go to OSCON and do just that, and not feel like I've wasted my time or money.

But I want to go to a Perl conference, and frankly, I don't think OSCON qualifies.

Now Playing: John Debney - It Is Done
use.perl.org

All Hail Lux Board

| | Comments (0)
All hail my Lux board of Washington State.

Lux is like Risk. Networkable etc.

The original version of this map had bonuses broken down accurately by population per state judicial district, which made it so if you just sat on a single county, King County, you got a third of all bonuses. Which made it very unbalanced gameplay, but also a very accurate representation of real-life politics in Washington: if you control Seattle, chances are you will win whatever battle you wish to wage.

But that was a bit too unbalanced for an interesting game, so I made it a bit harder to hold on to King County, while still giving its "continent" a relatively big bonus. use.perl.org
In fall 2003, I pre-ordered the sequel to Cliff Johnson's amazing puzzle game, The Fool's Errand. It was due Halloween 2003.

Then it was due April Fool's Day, 2004. Then Halloween 2004. Then later 2004. Then July 5 2005. Then late 2005. Then April Fool's 2006. Now ... August 2006.

The title of the sequel is called, "A Fool and his Money," taken from the old phrase, "A fool and his money are soon parted." I e-mailed him:

Seriously, is the point of the game to just figure out that you're never finishing the game?
He replied:

Only in my nightmares!

My team of psychologists sez I'll be fine.
Ha-ha cute. But seriously. I already gave you money. I am not one to rush "art" or anything, but what is this, Perl 6? use.perl.org

What I Did For April Fool's Day

| | Comments (0)
I hid a Mind Molester inside my father-in-law's clock. He gave it to me a couple of weeks ago to fix. So I fixed it, alright.

As you can see from the first URL, the battery and device are fairly long together, so -- as you can see from the second -- I snipped the battery connector off an old guitar tuner and soldered those leads to the device, and then I could put the battery in one place on the clock (there happened to be just enough room on one side) and the device in another. Tolerances were very tight.

The trick then was to get the clock to him without him realizing what was going on. I wasn't going to his house any time soon, but I happened to go trap shooting with him this weekend, and we went out to lunch afterward. I "needed" to leave early, so I asked for his keys to give him back the clock, and put the clock in his trunk and returned the keys to him.

And thankfully, he didn't hear the beeping as he put the clock in his office at home. It took him a couple of days to figure it out. The only downside is that his hearing is not as good as my mother-in-law's, so she got more annoyed by it than he did.

Now he says he is going to get me. Bring it, old man. use.perl.org
Auto-save your BBEdit documents on a per-document basis. The script will keep looping every N seconds until the file is closed (or you kill the script manually).

#!/usr/bin/perl
# bb_autosave.plx - autosave for BBEdit
# save whatever is currently frontmost document when script first executes,
# every N seconds
 
use strict;
use warnings;
 
use Mac::Glue ':all';
 
my $bbedit   = new Mac::Glue 'BBEdit';
my $front_id = $bbedit->prop(id => document => 1, window => 1)->get;
my $front    = $bbedit->obj(document => obj_form(formUniqueID, typeLongInteger, $front_id));
 
my $name = $front->prop('name')->get;
print "Auto-saving document '$name'.\n";
 
my $sec = shift || 10;
 
while ($front->get) {
    $front->save;
    sleep $sec;
}
 
print "Document closed.\n";
exit;

use.perl.org

Kurt Loder, You Are Old

| | Comments (0)
Dear Mr. Loder: You are turning 61 in May.

As such, you should not be writing things like, "[Basic Instinct 2] rocks. It does so by boldly embracing the preposterousness at the core of its story right away, and then moving on to more important things like ultra-nasty sex, hyper-lurid dialogue and a species of over-the-top set design that hasn't been attempted with this much brio since the early Bond films, or maybe the gargantu-westerns of Sergio Leone."

Speaking of which, Basic Instinct 2 is doing poorly, despite Loder's best efforts, because of George W. Bush. Or maybe because of the Christians who got him elected. From Paul Verhoeven's statement on that topic I cannot be sure; maybe there's a language barrier problem, because he also said anything erotic is banned in the U.S., which it isn't.

Or maybe he means his movie is not erotic? It certainly wasn't banned. It pulled in $3.2 million last weekend. Less than 20 people per showing is not a lot -- indeed, it is hilariously tiny -- but it is evidence that it hasn't been banned.

So why is this movie doing so poorly? Why are erotic thrillers so rare these days? It doesn't take a genius to figure out that the main attraction of these movies was the sex scenes. Find any VHS copy of them and chances are the sex scenes will be more worn-out than the rest of the movie. And yet, the content of those scenes pales in comparison to what is available for free online.

If you're into that sort of thing, what would you prefer: sitting in a public theater for $10, waiting a couple of hours with 20 strangers, to catch a few fleeting seconds of a 48-year-old Sharon Stone; or downloading several minutes of high-resolution on-demand video of girls half that age that you can pause, freeze, and watch to your heart's content in the privacy of your own home?

Oh well. The point is that Kurt Loder is way too old to be writing things like that. And also, Paul Verhoeven is an idiot.

use.perl.org
I have this old 8-track of Winnie the Pooh songs sung by Frank Luther. The original recording is, I believe, from 1948. I digitized it a couple of years ago and have it in my music library.

It contains many wholesome songs for children. A song about Christopher Robin saying his prayers, another about two little bears, where there was a good bear and a bad bear.

There's also things song called "The Alchemist," that goes:

"Where are we going today?," said Pooh. So Christopher Robin told him:

There lives an old man at the top of the street
And the end of his beard reaches down to his feet
And he's just the one person I'm longing to meet
I think that he sounds so exciting

For he talks all the day to his tortoise-shell cat
And he asks about this and explains about that
And at night he puts on a big wideawake hat
And sits in the writing room, sits in the writing room, writing


So, this little boy is going to take his teddy bear and hang with an elderly recluse who makes his own drugs talks to his cat and stays up all night writing something or other (probably hanging out in children's chat rooms). Winnie the Pooh sure has changed ...

use.perl.org

Nicecast

| | Comments (0)
I just bought Nicecast for my home stereo.

One of my problems with my home theater system is sometimes I have something on -- news, sports, music -- that I want to listen to as I wander either to my office or to the new addition we're putting in the house.

I can, of course, use various whole-home audio solutions, and I use some of those: a wireless speaker that sits in the kitchen and can be carried elsewhere, and audio output to an amp for some outdoor speakers, and to an amp in the bedroom. But wires are not as easily strung to other locations, and most wireless solutions stink.

I already have computers in the additional locations I want to listen to this audio, and a computer in the base location, so: enter Nicecast. I have the same audio that goes to the other amps, and the wireless speaker, fed back to the main computer (which may include the audio that computer is producing), which is then streamed to the rest of the LAN.

Now I can be in the upstairs addition and listen to the baseball game that's on the TV downstairs. Or if I am listening to the news and I need to go to the bathroom and happen to have my laptop with me ... that works too. Neat. use.perl.org
<pudge/*> (pronounced "PudgeGlob") is thousands of posts over many years by Pudge.

"It is the common fate of the indolent to see their rights become a prey to the active. The condition upon which God hath given liberty to man is eternal vigilance; which condition if he break, servitude is at once the consequence of his crime and the punishment of his guilt."

About this Archive

This page is a archive of entries in the Computers category from April 2006.

Computers: March 2006 is the previous archive.

Computers: May 2006 is the next archive.

Find recent content on the main index or look in the archives to find all content.