示例#1
0
require_once 'inc/Midi/bootstrap.php';
use Midi\Emit\File;
use Midi\Emit\Track;
use Midi\FileHeader;
use Midi\Event\TimeSignatureEvent;
use Midi\Event\SetTempoEvent;
use Midi\Delta;
use Midi\Event\NoteOnEvent;
use Midi\Event\NoteOffEvent;
use Midi\Event\EndOfTrackEvent;
use Midi\Event\TrackNameEvent;
use Midi\Parsing\FileParser;
output_header("Upload MIDI File");
$path = 'uploads/midi/' . $file;
$name = p_string('title');
try {
    $tracks = array();
    $trackNoteCount = array();
    $currentTrack = 0;
    $trackNoteCount[$currentTrack] = 0;
    $tracks[$currentTrack] = '[Untitled Track]';
    $parser = new FileParser();
    $parser->load($path);
    $time = 0;
    $maxTime = -1;
    $noteArray = array();
    $noteOnTime = array();
    $timeDivision = 0;
    while ($chunk = $parser->parse()) {
        if ($chunk instanceof Delta) {
示例#2
0
<?php

mod("pager");
mod("form");
$gp = pager_init(66);
$searchform = form_create('Search', 'inline', null, 'get');
form_add_param($searchform, 'Value', 'search', 'string', '', 100, 12);
$search = p_string('search');
$basedon = p_int('basedon', 0);
$sort = p_string('sort', 1);
$date = p_string('date', empty($search) ? 1 : 4);
if (isset($_GET['deleted'])) {
    $where = ' WHERE deleted=1 ';
} else {
    if ($basedon) {
        $where = ' WHERE basedon="' . $basedon . '" ';
    } else {
        if (!empty($_GET["search"])) {
            $where = ' WHERE deleted=0 AND MATCH(title) AGAINST("%' . e_mysql($search) . '%") ';
        } else {
            $where = ' WHERE deleted=0 ';
        }
    }
}
switch ($sort) {
    case 2:
        $order = "accesscount DESC";
        break;
    case 4:
        $order = "RAND()";
        break;