1Local copy used for A2DP Source demo in BTstack. 2 3Github repository: https://github.com/jfdelnero/HxCModPlayer 4Thanks for providing this nice and compact implementation! 5 6-------------------------------------------------------------------------------------- 7Original readme.txt 8-------------------------------------------------------------------------------------- 9 10/////////////////////////////////////////////////////////////////////////////////// 11//-------------------------------------------------------------------------------// 12//-------------------------------------------------------------------------------// 13//-----------H----H--X----X-----CCCCC----22222----0000-----0000------11----------// 14//----------H----H----X-X-----C--------------2---0----0---0----0---1-1-----------// 15//---------HHHHHH-----X------C----------22222---0----0---0----0-----1------------// 16//--------H----H----X--X----C----------2-------0----0---0----0-----1-------------// 17//-------H----H---X-----X---CCCCC-----222222----0000-----0000----1111------------// 18//-------------------------------------------------------------------------------// 19//----------------------------------------------------- http://hxc2001.free.fr --// 20/////////////////////////////////////////////////////////////////////////////////// 21 22 HxCMOD player 23 24The HxCMOD player is a tiny music module player. 25 26It currently supports the Noisetracker/Soundtracker/Protracker Module Format (*.mod) 27 28The core (hxcmod.c/hxcmod.h) is designed to have the least external dependency. 29So it should be usable on almost all OS and systems. 30You can use the hxcmod.c / hxcmod.h files to add a mod replay support 31to a demo/game/software. 32 33You are free to do what you want with this code. 34(A credit is always appreciated if you include it into your prod ;) ) 35 36The test program is into the win32 folder. Just drag and drop a mod on the main 37window to load it. Linux & Mac OS X version it planned. 38 39Please note that this core was "Emscriptened" successfully and is now working in 40JavaScript with Android, Chrome, Firefox, Edge, Safari browsers and probably 41with others browsers supporting the Web Audio API support. 42 43You can test it at this address : http://hxc2001.free.fr/hxcmod/ 44 45A video demo of the native Mod player can be seen on youtube : 46https://www.youtube.com/watch?v=MEU9FGZzjac 47 48-------------------------------------------------------------------------------------- 49 HxCMOD Core API 50-------------------------------------------------------------------------------------- 51 52int hxcmod_init( modcontext * modctx ) 53 54- Initialize the modcontext buffer. Must be called before doing anything else. 55 Return 1 if success. 0 in case of error. 56 57int hxcmod_setcfg( modcontext * modctx, int samplerate, int bits, int stereo, int stereo_separation, int filter); 58 59- Configure the player : 60 samplerate specify the sample rate. (44100 by default). 61 bits specify the number of bits (16 bits only for the moment). 62 stereo - if non null, the stereo mode is selected (default) 63 stereo_separation - Left/Right channel separation. 64 filter - if non null, the filter is applied (default) 65 66int hxcmod_load( modcontext * modctx, void * mod_data, int mod_data_size ) 67 68- "Load" a MOD from memory (from "mod_data" with size "mod_data_size"). 69 Return 1 if success. 0 in case of error. 70 71 72void hxcmod_fillbuffer( modcontext * modctx, unsigned short * outbuffer, unsigned long nbsample, tracker_buffer_state * trkbuf ) 73 74- Generate and return the next samples chunk to outbuffer. 75 nbsample specify the number of stereo 16bits samples you want. 76 The output format is signed 44100Hz 16-bit Stereo PCM samples. 77 The output buffer size in byte must be equal to ( nbsample * 2 * 2 ). 78 The optional trkbuf parameter can be used to get detailed status of the player. Put NULL/0 if unused. 79 80 81void hxcmod_unload( modcontext * modctx ) 82- "Unload" / clear the player status. 83 84 85-------------------------------------------------------------------------------------- 86 Files on the repository 87-------------------------------------------------------------------------------------- 88 89- hxcmod.c / hxcmod.h 90The HxC core mod replay routines. These files don't have any dependency with others files 91and can be used into other project. 92 93- framegenerator.c / framegenerator.h 94Generate a 640*480 framebuffer from the player status to be displayed in real-time. 95(not needed by the core) 96 97- win32/ 98The Windows test software. 99(linux & Mac version planned) 100 101- js_emscripten/ 102The Web browser/JavaScript version. (Build with Emscripten) 103 104- packer/ 105Data compression utility. Used to embed one mod and some graphical stuff into the executable. 106Not directly used by the core. 107 108- data/ 109Some packed data files. 110 111-------------------------------------------------------------------------------------- 112 113Jean-Fran�ois DEL NERO (Jeff) / HxC2001 114 115Email : jeanfrancoisdelnero <> free.fr 116 117http://hxc2001.free.fr 118 11911 July 2015 120