Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I think I might make a little cronjob to download each "day" and play it back. I think http://interglacial.com/d/clock?format=midi&daycount=1 [interglacial.com] is correct, no? Although I could just use your Perl module too ...
    • by pudge (1) on 2004.11.09 18:06 (#35913) Homepage Journal
      Here's my cronjob:
      perl LongNowChimes.pm `date +%F` 1 /tmp/`date +%F`.mid; open /tmp/`date +%F`.mid
      Also, I am using MIDI patch 11 (vibraphone in QT synth) and I lowered everything on octave.

      Eh, hang it, it's evolved into a Perl script, as everything does.
      #!/usr/local/bin/perl
      use strict;
      use warnings;
       
      use LongNowChimes;
      use File::Spec::Functions;
      use Mac::Files;
      use Mac::Glue;
       
      my $player = new Mac::Glue 'QuickTime Player';
       
      my($y, $m, $d) = ((localtime)[5, 4, 3]);
      $y += 1900;
      $m++;
       
      my $dirname  = FindFolder(kUserDomain, kTemporaryFolderType);
      my $filename = catfile($dirname, sprintf("%04d-%02d-%02d.mid", $y, $m, $d));
       
      my $chimes = ChimesForDays($y, $m, $d, 1);
      my $midi = LongNowChimes::DaysToMIDI($chimes);
      $midi->write_to_file($filename);
       
      my $track = $player->obj(file => $filename)->open;
      $track->play;