in reply to Re: Win32::MIDI Player
in thread Win32::MIDI Player

#!/usr/bin/perl use strict; use warnings; use MIDI::Simple; my $quarter_notes_per_minute = 140; new_score(); Volume 127; set_tempo int(60_000_000/$quarter_notes_per_minute); patch_change 1, 1; noop "c1", "o3"; # Setup n "hn", "Gs", "E", "en", "rest"; n "Gs_u1"; n "B_u1"; n "Gs_u1"; n "hn", "Fs", "D", "B", "en", "A_u1"; n "Fs_u1"; n "qn", "A_u1"; n "hn", "A", "Fs", "D", "en", "D_u2"; n "A_u1"; n "qn", "D_u2"; n "hn", "E", "Cs", "A", "en", "Cs_u2"; n "A_u1"; n "qn", "Cs_u2"; r "wn"; write_score('LostS.mid'); exec('start','LostS.mid') if ($^O =~ /MSWin32/);

Replies are listed 'Best First'.
Re: A MIDI For LostS
by LostS (Friar) on Feb 09, 2003 at 16:48 UTC
    What is this part? It doesn't work for me:
    exec('start','LostS.mid') if ($^O =~ /MSWin32/);


    -----------------------
    Billy S.
    Slinar Hardtail - Hand of Dane
    Datal Ephialtes - Guildless
    RallosZek.Net Admin/WebMaster

    perl -le '$cat = "cat"; if ($cat =~ /\143\x61\x74/) { print "Its a cat +!\n"; } else { print "Thats a dog\n"; }'

      Exec 'start' with 'LostS.mid' as the only command line parameter if you are running a version of MS Windows. It works like a charm on my Win98 box but I should have tested it on my win2k box before posting. Perhaps exec('LostS.mid') would work better for you?

      Basically it's supposed to start the MIDI using whatever player is associated with .mid files.