Skip to content

tmont/midiparser

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

PHP MIDI Parser

Build Status

Licensed under WTFPL

Installation

Requirements

  • PHP >= 5.3.0

Usage

If you clone the repository, you can run ant sample to run the sample script at ./sample/test.php, which will generate an HTML report.

The following snippet is an example of how to generate a plaintext report.

require_once 'vendor/autoload.php';

use Tmont\Midi\Parsing\FileParser;
use Tmont\Midi\Reporting\TextFormatter;
use Tmont\Midi\Reporting\Printer;

//create a new file parser
$parser = new FileParser();

//replace this path with the path to an actual MIDI file
$parser->load('/path/to/midi/file.mid');

//create a Printer object
$printer = new Printer(new TextFormatter(), $parser);

//output the parse result
$printer->printAll();

Parser Usage

If you want more control over the data, you can use the parser directly. See the print notes sample script for an example of how to do this.

Development

# install dependencies
composer install

# run tests
vendor/bin/phpunit