PHP Classes

File: meta.php

Recommend this page to a friend!
  Classes of Fluxus   MIDI Class   meta.php   Download  
File: meta.php
Role: Example script
Content type: text/plain
Description: shows content of all meta events in the first track of a MIDI file. These events are often used for song title, copyright informations etc. (like ID3 tags in mp3 files).
Class: MIDI Class
Read, write and manipulate MIDI files and data
Author: By
Last change:
Date: 20 years ago
Size: 1,442 bytes


Class file image Download
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
body {font-family:arial;font-size:11px;margin:5px;}
input {font-family:arial;font-size:11px}

<form enctype="multipart/form-data" action="meta.php" method="POST" onsubmit="if (this.mid_upload.value==''){alert('Please choose a mid-file to upload!');return false}">
<input type="hidden" name="MAX_FILE_SIZE" value="1048576"><!-- 1 MB -->
MIDI file (*.mid) to upload: <input type="file" name="mid_upload">
<input type="submit" value=" send ">
if ($file!=''){
'File: '.$_FILES['mid_upload']['name'];
$midi = new Midi();
$track = $midi->getTrack(0);

// list of meta events that we are interested in (adjust!)
$texttypes = array('Text','Copyright','TrkName','InstrName','Lyric','Marker','Cue');

$nothing = 1;
    foreach (
$track as $msgStr){
$msg = explode(' ',$msgStr);
        if (
$msg[2].': '.substr($msgStr,strpos($msgStr,'"'))."\n";
$nothing = 0;
    if (
$nothing) echo 'No events found!';