MIPI - Physical Interface for MIDI Files
Loading...
Searching...
No Matches
smf::MidiFile Class Reference

#include <MidiFile.h>

Collaboration diagram for smf::MidiFile:
Collaboration graph

Public Member Functions

 MidiFile (void)
 
 MidiFile (const std::string &filename)
 
 MidiFile (std::istream &input)
 
 MidiFile (const MidiFile &other)
 
 MidiFile (MidiFile &&other)
 
 ~MidiFile ()
 
MidiFileoperator= (const MidiFile &other)
 
MidiFileoperator= (MidiFile &&other)
 
bool read (const std::string &filename)
 
bool read (std::istream &instream)
 
bool readBase64 (const std::string &base64data)
 
bool readBase64 (std::istream &instream)
 
bool readSmf (const std::string &filename)
 
bool readSmf (std::istream &instream)
 
bool write (const std::string &filename)
 
bool write (std::ostream &out)
 
bool writeBase64 (const std::string &out, int width=0)
 
bool writeBase64 (std::ostream &out, int width=0)
 
std::string getBase64 (int width=0)
 
bool writeHex (const std::string &filename, int width=25)
 
bool writeHex (std::ostream &out, int width=25)
 
bool writeBinasc (const std::string &filename)
 
bool writeBinasc (std::ostream &out)
 
bool writeBinascWithComments (const std::string &filename)
 
bool writeBinascWithComments (std::ostream &out)
 
bool status (void) const
 
const MidiEventListoperator[] (int aTrack) const
 
MidiEventListoperator[] (int aTrack)
 
int getTrackCount (void) const
 
int getNumTracks (void) const
 
int size (void) const
 
void removeEmpties (void)
 
void makeDeltaTicks (void)
 
void setDeltaTicks (void)
 
void deltaTicks (void)
 
void makeAbsoluteTicks (void)
 
void setAbsoluteTicks (void)
 
void absoluteTicks (void)
 
int getTickState (void) const
 
bool isDeltaTicks (void) const
 
bool isAbsoluteTicks (void) const
 
void joinTracks (void)
 
void splitTracks (void)
 
void splitTracksByChannel (void)
 
int getTrackState (void) const
 
int hasJoinedTracks (void) const
 
int hasSplitTracks (void) const
 
int getSplitTrack (int track, int index) const
 
int getSplitTrack (int index) const
 
void sortTrack (int track)
 
void sortTrackNoteOnsBeforeOffs (int track)
 
void sortTrackNoteOffsBeforeOns (int track)
 
void sortTracks (void)
 
void sortTracksNoteOnsBeforeOffs (void)
 
void sortTracksNoteOffsBeforeOns (void)
 
void markSequence (void)
 
void markSequence (int track, int sequence=1)
 
void clearSequence (void)
 
void clearSequence (int track)
 
int addTrack (void)
 
int addTrack (int count)
 
int addTracks (int count)
 
void deleteTrack (int aTrack)
 
void mergeTracks (int aTrack1, int aTrack2)
 
int getTrackCountAsType1 (void)
 
void setMillisecondTicks (void)
 
int getTicksPerQuarterNote (void) const
 
int getTPQ (void) const
 
void setTicksPerQuarterNote (int ticks)
 
void setTPQ (int ticks)
 
void doTimeAnalysis (void)
 
double getTimeInSeconds (int aTrack, int anIndex)
 
double getTimeInSeconds (int tickvalue)
 
double getAbsoluteTickTime (double starttime)
 
int getFileDurationInTicks (void)
 
double getFileDurationInQuarters (void)
 
double getFileDurationInSeconds (void)
 
int linkNotePairsFIFO (void)
 
int linkNotePairsLIFO (void)
 
int linkNotePairs (void)
 
int linkEventPairs (void)
 
void clearLinks (void)
 
void setFilename (const std::string &aname)
 
const char * getFilename (void) const
 
MidiEventaddEvent (int aTrack, int aTick, std::vector< uchar > &midiData)
 
MidiEventaddEvent (MidiEvent &mfevent)
 
MidiEventaddEvent (int aTrack, MidiEvent &mfevent)
 
MidiEventgetEvent (int aTrack, int anIndex)
 
const MidiEventgetEvent (int aTrack, int anIndex) const
 
int getEventCount (int aTrack) const
 
int getNumEvents (int aTrack) const
 
void allocateEvents (int track, int aSize)
 
void erase (void)
 
void clear (void)
 
void clear_no_deallocate (void)
 
MidiEventaddNoteOn (int aTrack, int aTick, int aChannel, int key, int vel)
 
MidiEventaddNoteOff (int aTrack, int aTick, int aChannel, int key, int vel)
 
MidiEventaddNoteOff (int aTrack, int aTick, int aChannel, int key)
 
MidiEventaddController (int aTrack, int aTick, int aChannel, int num, int value)
 
MidiEventaddPatchChange (int aTrack, int aTick, int aChannel, int patchnum)
 
MidiEventaddTimbre (int aTrack, int aTick, int aChannel, int patchnum)
 
MidiEventaddPitchBend (int aTrack, int aTick, int aChannel, double amount)
 
void setPitchBendRange (int aTrack, int aTick, int aChannel, double range)
 
MidiEventaddSustain (int aTrack, int aTick, int aChannel, int value)
 
MidiEventaddSustainPedal (int aTrack, int aTick, int aChannel, int value)
 
MidiEventaddSustainOn (int aTrack, int aTick, int aChannel)
 
MidiEventaddSustainPedalOn (int aTrack, int aTick, int aChannel)
 
MidiEventaddSustainOff (int aTrack, int aTick, int aChannel)
 
MidiEventaddSustainPedalOff (int aTrack, int aTick, int aChannel)
 
MidiEventaddMetaEvent (int aTrack, int aTick, int aType, std::vector< uchar > &metaData)
 
MidiEventaddMetaEvent (int aTrack, int aTick, int aType, const std::string &metaData)
 
MidiEventaddText (int aTrack, int aTick, const std::string &text)
 
MidiEventaddCopyright (int aTrack, int aTick, const std::string &text)
 
MidiEventaddTrackName (int aTrack, int aTick, const std::string &name)
 
MidiEventaddInstrumentName (int aTrack, int aTick, const std::string &name)
 
MidiEventaddLyric (int aTrack, int aTick, const std::string &text)
 
MidiEventaddMarker (int aTrack, int aTick, const std::string &text)
 
MidiEventaddCue (int aTrack, int aTick, const std::string &text)
 
MidiEventaddTempo (int aTrack, int aTick, double aTempo)
 
MidiEventaddKeySignature (int aTrack, int aTick, int fifths, bool mode=0)
 
MidiEventaddTimeSignature (int aTrack, int aTick, int top, int bottom, int clocksPerClick=24, int num32dsPerQuarter=8)
 
MidiEventaddCompoundTimeSignature (int aTrack, int aTick, int top, int bottom, int clocksPerClick=36, int num32dsPerQuarter=8)
 
uchar readByte (std::istream &input)
 

Static Public Member Functions

static ushort readLittleEndian2Bytes (std::istream &input)
 
static ulong readLittleEndian4Bytes (std::istream &input)
 
static std::ostream & writeLittleEndianUShort (std::ostream &out, ushort value)
 
static std::ostream & writeBigEndianUShort (std::ostream &out, ushort value)
 
static std::ostream & writeLittleEndianShort (std::ostream &out, short value)
 
static std::ostream & writeBigEndianShort (std::ostream &out, short value)
 
static std::ostream & writeLittleEndianULong (std::ostream &out, ulong value)
 
static std::ostream & writeBigEndianULong (std::ostream &out, ulong value)
 
static std::ostream & writeLittleEndianLong (std::ostream &out, long value)
 
static std::ostream & writeBigEndianLong (std::ostream &out, long value)
 
static std::ostream & writeLittleEndianFloat (std::ostream &out, float value)
 
static std::ostream & writeBigEndianFloat (std::ostream &out, float value)
 
static std::ostream & writeLittleEndianDouble (std::ostream &out, double value)
 
static std::ostream & writeBigEndianDouble (std::ostream &out, double value)
 
static std::string getGMInstrumentName (int patchIndex)
 

Protected Attributes

std::vector< MidiEventList * > m_events
 
int m_ticksPerQuarterNote = 120
 
int m_theTrackState = TRACK_STATE_SPLIT
 
int m_theTimeState = TIME_STATE_ABSOLUTE
 
std::string m_readFileName
 
bool m_timemapvalid = false
 
std::vector< _TickTimem_timemap
 
bool m_rwstatus = true
 
bool m_linkedEventsQ = false
 

Private Member Functions

int extractMidiData (std::istream &inputfile, std::vector< uchar > &array, uchar &runningCommand)
 
ulong readVLValue (std::istream &inputfile)
 
ulong unpackVLV (uchar a=0, uchar b=0, uchar c=0, uchar d=0, uchar e=0)
 
void writeVLValue (long aValue, std::vector< uchar > &data)
 
int makeVLV (uchar *buffer, int number)
 
void buildTimeMap (void)
 
double linearTickInterpolationAtSecond (double seconds)
 
double linearSecondInterpolationAtTick (int ticktime)
 
std::string base64Encode (const std::string &input)
 
std::string base64Decode (const std::string &input)
 

Static Private Member Functions

static int ticksearch (const void *A, const void *B)
 
static int secondsearch (const void *A, const void *B)
 

Static Private Attributes

static const std::string encodeLookup = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
 
static const std::vector< int > decodeLookup
 
static const char * GMinstrument [128]
 

Constructor & Destructor Documentation

◆ MidiFile() [1/5]

smf::MidiFile::MidiFile ( void  )

◆ MidiFile() [2/5]

smf::MidiFile::MidiFile ( const std::string &  filename)
Here is the call graph for this function:

◆ MidiFile() [3/5]

smf::MidiFile::MidiFile ( std::istream &  input)
Here is the call graph for this function:

◆ MidiFile() [4/5]

smf::MidiFile::MidiFile ( const MidiFile other)

◆ MidiFile() [5/5]

smf::MidiFile::MidiFile ( MidiFile &&  other)

◆ ~MidiFile()

smf::MidiFile::~MidiFile ( )
Here is the call graph for this function:

Member Function Documentation

◆ absoluteTicks()

void smf::MidiFile::absoluteTicks ( void  )
Here is the call graph for this function:

◆ addCompoundTimeSignature()

MidiEvent * smf::MidiFile::addCompoundTimeSignature ( int  aTrack,
int  aTick,
int  top,
int  bottom,
int  clocksPerClick = 36,
int  num32dsPerQuarter = 8 
)
Here is the call graph for this function:

◆ addController()

MidiEvent * smf::MidiFile::addController ( int  aTrack,
int  aTick,
int  aChannel,
int  num,
int  value 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addCopyright()

MidiEvent * smf::MidiFile::addCopyright ( int  aTrack,
int  aTick,
const std::string &  text 
)
Here is the call graph for this function:

◆ addCue()

MidiEvent * smf::MidiFile::addCue ( int  aTrack,
int  aTick,
const std::string &  text 
)
Here is the call graph for this function:

◆ addEvent() [1/3]

MidiEvent * smf::MidiFile::addEvent ( int  aTrack,
int  aTick,
std::vector< uchar > &  midiData 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addEvent() [2/3]

MidiEvent * smf::MidiFile::addEvent ( int  aTrack,
MidiEvent mfevent 
)
Here is the call graph for this function:

◆ addEvent() [3/3]

MidiEvent * smf::MidiFile::addEvent ( MidiEvent mfevent)
Here is the call graph for this function:

◆ addInstrumentName()

MidiEvent * smf::MidiFile::addInstrumentName ( int  aTrack,
int  aTick,
const std::string &  name 
)
Here is the call graph for this function:

◆ addKeySignature()

MidiEvent * smf::MidiFile::addKeySignature ( int  aTrack,
int  aTick,
int  fifths,
bool  mode = 0 
)
Here is the call graph for this function:

◆ addLyric()

MidiEvent * smf::MidiFile::addLyric ( int  aTrack,
int  aTick,
const std::string &  text 
)
Here is the call graph for this function:

◆ addMarker()

MidiEvent * smf::MidiFile::addMarker ( int  aTrack,
int  aTick,
const std::string &  text 
)
Here is the call graph for this function:

◆ addMetaEvent() [1/2]

MidiEvent * smf::MidiFile::addMetaEvent ( int  aTrack,
int  aTick,
int  aType,
const std::string &  metaData 
)
Here is the call graph for this function:

◆ addMetaEvent() [2/2]

MidiEvent * smf::MidiFile::addMetaEvent ( int  aTrack,
int  aTick,
int  aType,
std::vector< uchar > &  metaData 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addNoteOff() [1/2]

MidiEvent * smf::MidiFile::addNoteOff ( int  aTrack,
int  aTick,
int  aChannel,
int  key 
)
Here is the call graph for this function:

◆ addNoteOff() [2/2]

MidiEvent * smf::MidiFile::addNoteOff ( int  aTrack,
int  aTick,
int  aChannel,
int  key,
int  vel 
)
Here is the call graph for this function:

◆ addNoteOn()

MidiEvent * smf::MidiFile::addNoteOn ( int  aTrack,
int  aTick,
int  aChannel,
int  key,
int  vel 
)
Here is the call graph for this function:

◆ addPatchChange()

MidiEvent * smf::MidiFile::addPatchChange ( int  aTrack,
int  aTick,
int  aChannel,
int  patchnum 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addPitchBend()

MidiEvent * smf::MidiFile::addPitchBend ( int  aTrack,
int  aTick,
int  aChannel,
double  amount 
)
Here is the call graph for this function:

◆ addSustain()

MidiEvent * smf::MidiFile::addSustain ( int  aTrack,
int  aTick,
int  aChannel,
int  value 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addSustainOff()

MidiEvent * smf::MidiFile::addSustainOff ( int  aTrack,
int  aTick,
int  aChannel 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addSustainOn()

MidiEvent * smf::MidiFile::addSustainOn ( int  aTrack,
int  aTick,
int  aChannel 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addSustainPedal()

MidiEvent * smf::MidiFile::addSustainPedal ( int  aTrack,
int  aTick,
int  aChannel,
int  value 
)
Here is the call graph for this function:

◆ addSustainPedalOff()

MidiEvent * smf::MidiFile::addSustainPedalOff ( int  aTrack,
int  aTick,
int  aChannel 
)
Here is the call graph for this function:

◆ addSustainPedalOn()

MidiEvent * smf::MidiFile::addSustainPedalOn ( int  aTrack,
int  aTick,
int  aChannel 
)
Here is the call graph for this function:

◆ addTempo()

MidiEvent * smf::MidiFile::addTempo ( int  aTrack,
int  aTick,
double  aTempo 
)
Here is the call graph for this function:

◆ addText()

MidiEvent * smf::MidiFile::addText ( int  aTrack,
int  aTick,
const std::string &  text 
)
Here is the call graph for this function:

◆ addTimbre()

MidiEvent * smf::MidiFile::addTimbre ( int  aTrack,
int  aTick,
int  aChannel,
int  patchnum 
)
Here is the call graph for this function:

◆ addTimeSignature()

MidiEvent * smf::MidiFile::addTimeSignature ( int  aTrack,
int  aTick,
int  top,
int  bottom,
int  clocksPerClick = 24,
int  num32dsPerQuarter = 8 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addTrack() [1/2]

int smf::MidiFile::addTrack ( int  count)
Here is the call graph for this function:

◆ addTrack() [2/2]

int smf::MidiFile::addTrack ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addTrackName()

MidiEvent * smf::MidiFile::addTrackName ( int  aTrack,
int  aTick,
const std::string &  name 
)
Here is the call graph for this function:

◆ addTracks()

int smf::MidiFile::addTracks ( int  count)
Here is the call graph for this function:

◆ allocateEvents()

void smf::MidiFile::allocateEvents ( int  track,
int  aSize 
)

◆ base64Decode()

std::string smf::MidiFile::base64Decode ( const std::string &  input)
private
Here is the caller graph for this function:

◆ base64Encode()

std::string smf::MidiFile::base64Encode ( const std::string &  input)
private
Here is the caller graph for this function:

◆ buildTimeMap()

void smf::MidiFile::buildTimeMap ( void  )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ clear()

void smf::MidiFile::clear ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ clear_no_deallocate()

void smf::MidiFile::clear_no_deallocate ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearLinks()

void smf::MidiFile::clearLinks ( void  )
Here is the call graph for this function:

◆ clearSequence() [1/2]

void smf::MidiFile::clearSequence ( int  track)
Here is the call graph for this function:

◆ clearSequence() [2/2]

void smf::MidiFile::clearSequence ( void  )
Here is the call graph for this function:

◆ deleteTrack()

void smf::MidiFile::deleteTrack ( int  aTrack)
Here is the call graph for this function:

◆ deltaTicks()

void smf::MidiFile::deltaTicks ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ doTimeAnalysis()

void smf::MidiFile::doTimeAnalysis ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ erase()

void smf::MidiFile::erase ( void  )
Here is the call graph for this function:

◆ extractMidiData()

int smf::MidiFile::extractMidiData ( std::istream &  inputfile,
std::vector< uchar > &  array,
uchar runningCommand 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAbsoluteTickTime()

double smf::MidiFile::getAbsoluteTickTime ( double  starttime)
Here is the call graph for this function:

◆ getBase64()

std::string smf::MidiFile::getBase64 ( int  width = 0)
Here is the call graph for this function:

◆ getEvent() [1/2]

MidiEvent & smf::MidiFile::getEvent ( int  aTrack,
int  anIndex 
)
Here is the caller graph for this function:

◆ getEvent() [2/2]

const MidiEvent & smf::MidiFile::getEvent ( int  aTrack,
int  anIndex 
) const

◆ getEventCount()

int smf::MidiFile::getEventCount ( int  aTrack) const
Here is the caller graph for this function:

◆ getFileDurationInQuarters()

double smf::MidiFile::getFileDurationInQuarters ( void  )
Here is the call graph for this function:

◆ getFileDurationInSeconds()

double smf::MidiFile::getFileDurationInSeconds ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFileDurationInTicks()

int smf::MidiFile::getFileDurationInTicks ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFilename()

const char * smf::MidiFile::getFilename ( void  ) const
Here is the caller graph for this function:

◆ getGMInstrumentName()

std::string smf::MidiFile::getGMInstrumentName ( int  patchIndex)
static
Here is the caller graph for this function:

◆ getNumEvents()

int smf::MidiFile::getNumEvents ( int  aTrack) const
Here is the caller graph for this function:

◆ getNumTracks()

int smf::MidiFile::getNumTracks ( void  ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSplitTrack() [1/2]

int smf::MidiFile::getSplitTrack ( int  index) const
Here is the call graph for this function:

◆ getSplitTrack() [2/2]

int smf::MidiFile::getSplitTrack ( int  track,
int  index 
) const
Here is the call graph for this function:

◆ getTicksPerQuarterNote()

int smf::MidiFile::getTicksPerQuarterNote ( void  ) const
Here is the caller graph for this function:

◆ getTickState()

int smf::MidiFile::getTickState ( void  ) const
Here is the caller graph for this function:

◆ getTimeInSeconds() [1/2]

double smf::MidiFile::getTimeInSeconds ( int  aTrack,
int  anIndex 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTimeInSeconds() [2/2]

double smf::MidiFile::getTimeInSeconds ( int  tickvalue)
Here is the call graph for this function:

◆ getTPQ()

int smf::MidiFile::getTPQ ( void  ) const
Here is the call graph for this function:

◆ getTrackCount()

int smf::MidiFile::getTrackCount ( void  ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTrackCountAsType1()

int smf::MidiFile::getTrackCountAsType1 ( void  )
Here is the call graph for this function:

◆ getTrackState()

int smf::MidiFile::getTrackState ( void  ) const
Here is the caller graph for this function:

◆ hasJoinedTracks()

int smf::MidiFile::hasJoinedTracks ( void  ) const

◆ hasSplitTracks()

int smf::MidiFile::hasSplitTracks ( void  ) const
Here is the caller graph for this function:

◆ isAbsoluteTicks()

bool smf::MidiFile::isAbsoluteTicks ( void  ) const

◆ isDeltaTicks()

bool smf::MidiFile::isDeltaTicks ( void  ) const
Here is the caller graph for this function:

◆ joinTracks()

void smf::MidiFile::joinTracks ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ linearSecondInterpolationAtTick()

double smf::MidiFile::linearSecondInterpolationAtTick ( int  ticktime)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ linearTickInterpolationAtSecond()

double smf::MidiFile::linearTickInterpolationAtSecond ( double  seconds)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ linkEventPairs()

int smf::MidiFile::linkEventPairs ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ linkNotePairs()

int smf::MidiFile::linkNotePairs ( void  )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ linkNotePairsFIFO()

int smf::MidiFile::linkNotePairsFIFO ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ linkNotePairsLIFO()

int smf::MidiFile::linkNotePairsLIFO ( void  )
Here is the call graph for this function:

◆ makeAbsoluteTicks()

void smf::MidiFile::makeAbsoluteTicks ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeDeltaTicks()

void smf::MidiFile::makeDeltaTicks ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeVLV()

int smf::MidiFile::makeVLV ( uchar buffer,
int  number 
)
private
Here is the caller graph for this function:

◆ markSequence() [1/2]

void smf::MidiFile::markSequence ( int  track,
int  sequence = 1 
)
Here is the call graph for this function:

◆ markSequence() [2/2]

void smf::MidiFile::markSequence ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mergeTracks()

void smf::MidiFile::mergeTracks ( int  aTrack1,
int  aTrack2 
)
Here is the call graph for this function:

◆ operator=() [1/2]

MidiFile & smf::MidiFile::operator= ( const MidiFile other)
Here is the call graph for this function:

◆ operator=() [2/2]

MidiFile & smf::MidiFile::operator= ( MidiFile &&  other)

◆ operator[]() [1/2]

MidiEventList & smf::MidiFile::operator[] ( int  aTrack)

◆ operator[]() [2/2]

const MidiEventList & smf::MidiFile::operator[] ( int  aTrack) const
Here is the caller graph for this function:

◆ read() [1/2]

bool smf::MidiFile::read ( const std::string &  filename)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read() [2/2]

bool smf::MidiFile::read ( std::istream &  instream)
Here is the call graph for this function:

◆ readBase64() [1/2]

bool smf::MidiFile::readBase64 ( const std::string &  base64data)
Here is the call graph for this function:

◆ readBase64() [2/2]

bool smf::MidiFile::readBase64 ( std::istream &  instream)
Here is the call graph for this function:

◆ readByte()

uchar smf::MidiFile::readByte ( std::istream &  input)
Here is the caller graph for this function:

◆ readLittleEndian2Bytes()

ushort smf::MidiFile::readLittleEndian2Bytes ( std::istream &  input)
static
Here is the caller graph for this function:

◆ readLittleEndian4Bytes()

ulong smf::MidiFile::readLittleEndian4Bytes ( std::istream &  input)
static
Here is the caller graph for this function:

◆ readSmf() [1/2]

bool smf::MidiFile::readSmf ( const std::string &  filename)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readSmf() [2/2]

bool smf::MidiFile::readSmf ( std::istream &  instream)
Here is the call graph for this function:

◆ readVLValue()

ulong smf::MidiFile::readVLValue ( std::istream &  inputfile)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeEmpties()

void smf::MidiFile::removeEmpties ( void  )

◆ secondsearch()

int smf::MidiFile::secondsearch ( const void *  A,
const void *  B 
)
staticprivate
Here is the caller graph for this function:

◆ setAbsoluteTicks()

void smf::MidiFile::setAbsoluteTicks ( void  )
inline
Here is the call graph for this function:

◆ setDeltaTicks()

void smf::MidiFile::setDeltaTicks ( void  )
inline
Here is the call graph for this function:

◆ setFilename()

void smf::MidiFile::setFilename ( const std::string &  aname)
Here is the caller graph for this function:

◆ setMillisecondTicks()

void smf::MidiFile::setMillisecondTicks ( void  )

◆ setPitchBendRange()

void smf::MidiFile::setPitchBendRange ( int  aTrack,
int  aTick,
int  aChannel,
double  range 
)
Here is the call graph for this function:

◆ setTicksPerQuarterNote()

void smf::MidiFile::setTicksPerQuarterNote ( int  ticks)
Here is the caller graph for this function:

◆ setTPQ()

void smf::MidiFile::setTPQ ( int  ticks)
Here is the call graph for this function:

◆ size()

int smf::MidiFile::size ( void  ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sortTrack()

void smf::MidiFile::sortTrack ( int  track)
inline
Here is the call graph for this function:

◆ sortTrackNoteOffsBeforeOns()

void smf::MidiFile::sortTrackNoteOffsBeforeOns ( int  track)
Here is the call graph for this function:

◆ sortTrackNoteOnsBeforeOffs()

void smf::MidiFile::sortTrackNoteOnsBeforeOffs ( int  track)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sortTracks()

void smf::MidiFile::sortTracks ( void  )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sortTracksNoteOffsBeforeOns()

void smf::MidiFile::sortTracksNoteOffsBeforeOns ( void  )
Here is the call graph for this function:

◆ sortTracksNoteOnsBeforeOffs()

void smf::MidiFile::sortTracksNoteOnsBeforeOffs ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ splitTracks()

void smf::MidiFile::splitTracks ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ splitTracksByChannel()

void smf::MidiFile::splitTracksByChannel ( void  )
Here is the call graph for this function:

◆ status()

bool smf::MidiFile::status ( void  ) const
Here is the caller graph for this function:

◆ ticksearch()

int smf::MidiFile::ticksearch ( const void *  A,
const void *  B 
)
staticprivate
Here is the caller graph for this function:

◆ unpackVLV()

ulong smf::MidiFile::unpackVLV ( uchar  a = 0,
uchar  b = 0,
uchar  c = 0,
uchar  d = 0,
uchar  e = 0 
)
private
Here is the caller graph for this function:

◆ write() [1/2]

bool smf::MidiFile::write ( const std::string &  filename)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ write() [2/2]

bool smf::MidiFile::write ( std::ostream &  out)
Here is the call graph for this function:

◆ writeBase64() [1/2]

bool smf::MidiFile::writeBase64 ( const std::string &  out,
int  width = 0 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeBase64() [2/2]

bool smf::MidiFile::writeBase64 ( std::ostream &  out,
int  width = 0 
)
Here is the call graph for this function:

◆ writeBigEndianDouble()

std::ostream & smf::MidiFile::writeBigEndianDouble ( std::ostream &  out,
double  value 
)
static

◆ writeBigEndianFloat()

std::ostream & smf::MidiFile::writeBigEndianFloat ( std::ostream &  out,
float  value 
)
static

◆ writeBigEndianLong()

std::ostream & smf::MidiFile::writeBigEndianLong ( std::ostream &  out,
long  value 
)
static

◆ writeBigEndianShort()

std::ostream & smf::MidiFile::writeBigEndianShort ( std::ostream &  out,
short  value 
)
static

◆ writeBigEndianULong()

std::ostream & smf::MidiFile::writeBigEndianULong ( std::ostream &  out,
ulong  value 
)
static
Here is the caller graph for this function:

◆ writeBigEndianUShort()

std::ostream & smf::MidiFile::writeBigEndianUShort ( std::ostream &  out,
ushort  value 
)
static
Here is the caller graph for this function:

◆ writeBinasc() [1/2]

bool smf::MidiFile::writeBinasc ( const std::string &  filename)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeBinasc() [2/2]

bool smf::MidiFile::writeBinasc ( std::ostream &  out)
Here is the call graph for this function:

◆ writeBinascWithComments() [1/2]

bool smf::MidiFile::writeBinascWithComments ( const std::string &  filename)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeBinascWithComments() [2/2]

bool smf::MidiFile::writeBinascWithComments ( std::ostream &  out)
Here is the call graph for this function:

◆ writeHex() [1/2]

bool smf::MidiFile::writeHex ( const std::string &  filename,
int  width = 25 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeHex() [2/2]

bool smf::MidiFile::writeHex ( std::ostream &  out,
int  width = 25 
)
Here is the call graph for this function:

◆ writeLittleEndianDouble()

std::ostream & smf::MidiFile::writeLittleEndianDouble ( std::ostream &  out,
double  value 
)
static

◆ writeLittleEndianFloat()

std::ostream & smf::MidiFile::writeLittleEndianFloat ( std::ostream &  out,
float  value 
)
static

◆ writeLittleEndianLong()

std::ostream & smf::MidiFile::writeLittleEndianLong ( std::ostream &  out,
long  value 
)
static

◆ writeLittleEndianShort()

std::ostream & smf::MidiFile::writeLittleEndianShort ( std::ostream &  out,
short  value 
)
static

◆ writeLittleEndianULong()

std::ostream & smf::MidiFile::writeLittleEndianULong ( std::ostream &  out,
ulong  value 
)
static

◆ writeLittleEndianUShort()

std::ostream & smf::MidiFile::writeLittleEndianUShort ( std::ostream &  out,
ushort  value 
)
static

◆ writeVLValue()

void smf::MidiFile::writeVLValue ( long  aValue,
std::vector< uchar > &  data 
)
private
Here is the caller graph for this function:

Member Data Documentation

◆ decodeLookup

const std::vector< int > smf::MidiFile::decodeLookup
staticprivate
Initial value:
{
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,
-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
}

◆ encodeLookup

const std::string smf::MidiFile::encodeLookup = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
staticprivate

◆ GMinstrument

const char * smf::MidiFile::GMinstrument
staticprivate
Initial value:
= {
"acoustic grand piano", "bright acoustic piano", "electric grand piano", "honky-tonk piano", "rhodes piano", "chorused piano",
"harpsichord", "clavinet", "celeste", "glockenspiel", "music box", "vibraphone",
"marimba", "xylophone", "tubular bells", "dulcimer", "hammond organ", "percussive organ",
"rock organ", "church organ", "reed organ", "accordion", "harmonica", "tango accordion",
"nylon guitar", "steel guitar", "jazz guitar", "clean guitar", "muted guitar", "overdriven guitar",
"distortion guitar", "guitar harmonics", "acoustic bass", "fingered electric bass", "picked electric bass", "fretless bass",
"slap bass 1", "slap bass 2", "synth bass 1", "synth bass 2", "violin", "viola",
"cello", "contrabass", "tremolo strings", "pizzcato strings", "orchestral harp", "timpani",
"string ensemble 1", "string ensemble 2", "synth strings 1", "synth strings 1", "choir aahs", "voice oohs",
"synth voices", "orchestra hit", "trumpet", "trombone", "tuba", "muted trumpet",
"frenc horn", "brass section", "syn brass 1", "synth brass 2", "soprano sax", "alto sax",
"tenor sax", "baritone sax", "oboe", "english horn", "bassoon", "clarinet",
"piccolo", "flute", "recorder", "pan flute", "bottle blow", "shakuhachi",
"whistle", "ocarina", "square wave", "saw wave", "calliope lead", "chiffer lead",
"charang lead", "voice lead", "fifths lead", "brass lead", "newage pad", "warm pad",
"polysyn pad", "choir pad", "bowed pad", "metallic pad", "halo pad", "sweep pad",
"rain", "soundtrack", "crystal", "atmosphere", "brightness", "goblins",
"echoes", "sci-fi", "sitar", "banjo", "shamisen", "koto",
"kalimba", "bagpipes", "fiddle", "shanai", "tinkle bell", "agogo",
"steel drums", "woodblock", "taiko drum", "melodoc tom", "synth drum", "reverse cymbal",
"guitar fret noise", "breath noise", "seashore", "bird tweet", "telephone ring", "helicopter",
"applause", "gunshot"
}

◆ m_events

std::vector<MidiEventList*> smf::MidiFile::m_events
protected

◆ m_linkedEventsQ

bool smf::MidiFile::m_linkedEventsQ = false
protected

◆ m_readFileName

std::string smf::MidiFile::m_readFileName
protected

◆ m_rwstatus

bool smf::MidiFile::m_rwstatus = true
protected

◆ m_theTimeState

int smf::MidiFile::m_theTimeState = TIME_STATE_ABSOLUTE
protected

◆ m_theTrackState

int smf::MidiFile::m_theTrackState = TRACK_STATE_SPLIT
protected

◆ m_ticksPerQuarterNote

int smf::MidiFile::m_ticksPerQuarterNote = 120
protected

◆ m_timemap

std::vector<_TickTime> smf::MidiFile::m_timemap
protected

◆ m_timemapvalid

bool smf::MidiFile::m_timemapvalid = false
protected

The documentation for this class was generated from the following files: