English Amiga Board

Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

Thread Tools
Old 18 July 2017, 02:34   #1
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 3,050
Protracker playback library with sound effects

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))
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)
Attached Files
File Type: lha BlitzPhxPlayer.lha (5.8 KB, 25 views)

Last edited by idrougge; 18 July 2017 at 14:17.
idrougge is offline  
AdSense AdSense  
Old 18 July 2017, 11:19   #2
Registered User

Daedalus's Avatar
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 2,279
Excellent work, thanks!
Daedalus is offline  
Old 18 July 2017, 13:36   #3
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 3,050
Please tell me if it works or not so I can fix the code before I forget how it works.
idrougge is offline  
AdSense AdSense  

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Demos with music or sound effects in time with graphic effects mark_k request.Demos 7 07 December 2016 21:23
Sound issue, not all sound effects played. Connorsdad support.WinUAE 16 23 February 2015 17:32
Sound Effects in IK+ noel411 support.Games 3 07 September 2007 04:12
IK+ sound effects not working andreas support.WinUAE 4 26 July 2005 21:21
How to rip sound / effects wlcina support.Games 16 18 April 2005 04:09

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 01:14.

Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.22257 seconds with 13 queries