xm_lib.h
来自「Genetic Programing of music」· C头文件 代码 · 共 115 行
H
115 行
/****************************************************************************//****************************************************************************//** **//** xm_lib is a set of routines for printing info on the contents of **//** xm music format files and the various components thereof, and for **//** writing simple note information to a standard xm pattern format **//** so that it can be combined with an appropriate header and **//** instruments to make a playable xm file. **//** **//****************************************************************************//****************************************************************************/#ifndef _XM_LIB_H#define _XM_LIB_H/* * fwriteXMPatternNoteData - writes a pattern of note data from the notes * contained in noteString to xmFile. The note values written have * values from 1-72, 1 being C-0, and 88 signaling no note. Only * channel 0 has notes. Notes below 35 use instrument 2, notes * above use instrument 1. Four channels * are used. The returned value is the size of the packed data. */short int fwriteXMPatternNoteData(FILE *xmFile, char *noteString);/* * fwriteXMPatternInfo - writes one pattern worth of data to xmFile. All * notes are in column 0. Notes below 35 use instrument 2, notes * above use instrument 1. 4 channels are used, * and as many pattern rows as there are items in the noteString * which contains the notse for the pattern. */voidfwriteXMPatternInfo(FILE *xmFile, char *noteString);/* * fprintXMHeaderInfo - prints the header info for a XM file to the given * output file. At the end the file pointer will be set to the * beginning of the pattern data. Patterns is returned with the number * of patterns. Instruments is returned with the number of instruments. * Returns '1' if this is not a XM file. */intfprintXMHeaderInfo(FILE *xmFile, FILE *outFile, int *patterns, int *instruments, int *channels);/* * fprintNote - converts note from its numeric format to 'C#0' type * format, and prints it to outfile followed by two spaces. */voidfprintNote(int note, FILE *outFile);/* * fprintXMPatternNoteData - prints one patterns note data in xmFile to * outFile. The size of the data is expected to be dataSize bytes, and * the XM should have 'channels' channels, and 'rows' rows in this * pattern. Expects xmFile to be queued to the beginning of note data, * and leaves xmFile queued to the beginning of the next * pattern/instrument. */void fprintXMPatternNoteData(FILE *xmFile, FILE *outFile, int dataSize, int rows, int channels);/* * fprintXMPatternInfo - prints one patterns data in xmFile to outFile. * Expects xmFile to be queued to the beginning of pattern info, and * leaves xmFile queued to the beginning of the note data. Channels is * the number of channels in this XM file. If printNoteData is true, * the note information is also printed. */voidfprintXMPatternInfo(FILE *xmFile, FILE *outFile, int channels, int printNoteData);/* * fprintXMExtendedInstrumentInfo - prints one instruments extended data, * including details and sample information, in xmFile to * outFile. Expects xmFile to be queued to the beginning of extended * info (sample header size in xm.txt). It returns the size of the * sample headers, and queues the file to the beginning of the first * sample for this instrument. */intfprintXMExtendedInstrumentInfo(FILE *xmFile, FILE *outFile);/* * fprintXMSampleInfo - prints one samples info in xmFile to * outFile. Expects xmFile to be queued to the beginning of sample * info, and queues xmFile to the beginning of the next sample/instrument * when done. headerSize is the size of the sample header, and is * used to skip the file to the next sample header. The returned * value is the length of the sample data. */intfprintXMSampleInfo(FILE *xmFile, FILE *outFile, int headerSize);/* * fprintXMInstrumentInfo - prints one instruments data in xmFile to * outFile. Expects xmFile to be queued to the beginning of instrument * info, and queues xmFile to the beginning of the next instrument/end * of file when done. */voidfprintXMInstrumentInfo(FILE *xmFile, FILE *outFile);#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?