player.cpp
40 #define T2MS(ticks) (((double)ticks)*(double)60000L)/((double)tempoToMetronomeTempo(tempo)*(double)info->ticksPerCuarterNote)
42 #define MS2T(ms) (((ms)*(double)tempoToMetronomeTempo(tempo)*(double)info->ticksPerCuarterNote)/((double)60000L))
371 if ((strcmp(pspev->text,lasttext)!=0)||(pspev->absmilliseconds!=lasttexttime)||(pspev->type!=lasttexttype))
502 if (ev->vel==0) {printf("note off at %g\n",minTime);na->add((ulong)minTime,ev->chn,0, ev->note);}
921 printf("t:%d ticks:%d diff:%ld abs:%ld s:%s tempo:%ld\n",pspev->type,pspev->ticks,pspev->diffmilliseconds,pspev->absmilliseconds,pspev->text,pspev->tempo);
void noteOn(uchar chn, uchar note, uchar vel)
Sends a Note On MIDI event.
Definition: deviceman.cpp:496
void chnPitchBender(uchar chn, uchar lsb, uchar msb)
Changes the Pitch Bender value on a MIDI channel.
Definition: deviceman.cpp:521
void wait(double ms)
Sets the number of milliseconds at which the next event will be sent.
Definition: deviceman.cpp:537
void chnPatchChange(uchar chn, uchar patch)
Changes the patch (instrument) on a MIDI channel.
Definition: deviceman.cpp:511
int midiPorts(void)
Returns the number of MIDI ports available on the system.
Definition: deviceman.h:504
int setPatchesToUse(int *patchesused)
Loads the patches you're going to use .
Definition: deviceman.cpp:794
void chnController(uchar chn, uchar ctl, uchar v)
Sends a Controller event to a MIDI channel.
Definition: deviceman.cpp:526
void initDev(void)
Calls MidiOut::initDev() in turn in each of the available devices.
Definition: deviceman.cpp:482
void setVolumePercentage(int i)
Changes the "master" volume of the played events by altering next volume controller events.
Definition: deviceman.cpp:808
void chnPressure(uchar chn, uchar vel)
Changes the Pressure (Aftertouch) on a MIDI channel.
Definition: deviceman.cpp:516
void noteOff(uchar chn, uchar note, uchar vel)
Sends a Note Off MIDI event.
Definition: deviceman.cpp:501
void keyPressure(uchar chn, uchar note, uchar vel)
Sends a Key Pressure (or Aftertouch) MIDI event.
Definition: deviceman.cpp:506
void tmrSetTempo(int v)
Sets the tempo which will be used to convert between ticks and milliseconds.
Definition: deviceman.cpp:553
int synthDevices(void)
Returns the number of internal synthesizers available on the system.
Definition: deviceman.h:515
int loadSong(const char *filename)
Loads a Song, and parses it (it the parse wasn't disabled with setParseSong() ) .
Definition: player.cpp:89
void setPos(ulong gotomsec, class MidiStatus *midistat)
Sets the position in a song.
Definition: player.cpp:795
void play(bool calloutput=false, void output(void)=0)
Plays the song using the DeviceManager object supplied in the constructor.
Definition: player.cpp:531
void setGenerateBeats(bool b=false)
Enables or disables the generation of beats event in a song when loading it.
Definition: player.cpp:932
void setParseSong(bool b=true)
Enables or disables the parsing of the song when loading it.
Definition: player.cpp:927
void setTempoRatio(double ratio)
Changes the speed at which a song is played.
Definition: player.cpp:937
void removeSong(void)
Unloads the current song, so that every internal variable is empty and clean for further usage.
Definition: player.cpp:65
void chnPitchBender(uchar chn, uchar lsb, uchar msb)
Stores a new pitch bender value in channel chn.
Definition: midistat.cpp:71
void chnPressure(uchar chn, uchar vel)
Stores a new channel pressure value in channel chn.
Definition: midistat.cpp:66
void chnController(uchar chn, uchar ctl, uchar v)
Stores a new value for controller ctl in channel chn.
Definition: midistat.cpp:76
void chnPatchChange(uchar chn, uchar patch)
Stores a new patch in channel chn.
Definition: midistat.cpp:61
void sendData(class DeviceManager *midi, int gm=1)
Sends the current MIDI state to the DeviceManager object used as parameter (you should have already s...
Definition: midistat.cpp:89
void readEvent(MidiEvent *ev)
Reads the event at the iterator position, and puts it on the structure pointed to by ev.
Definition: track.cpp:190
int currentMs(double ms)
Returns the current millisecond which the iterator is at.
Definition: track.cpp:174
double absMsOfNextEvent(void)
Returns the absolute number of milliseconds of the next event.
Definition: track.h:212
void add(ulong ms, int chn, int cmd, int note)
Adds a note/patch event at a given millisecond.
Definition: notearray.cpp:80
PlayerController is a struct that is used by the MidiPlayer object to tell other parts of the applica...
Definition: player.h:139
volatile int OK
When pause is released, if the caller must know when the player has opened the devices and is playing...
Definition: player.h:157
volatile int playing
When the player is playing (or paused), playing is set to 1.
Definition: player.h:162
volatile int pgm[16]
Force a given patch in each channel at "this" moment, as determined by forcepgm.
Definition: player.h:221
volatile int gm
If gm is 1, the song follows the General Midi standard, if gm is 0, the song is in MT 32 format.
Definition: player.h:202
volatile int moving
When the player seeking the position of the song, moving is set to 1.
Definition: player.h:172
volatile int volumepercentage
100 means no change, 50 halfs the volume, 200 doubles it (if possible), etc.
Definition: player.h:209
volatile int finished
When the player has finished playing a song, finished is set to 1.
Definition: player.h:177
volatile bool forcepgm[16]
Activate or disactivate the force to use a patch for a given channel.
Definition: player.h:215
This struct stores text, lyrics and change tempo events among others.
Definition: player.h:49
int ticks
MIDI ticks (from the beginning of the song) at which this event is played.
Definition: player.h:73
struct SpecialEvent * next
This struct stores text, lyrics and change tempo events among others.
Definition: player.h:121
ulong absmilliseconds
The absolute millisecond (from the beginning of the song) at which this SpecialEvent object is played...
Definition: player.h:68