GLLib: GLLibMidiSpectrumAnalyzer Class Reference

GLLib

GLLibMidiSpectrumAnalyzer Class Reference

Author:
Nikolay Aleksiev
More...

List of all members.

Public Member Functions

 GLLibMidiSpectrumAnalyzer (int bars, int maxValue, int velocityShift, int millisShift, int releaseDamping)
 Constructs new GLLibMidiSpectrumAnalyzer.
int MidiSpectrumAnalyzer_Parse (byte[] data)
 MidiSpectrumAnalyzer_Parse the midi file.
void MidiSpectrumAnalyzer_Reset ()
 MidiSpectrumAnalyzer_Reset the timers to 0.
int MidiSpectrumAnalyzer_Update (long timeMillis)
 MidiSpectrumAnalyzer_Update the timer to some position in the midi song.

Public Attributes

int[] m_barLevels
 Array with values of the frequence groups.
int m_bars
 Number of frequence groups.
int m_channelFilter = 0x0F
 Filter for the channels that the analyzer will monitoring. Good practice is to disable the drumps (channel 10).
long m_currentTime = 0
 Current time of the analyzer. If function Snd_MediaTimeGet is not available then this parrameter can be used for the MidiSpectrumAnalyzer_Update plus delta time (analyzer.MidiSpectrumAnalyzer_Update(analyzer.m_currentTime + s_game_frameDT)).

Static Public Attributes

static final int ERROR_INVALID_FILE_LENGTH = 3
static final int ERROR_INVALID_HEADER_CHUNK = 1
static final int ERROR_INVALID_META_EVENT = 4
static final int ERROR_INVALID_TRACK_CHUNK = 2
static final int NO_ERRORS = 0

Detailed Description

Author:
Nikolay Aleksiev


Constructor & Destructor Documentation

GLLibMidiSpectrumAnalyzer ( int  bars,
int  maxValue,
int  velocityShift,
int  millisShift,
int  releaseDamping 
)

Constructs new GLLibMidiSpectrumAnalyzer.

Parameters:
bars Number of groups that the frequences will be analyzed in. Should be value between 1 and 128.
maxValue Maximum value that is allowed for the frequence group. If the value become higher it will be clamped to the maxValue.
velocityShift Left shift that will be used for shifting the velocity of the notes. Can be used if higher values are needed.
millisShift Number of the milliseconds that passed from the last MidiSpectrumAnalyzer_Update is left shifted using this parameter and then subtract by the frequence level. If you use 64 groups you may want to left shift with one to have the same level as 128 groups.
releaseDamping Value that will be damped from the frequence level if the note is released. Looks good with 0 but can be used in some combination with millisShift.


Member Function Documentation

int MidiSpectrumAnalyzer_Parse ( byte[]  data  ) 

MidiSpectrumAnalyzer_Parse the midi file.

Parameters:
data Raw data from the midi file.
Returns:
0 if no errors occured else number of the error.

void MidiSpectrumAnalyzer_Reset (  ) 

MidiSpectrumAnalyzer_Reset the timers to 0.

int MidiSpectrumAnalyzer_Update ( long  timeMillis  ) 

MidiSpectrumAnalyzer_Update the timer to some position in the midi song.

Parameters:
timeMillis Current media time. Should be GLLibPlayer.Snd_MediaTimeGet(...) if GLLib is used.
Returns:
0 if no errors occured else number of the error.


Member Data Documentation

final int ERROR_INVALID_FILE_LENGTH = 3 [static]

final int ERROR_INVALID_HEADER_CHUNK = 1 [static]

final int ERROR_INVALID_META_EVENT = 4 [static]

final int ERROR_INVALID_TRACK_CHUNK = 2 [static]

int [] m_barLevels

Array with values of the frequence groups.

int m_bars

Number of frequence groups.

int m_channelFilter = 0x0F

Filter for the channels that the analyzer will monitoring. Good practice is to disable the drumps (channel 10).

long m_currentTime = 0

Current time of the analyzer. If function Snd_MediaTimeGet is not available then this parrameter can be used for the MidiSpectrumAnalyzer_Update plus delta time (analyzer.MidiSpectrumAnalyzer_Update(analyzer.m_currentTime + s_game_frameDT)).

final int NO_ERRORS = 0 [static]


Generated on Tue Sep 23 23:05:32 2008 for GLLib by  doxygen 1.5.2