Difference between revisions of "Modules/ndp/ndp player/Usage"
From MSX Game Library
< Modules | ndp/ndp player
Line 7: | Line 7: | ||
This binary file include a 7 bytes header used by BASIC's BSAVE/BLOAD instructions. You have to either cut this header or just pass the starting address of binary data offset by 7 bytes. | This binary file include a 7 bytes header used by BASIC's BSAVE/BLOAD instructions. You have to either cut this header or just pass the starting address of binary data offset by 7 bytes. | ||
+ | |||
+ | Example | ||
+ | <syntaxhighlight lang="C"> | ||
+ | #include "mymusic.h" // NDP file converted to .H file using MSXbin | ||
+ | |||
+ | void main() | ||
+ | { | ||
+ | /* ... */ | ||
+ | NDP_SetMusicData(g_MusicData); // or g_MusicData+7 if data include header | ||
+ | NDP_Play(); | ||
+ | /* ... */ | ||
+ | } | ||
+ | </syntaxhighlight> | ||
=== SFX === | === SFX === |
Revision as of 22:35, 12 October 2025
Before using any functions of this module, you must call NDP_Initialize() first.
Music
You can play back music generated with the NDP editor (the music is created using the MML language). The editor is currently only available in Japanese.
MSXgl use .NDP binary file data. It can be generated from the editor pressing ALT+F (ファイル) then ALT+B (名前を付けて曲データをBSAVE形式で保存).
This binary file include a 7 bytes header used by BASIC's BSAVE/BLOAD instructions. You have to either cut this header or just pass the starting address of binary data offset by 7 bytes.
Example
#include "mymusic.h" // NDP file converted to .H file using MSXbin void main() { /* ... */ NDP_SetMusicData(g_MusicData); // or g_MusicData+7 if data include header NDP_Play(); /* ... */ }