Location: PHPKode > projects > XRNS-PHP > _deprecated_/xrns_reorganize_instruments_notes/xrns_reorganize_instruments_notes.php
<?php

	/*
	   _¯¯¯¯¯_____¯¯¯----         ===               ______¯¯¯¯¯
	   _¯      ¯¯           ¯¯ ¯  ___ _   ¯      ¯ ¯
	   ¯¯      ¯¯   D3R Ver3!seR  ---  ¯¯ ¯   ===  ¯¯  __¯¯ ¯
	   ¯¯  ---¯¯         ____           ¯¯     ¯¯ ¯
	   ¯¯      ¯¯ == ___    ¯¯¯¯   ----  ¯¯      ¯¯¯  _____ __
	                             
	
		Usage:          This script reorganizes all notes in a song, so that each instrument will use a separate track.
	                    Typically XM modules triggered multiple instruments in the same track,
	                    which would complicate any further work in Renoise. So this script is for xm files converted
	                    to xrns only.
		                
		                Note: 
		                1. The first slot in the instrument bar has to be blank.
		                2. Delete all instrument slots which you do not need. 
		                   (Especially all slots after the last used instrument slot)
		                3. If you want to run this script on your php-server, the zip.exe and unzip.exe have
	                       to be placed in the same folder as this script
		                
		Last modified:  December 29th, 2008
		Coded by:       Christian Messow alias vereiser of http://www.vereiser.de
		History:        Version 1.0 (April 24th)
		                Version 1.0.1 (December 29th)
		                          - fixed:  instruments with a number higher than 9 will not ignore anymore  
		                          - adding: delete unused tracks
		                Version 1.0.2 (December 30th)
		                	      - fixed:  empty notes of a not track owned instrument will be muted
		                          - adding: every line of an instrument with a C parameter setted to 00 is defined 
		                	        with a note off (needed for using VSTi)
		                	
		
	*/


	// ____________________________________________________________________________________________________
	// ========================================== Load Externals ==========================================
	error_reporting ( E_PARSE );
	putenv( "TZ=US/Eastern" );
	require_once( 'xrns_functions.php' );
	require_once( 'class.xrns_reorganize_instruments_notes.php' );

	if ( isset( $_GET["local"] ) )
	{
		$baseDir = dirname(__FILE__)."/../../..";
		$argc    = 4;
		$argv    = array
		(
			0 => "$baseDir/xrns_reorganize_instruments_notes.php",
			1 => "$baseDir/www/Renoise XRNS-Tools/example/test.xrns",
			2 => "test2.xrns",
			3 => "yes"
		);
	}

	// ____________________________________________________________________________________________________
	// ========================================= Default Settings =========================================
	$SETTINGS["reorganize_instruments"] = array
	(
		"source_xml"                => true,
		"tmp_dir"                   => dirname(__FILE__)."/../temp",
		"argc"                      => $argc,
		"script"                    => $argv[0],
		"source"                    => $argv[1],
		"destination"               => $argv[2],
		"overwrite"                 => $argv[3],
		"tracks"                    => "none",
		"instruments"               => "none",
		"delete_unused_tracks"      => $argv[4],
		"delete_unused_instruments" => "no"
	);

	// ____________________________________________________________________________________________________
	// ============================================ Run Script ============================================
	$error             = false;
	$reorg_instruments = new xrnsReorganizeInstruments( $SETTINGS["reorganize_instruments"] );

	if ( !$reorg_instruments->run() )
	{
		$message = $reorg_instruments->showErrorMessages();
		$error   = true;
	}
	else
	{
		$message = $reorg_instruments->showProcessMessages();
	}

	if ( isset( $_GET["local"] ) )
	{
		echo "<pre>$message</pre>";
	}
	else 
	{
		echo "$message";
	}
	
	if ( $error )
	{
		exit(2);
	}
?>

Return current item: XRNS-PHP