GPMID_CreateMidiBuffer function
Allocates a buffer into memory and fills it with the MIDI representation of the piece which is currently loaded.
Syntax
GPMID_ENTRY int GPMID_CreateMidiBuffer( void** aBuffer, unsigned int* aSize );
Parameters
-
aBuffer
A pointer to the buffer containing MIDI data: pass a pointer to the variable that will receive it.
-
aSize
The size of the buffer: pass a pointer to the variable that will receive it.
Return value
Zero on failure, non-zero otherwise.
Remarks
Before using this function, GPMID must have been initialized with GPMID_Init and a tablature must have been successfully loaded with GPMID_Load.
The content of the buffer returned is what would be read into a regular MIDI file. As such, it is suitable for playback by any audio framework supporting MIDI playback from memory, or written down to a .mid file for further playing.
When the buffer is not needed anymore, to free the memory it uses, use GPMID_DestroyMidiBuffer.