Protracker playback library with sound effects
1 Attachment(s)
I've managed to translate Phx's Protracker playback routine (as used in Solid Gold and Sqrxz) into a Blitz library.
What sets this library apart from other tracker players is that it works with all system versions (and not only 2.0+ like Ciatrackerlib) and that it supports simultaneous sound effects. The player automatically chooses the most suitable channel to override with sound effects, but you can also reserve certain channels for music only. To install, copy ptplayer.obj to Blitzlibs:Userlibs or Blitzlibs:Otherlibs and rebuild Deflibs using either Blitzlibs:Makedeflibs or using BlitzLibMan from Aminet. Command reference: LoadBank 0,"mod.song",2 (loads module into bank 0 in chipmem (2)) MTInstall PAL=True, NTSC=False (installs player in program) MTInit Bank#, startpos (inserts module into player) MTInit &module_addr, &instr_addr, startpos (inserts INCBIN module into player, set instr_addr to 0 for normal modules) MTPlay On/Off (start/stop module playback) MTEnd (Stop playing current module) MTSoundFX Sound#, volume (0..64) MTSoundFX &sample_addr.l, length.w, period.w, volume.w (0..64) MTMasterVolume 0..64 (Master volume for all music channels) MTMusicMask bitmask.b (Set bits 0-3 to reserve channels for music only.) MTMusicChannels 0..4 (number of channels dedicated to music) MTE8Trigger (Value of the last E8 command in case you want to trigger game events from a module) |
Excellent work, thanks!
|
Please tell me if it works or not so I can fix the code before I forget how it works.
|
I am in need of this library. I will try this out tonight and let you know how it goes. Sorry if this is a few months after you posted, but I just got a CDTV and am trying out development on it.
|
Thanks for reminding me @ChefDeadpool! I will do some testing on the A1200 and CD32 when I find the time. Good work on this one @idrougge!
|
1 Attachment(s)
So, I tried it out. It does work, and seemingly without issue. I ran it in UAE at A500 speeds, and it doesn't seem like it creates a huge performance hit, but I think there is a slight one.
I built the game in this thread with your library. I'm including the new code and exe as well as the original disk's executables here so you can see for yourself. |
I'm just getting weird clicks - hippoplayer works with the mod and identifies it as a protracker mod so I think the mod isn't the issue... Do I need to put the "MTPlay On" in an interrupt on vblank?
Code:
WBStartup |
Quote:
Not sure what the problem is, have you tried a different module just to be sure? |
I think it was some disagreement between winuae and my computer. Restarting everything seems to have made it just work.
|
1 Attachment(s)
I've tracked down the issue - it's "MTInstall". If I comment it out, everything works fine (including the music, oddly enough). With it, Blitz crashes on the second compilation/execution of the code. That's what tripped me up; the first run through seems to work, but editing the source then having another go causes a guru.
The guru is nonsensical from what I can gather. |
That's funny, I did a lot of "MTInstall" when building this library. Is the relevant source the one above or something else?
|
Yes, it's happened with that one; it happens more frequently with the game I'm writing (almost every time). I will be releasing it tomorrow (children permitting), with all the source etc so you can take a look. At the moment MTInstall is commented out and things run fine.
I'm running in winuae, standard a1200 conf + ks/wb3.1 + 8Mb fast. |
Full source is included here : http://eab.abime.net/showthread.php?t=95593
Un-commenting MTInstall reliably causes crashes on second loading / compilation attempts. I'm using the arexx hooks to load compile, following MickGyver's guide. |
Quote:
Quote:
EDIT: The crash is caused by the compilation itself, not when the game runs. If I first "compile and run" the game, it's all fine. If I then choose to create an executable after this, I get the crash. If I load the source and create the executable directly after a reset, it works, and I can run the game over and over without it crashing. |
I'm glad it's not just me!
|
Somehow I missed this thread - I did my own implementation of PTPlayer, but as standard Blitz code rather than a lib (it incbins a compiled assembly of PTPlayer).
So I figure I should use the library here instead - but I'm concerned about the MTInstall thing - was this ever permanently addressed and fixed, or does it need to be worked around? (eg, compiling without running first) EDIT: I read in the other thread (http://eab.abime.net/showpost.php?p=...4&postcount=58) idrougee mentioned that neither MTInstall or MTRemove are needed in the actual game code, as the library loads and unloads these automatically? In any case, what I've done is in the Zone, with some detail below: Tracker files need to be loaded into Chipram using the 'Bank' function, but sound effects can be loaded through the standard Blitz LoadSound function before being played through _mt_playfx. Code:
;Uses PTPlayer by Frank Wille |
Given this library a quick test. All works well. I've taken my attempt out of the zone as idrougge's library is so much better.
Cheers idrougge :great |
How did you get on (or not) with MTInstall?
|
Quote:
|
Can someone please help me with rebuilding deflibs?
I managed to do on Winuae and Amiblitz , running a custom 040 configuration. The library worked fine. But on my vanilla A600 BlitzLibMan just crashes, and I have no idea of what is "Blitzlibs:Makedeflibs", since my Blitz 2 instalation does not have this file... |
All times are GMT +2. The time now is 00:16. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.