The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

midi-dump - Dump contents of MIDI files

SYNOPSIS

  midi-dump [options] file

Options:

   --rgscale            scale ticks to RoseGarden convention
   --ident              show identification
   --help               brief help message
   --verbose            verbose information

OPTIONS

--rgscale

RoseGarden always uses a tick unit of 960. When --rgscale is used, all times are scaled to 960 tick units.

--verbose

More verbose information (default).

--version

Print a version identification to standard output and exits.

--help

Print a brief help message to standard output and exits.

--ident

Prints a program identification.

file

Input file, which must be a valid MIDI files.

DESCRIPTION

This program will read the given MIDI file and writes a readable and understandable representation of the contents to standard output.

The format of the output is a Perl structure similiar to the one produced by the dump function of the MIDI module. The output has been enhanced with additional information.

For example:

 MIDI::Opus->new({
  'format' => 1,
  'ticks'  => 256,
  'tracks' => [   # 5 tracks...

    # Track #1 ...
    MIDI::Track->new({
      'type' => 'MTrk',
      'events' => [  # 3 events.
        ['time_signature', 0, 4, 2, 24, 8],       #       0  001-01-00-00  Time = 4/4, Click = 24, NoteQ = 8
        ['key_signature', 0, 0, 0],               #       0  001-01-00-00  Key = C
        ['set_tempo', 0, 600000],                 #       0  001-01-00-00  Tempo: q = 100
      ]
    }),
    
    # Track #2 ...
    MIDI::Track->new({
      'type' => 'MTrk',
      'events' => [  # 346 events.
        ['control_change', 0, 0, 0, 0],           #       0  001-01-00-00
        ['control_change', 0, 0, 32, 0],          #       0  001-01-00-00
        ['patch_change', 0, 0, 52],               #       0  001-01-00-00
        ['lyric', 128, '1.If '],                  #     128  001-01-08-00
        ['note_on', 0, 0, 70, 68],                #     128  001-01-08-00  A#3 on
        ['note_off', 128, 0, 70, 0],              #     256  001-02-00-00  A#3 off
        ['lyric', 0, 'ev'],                       #     256  001-02-00-00
        ['note_on', 0, 0, 70, 75],                #     256  001-02-00-00  A#3 on
        ['note_off', 128, 0, 70, 0],              #     384  001-02-08-00  A#3 off
        ...
        ['note_off', 256, 1, 62, 0],              #   31616  031-04-08-00  D3 off
        ['note_off', 1152, 1, 60, 0],             #   32768  033-01-00-00  C3 off
      ]
    }),
    
  ]
 });

The added information is at the right side, after the # mark. It consists of the accumulated time so far, a timestamp in the form measure-beat-fraction-remainder (as used e.g. by the Rosegarden program), and some event specific details.

The output is a valid Perl structure, that can be loaded to create a new MIDI::Opus object. See MIDI for details.

REQUIREMENTS

MIDI 0.80 or later.

AUTHOR

Johan Vromans <jvromans@squirrel.nl>

COPYRIGHT

This programs is Copyright 2008 Squirrel Consultancy.

This program is free software; you can redistribute it and/or modify it under the terms of the Perl Artistic License or the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.