test.tools
Class MidiTools

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended bytest.suite.MidiTestCase
              extended bytest.suite.MidiAdaptorTest
                  extended bytest.tools.MidiTools
All Implemented Interfaces:
junit.framework.Test

public class MidiTools
extends MidiAdaptorTest

Author:
Chris

Field Summary
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
MidiTools()
           
 
Method Summary
static void compareEvents(javax.sound.midi.MidiEvent m1, javax.sound.midi.MidiEvent m2)
           
static void compareMessages(javax.sound.midi.MidiMessage m1, javax.sound.midi.MidiMessage m2)
           
static void filterOptionalMeta(java.util.List output)
           
static void hexbit(int i, java.lang.StringBuffer sb)
           
static void hexize(int status, java.lang.StringBuffer sb)
           
static int load(java.lang.String midiFile, java.util.List eventList)
          Load a MIDI file (cheap and nasty) TODO filter out MIDI meta events
static void prioritizeByChannel(java.util.List output)
           
static void remapChannel(java.util.List original, int effectsChannel, int mainChannel)
           
static void remapEvents(java.util.List original, java.lang.String[] eventRemap)
           
static void remapNoteOff(java.util.List output)
           
static void remapTicks(java.util.List output, int sourcePPQ, int destPPQ)
           
static java.lang.String stringize(javax.sound.midi.MidiEvent e)
           
static java.lang.String stringize(javax.sound.midi.MidiMessage m)
           
 
Methods inherited from class test.suite.MidiAdaptorTest
testAguaMIDI
 
Methods inherited from class test.suite.MidiTestCase
compareMIDIFiles
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MidiTools

public MidiTools()
Method Detail

filterOptionalMeta

public static void filterOptionalMeta(java.util.List output)
Parameters:
output -

compareEvents

public static void compareEvents(javax.sound.midi.MidiEvent m1,
                                 javax.sound.midi.MidiEvent m2)

compareMessages

public static void compareMessages(javax.sound.midi.MidiMessage m1,
                                   javax.sound.midi.MidiMessage m2)

hexize

public static void hexize(int status,
                          java.lang.StringBuffer sb)
Parameters:
status -
Returns:
status in hex into sb ???

hexbit

public static void hexbit(int i,
                          java.lang.StringBuffer sb)
Parameters:
i -
sb -

prioritizeByChannel

public static void prioritizeByChannel(java.util.List output)
Parameters:
output -

stringize

public static java.lang.String stringize(javax.sound.midi.MidiEvent e)

stringize

public static java.lang.String stringize(javax.sound.midi.MidiMessage m)
Returns:

remapTicks

public static void remapTicks(java.util.List output,
                              int sourcePPQ,
                              int destPPQ)
Parameters:
output -

remapNoteOff

public static void remapNoteOff(java.util.List output)

load

public static int load(java.lang.String midiFile,
                       java.util.List eventList)
                throws javax.sound.midi.InvalidMidiDataException,
                       java.io.IOException
Load a MIDI file (cheap and nasty) TODO filter out MIDI meta events

Parameters:
eventList - a list to fill out with the sorted list of MIDI events
Returns:
the pulses per quarter note set in this file
Throws:
java.io.IOException
javax.sound.midi.InvalidMidiDataException

remapChannel

public static void remapChannel(java.util.List original,
                                int effectsChannel,
                                int mainChannel)
Parameters:
original -
effectsChannel -
mainChannel -

remapEvents

public static void remapEvents(java.util.List original,
                               java.lang.String[] eventRemap)
                        throws java.lang.Exception
Parameters:
eventRemap -
Throws:
java.lang.Exception