#!/usr/local/bin/perl
# Time-stamp: "2006-07-07 00:04:34 ADT"

use MIDI::Simple .7;
new_score;

text_event "Title: Four Minutes Thirty-Three Seconds";
text_event "Composer: John Cage (1952)";
copyright_text_event 
    "Copyright 1999 by Sean M. Burke sburke\@netadventure.net";

set_tempo 1_000_000;
 # one qn per second (i.e., per 1 million microseconds)

noop qn;
 # sets $Duration to number of ticks in a qn
my $second = $Duration;

patch_change 0, 115;
  # channel 0, patch 115 (Woodblock)
noop d1, V1, c0, C1;
  # imperceptibly short and quiet C1 on channel 0

# It turns out that some sequencers freak out when there's
# a MIDI file that takes time but has no note events.
# So I use this hopefully inaudible event to punctuate the
# silence, for the sequencers' sake.

n;

text_event "First Movement: 30\"";
$Time += $second * 30 - 1;
n;

text_event "Second Movement: 2'23\"";
$Time += $second * ( 2 * 60 + 23) - 1;
n;

text_event "Third Movement: 1'40\"";
$Time += $second * ( 1 * 60 + 40) - 2;
n;

write_score "c433.mid";
exit;

__END__
