15 August 2012, 10:24 | #1 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,553
|
Protracker player with support for external sound fx
Yesterday I uploaded my new protracker player from Sqrxz to Aminet:
http://aminet.net/mus/play/ptplayer.lha This player is quite optimized and has some useful features for game developers: - Insert external sound effects into the replayed module. - A fast master volume for the replayed music. - No busy waiting. DMA and repeat pointers are set with timer interrupts. - E8 command can be used as a trigger for your main program. The sound fx system will always block the channel which would be free for the longest period. This has the effect that the replayed song is often not disturbed at all. Up to four sound fx can be played at the same time (which would block all four music channels for this period). The master volume is always applied to the music, but does not affect external sound fx. |
15 August 2012, 10:49 | #2 |
Registered User
Join Date: May 2001
Location: ?
Posts: 19,658
|
Awesome
|
15 August 2012, 11:55 | #3 |
Registered User
Join Date: Sep 2004
Location: Brasil
Age: 50
Posts: 181
|
AMAZING!!!
|
10 October 2012, 09:31 | #4 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,553
|
The player was updated on Aminet today. I fixed some minor bugs in the tone-portamento (3) and note-cut (EC) commands.
|
22 March 2014, 16:14 | #5 |
Registered User
Join Date: Oct 2013
Location: Hamburg
Posts: 70
|
Great stuff. Works like a charm, thanks a million!
|
13 May 2014, 21:07 | #6 |
Registered User
|
can't assemble : (Asm-Pro V1.18)
>a Pass 1.. ** Illegal Operator 101 near a4 > |
14 May 2014, 13:35 | #7 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,553
|
From the ReadMe:
Code:
The source is tested with the vasm assembler, but should work with most assemblers after minor modifications (e.g. NEAR directive). Static variables are accessed using the Small Data model, with base register in A4. The "minor" modifications would include: - remove "xref _LinkerDB" and "near a4" - remove the two "lea _LinkerDB,a4" - remove the "(a4)" in all base-relative addressing modes - optionally rename or remove "section __MERGED,bss" The resulting code will be bigger and slower, but it might assemble with AsmPro after after that. |
14 May 2014, 15:00 | #8 |
Registered User
Join Date: May 2010
Location: London, UK
Posts: 268
|
I did more or less that to get it working with my devpac environment a while ago. It works a treat, but I didn't give any thought to the speed though - is it likely to be significantly slower?
|
14 May 2014, 17:48 | #9 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,553
|
I didn't make any tests, but there are more than 130 base-relative instructions in the source, and some of them are executed multiple times in each frame. The difference to an absolute 32-bit addressing mode is 4 68000 cycles.
You can get some speed back by converting the read operations to PC-relative. |
14 May 2014, 20:47 | #10 |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,643
|
or leave the a4 basereg in there, and explicitly subtract the base address label in the offsets..
|
15 May 2014, 09:51 | #11 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,553
|
Or use the AsmPro/AsmOne BASEREG directive.
|
15 May 2014, 10:44 | #12 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,865
|
I have adapted the source, it doesn't use "near" anymore which means it should be possible to assemble with all "standard" assemblers (for this reason I have not used "BASEREG" either). I have added "mt_var" (i.e. NEAR a4 has been replaced with lea mt_var,a4) and changed all a4 references accordingly. I haven't tested the replayer but at least it can be assembled with ASM-Pro now.
Last edited by StingRay; 20 May 2014 at 11:38. |
15 May 2014, 13:00 | #13 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,865
|
Following slight (untested!) optimisation could be done in the "mt_mastervol" routine:
Instead of Code:
lea mt_MasterVolTabs(pc),a0 add.w d0,d0 add.w d0,d0 move.l (a0,d0.w),mt_MasterVolTab-mt_var(a4) Code:
; stingray, since each volume table has a size of 65 bytes ; we simply multiply (optimised of course) by 65 to get the ; offset to the correct table lea MasterVolTab0(pc),a0 add.w d0,a0 lsl.w #6,d0 add.w d0,a0 move.l a0,mt_MasterVolTab-mt_var(a4) |
15 May 2014, 13:02 | #14 |
Registered User
Join Date: May 2010
Location: London, UK
Posts: 268
|
I'll give that a whirl on devpac later with my current project. If saves a few cycles over my own version of this protracker player I'll gladly use it
|
19 May 2014, 10:06 | #15 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,553
|
Quote:
Also _LinkerDB has to be removed. The interrupts were still using it to initialize the small data base. Indeed, I missed that. Very good. I take it! Last edited by TCD; 20 May 2014 at 13:21. Reason: Back-to-back posts merged |
|
20 May 2014, 11:37 | #16 | |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,865
|
I know, saw it after I added the line of code there and didn't bother to remove it. As it is it's pretty much useless of course!
Quote:
I have adapted the source a bit more (all branches have distance specifiers now (.b wherever possible), above mentioned problems fixed, mt_mastervol optimised etc.) and also tested the replayer, it works fine for me! I have added 2 options as well: MT_NOBSS, this can be set to 0 or <0>, if it's not set to zero the BSS section for the variables will be removed, useful if one needs pc-relative code (the replayer isn't 100% pc-relative yet though) MT_INITA4: if this is set to anything else than 0 all routines which require a4 to be initialised will contain an additional "lea mt_var,a4" line Updated and working version of the source attached to this post, example how to call the replayer added too (check beginning of the source). Excellent. |
|
21 May 2014, 21:21 | #17 |
Gets there in the end...
Join Date: Sep 2005
Location: Wales
Posts: 874
|
Might be a long shot but can anyone (or is it even possible to!) make a Blitzlib out of this?
|
25 May 2014, 13:44 | #18 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,553
|
I have no idea how a BlitzBasic library looks like. Maybe when I find some documentation about it.
|
27 May 2014, 21:36 | #19 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,553
|
Quote:
I plan to update the player on Aminet these days, as the version used in Solid Gold was improved a bit over the last Aminet release. For example mt_init allows to start a song at any position and you may optionally split your MOD (move samples to Chip RAM, keep the rest in Fast RAM). I would also like to include an alternative version without small data, which assembles with Devpac and AsmOne/Pro. For that I used your modified source and merged it with the latest version. You find it attached. I made some tests with it and it seems to work fine. I assembed it successfully with PhxAss, vasm, Devpac, AsmPro and snma. |
|
29 May 2014, 00:02 | #20 | |
Going nowhere
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 9,020
|
Quote:
However, not sure if its something i'm doing wrong, or if theres a problem with the routine, but i've tried two separate modules now, and after playing about 20 seconds or so, both stop playing using this routine. Is it just me? |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
MOD-player with external sound effects | phx | Coders. Asm / Hardware | 14 | 18 June 2012 10:41 |
Amiga Forever&Protracker bad sound | moriez | support.WinUAE | 14 | 06 January 2009 01:26 |
What was the first Amiga tracker to support external midi instruments | Kola | Amiga scene | 3 | 09 December 2008 19:20 |
Sound/Protracker package | Dunny | request.Apps | 3 | 23 July 2008 19:17 |
Sampled sound player? | cdoty | Coders. General | 7 | 25 August 2007 16:21 |
|
|