English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General > Coders. Releases

 
 
Thread Tools
Old 22 February 2021, 22:02   #121
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,537
Quote:
Originally Posted by h0ffman View Post
Anyways, I'll grab your latest beta and give it a try.
Thanks. But there is no beta available, just the patch. I will upload a beta of the source and tell you the URL (maybe after I had a look on the master-volume issue).

Quote:
One thing I have noticed is the master volume doesn't appear to be effecting samples which are already playing.
Indeed. I never noticed that in our games, which offer a volume option in the menu, because new samples are usually playing fast enough.

Quote:
I have a short fade which occurs when soundtracks are switched and the looped samples being played by the mod are not reducing until another sample is played.
Yes, that's annoying. I will have a look these days.

Quote:
Is that how it currently works, i.e. master volume doesn't come into effect until a sample is triggered?
Correct. The volume is always set together with a new sample. But the last volume is stored in the channel status, so I could probably just use this and write a new volume to AUDxVOL whenver the master volume changes. Seems easy.
phx is offline  
Old 23 February 2021, 12:08   #122
h0ffman
Registered User
 
Join Date: Aug 2008
Location: Salisbury
Posts: 750
Legend! Gimme a shout when its ready.
h0ffman is offline  
Old 24 February 2021, 20:13   #123
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,650
Yes! Master volume must be changed on command not trigger because this is used in all kinds of modules to emulate arp/echoes. Sometimes also the notetempo is not fast enough to make a volume fade act fast enough (without some insane fade value requiring a - master volume reset value on the next note).
Photon is offline  
Old 27 February 2021, 19:10   #124
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,537
Latest ptplayer 6.1beta is here:
http://sun.hasenbraten.de/~frank/TEST/ptplayer61beta.lha

Now all channel volumes should be changed immediately during the mt_mastervol() call.
Set NULL_IS_CLEARED=1 to test the idle-looping of samples at $0.

Complete list of changes in current beta:
Code:
- Fixed note delay command (EDx), which still played the previous note
  in some situations (Antiriad/EAB).
- mt_mastervol() must change the volumes of all channels immediately
  and shouldn't wait for the next sample being played.
- Symbol ENABLE_SAWRECT may be used to disable sawtooth and rectangle
  waveforms for vibrato and tremolo, which saves memory for their tables
  (suggested by Antiriad).
- Symbol NULL_IS_CLEARED may be used to indicate that the memory locations
  $0 and $1 in your system are zero, so they will be used for idle-looping
  of audio channels.
- Removed cia.i and custom.i include files and included the required
  symbols directly into the source.
- New function mt_loopfx() for playing looped sound effects.
- New function mt_stopfx() for immediately stopping a sound effect.
phx is offline  
Old 27 February 2021, 20:04   #125
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,053
Not sure how much in demand it would be, but you never know...
Instead of using static tables, you could generate them with a one-time initialization. Why? Well, in case you also need the compressed player to be as short as possible.
Like in my case, I'm using a heavily modded and optimized P612 but the same thing applies, I was able to reduce its compressed size from 2.7kb to 1.7kb (trying to stuff as much as possible within a 5.5kb track, for example) just by generating the vibrato sine table and fine-tuned period table. Each routine is about 40 bytes long (and if you play "dirty" you can scrap that code so it occupies no space once it's done).
The same could be done with master volume and the other 2 vibrato tables. They don't look too complicated.
a/b is offline  
Old 27 February 2021, 20:34   #126
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,537
If I would do that, then it has to be optional. ptplayer is mainly intended for games, where I would rather save some bytes in RAM than on disk.

I remember a few guys here worked on a routine to generate the tables during runtime and maybe you were one of them?
When it really works you can always send me a patch by email and I will try it.
phx is offline  
Old 27 February 2021, 20:39   #127
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,436
Only feature request I'd have is a possibility to configure a channel that the player won't use at all (including no audio interrupts for that channel, nor any other register writes to it). This would make integrating my mixer with your new versions easier than searching through the code myself
roondar is offline  
Old 27 February 2021, 23:42   #128
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,537
Quote:
Originally Posted by roondar View Post
Only feature request I'd have is a possibility to configure a channel that the player won't use at all (including no audio interrupts for that channel, nor any other register writes to it).
Doesn't mt_musicmask() work for your purpose? It makes sure that no sound effects are played on one of more channels. For the music it is up to you. Simply load a MOD which doesn't use the channel. But I have the feeling that I misunderstand you...

EDIT: Oh, I think you mean that audio interrupts are generated because such a channel is idling with a 1-word sample?

Last edited by phx; 27 February 2021 at 23:44. Reason: Ok, maybe now I understand...
phx is offline  
Old 27 February 2021, 23:47   #129
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,436
Hmm, maybe I'm misunderstanding. I'll check with a three channel mod to be sure and come back to you. First have to find one though (as it is, my mixer test program just plays back a 4 channel mod and I've simply hacked the player source to never touch AUD3).
roondar is offline  
Old 28 February 2021, 08:42   #130
Antiriad_UK
OCS forever!
 
Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
Quote:
Originally Posted by a/b View Post
Not sure how much in demand it would be, but you never know...
Instead of using static tables, you could generate them with a one-time initialization. Why? Well, in case you also need the compressed player to be as short as possible.
Like in my case, I'm using a heavily modded and optimized P612 but the same thing applies, I was able to reduce its compressed size from 2.7kb to 1.7kb (trying to stuff as much as possible within a 5.5kb track, for example) just by generating the vibrato sine table and fine-tuned period table. Each routine is about 40 bytes long (and if you play "dirty" you can scrap that code so it occupies no space once it's done).
The same could be done with master volume and the other 2 vibrato tables. They don't look too complicated.
Hey. Could you send me the code for the vib table if you still have it? I’ve got a minimal version of phx’s code for 64k amigaklang intros that already does the period and fine tune tables in code that we worked out in another thread but would be cool to generate more (I’ve not be able to get p61 to work with amigaklang due to the way it modifies samples, and frank’s player is nice to use anyway)

The current modified version is below, I’ll update it with phx’s beta fixes later. I’d cut the master volume as didn’t need it at the mo.

https://github.com/jonathanbennett73...er_minimal.asm


Quote:
Originally Posted by phx View Post
If I would do that, then it has to be optional. ptplayer is mainly intended for games, where I would rather save some bytes in RAM than on disk
I remember a few guys here worked on a routine to generate the tables during runtime and maybe you were one of them?
When it really works you can always send me a patch by email and I will try it.
Me . Hope you ok with me putting my modified version on GitHub with same license, mate.

Last edited by Antiriad_UK; 28 February 2021 at 12:02.
Antiriad_UK is offline  
Old 28 February 2021, 13:06   #131
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,053
Quote:
Originally Posted by Antiriad_UK View Post
Hey. Could you send me the code for the vib table if you still have it?
Comes with a couple of warnings...
Because of effect optimizations the table is negated (negative half of each row comes first), so you'll have to rearrange the move.b order.
This is written for speed and size, not only for size (both code and base table are placed in a disposable area and overwritten after the use, so the size doesn't matter 100%).

Code:
; a3 = FrameCtr (a.k.a. mt_Counter)
	lea	(VibTremTab\.End-64-FrameCtr,a3),a4
	moveq	#15*2,d2
.VTLoop1
	lea	(VibTremTab\.GenData-FrameCtr,a3),a2
	lea	(32,a4),a5
	clr.b	(a4)+
	clr.b	(a5)
	moveq	#64/4-1,d1		; sine with 4x mirroring
.VTLoop2
	move.w	(a2)+,d0
	mulu.w	d2,d0
	swap	d0
	move.b	d0,(32,a4)		; [pi,pi*3/2]
	move.b	d0,(32-1,a5)		; [pi*3/2,pi*2]
	neg.b	d0
	move.b	d0,(a4)+		; [0,pi/2]
	move.b	d0,-(a5)		; [pi/2,pi]
	dbf	d1,.VTLoop2
	lea	(-1-64/4-64,a4),a4	; start of next row
	subq.w	#1*2,d2
	bge.b	.VTLoop1

VibTremTab
.GenData
	DC.W	$1800,$3100,$4a00,$6100,$7800,$8d00,$a100,$b400
	DC.W	$c500,$d400,$e000,$eb00,$f400,$fa00,$fd00,$ff00
.GenDataEnd
	DCB.B	16*64-(.GenDataEnd-.GenData),0

Last edited by a/b; 28 February 2021 at 13:15. Reason: clarification about negated table
a/b is offline  
Old 28 February 2021, 13:38   #132
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,053
OK, I found an older test version, this should probably be more useful to you since it's shorter (only 2x mirroring, but larger base table which shouldn't matter) and no negation:
Code:
	lea	(VibTremTab\.End-64,pc),a1
	moveq	#15*2,d2
.VTLoop1
	lea	(VibTremTab,pc),a0
	moveq	#64/2-1,d1
.VTLoop2
	move.w	(a0)+,d0
	mulu.w	d2,d0
	swap	d0
	move.b	d0,(32,a1)
	neg.b	d0
	move.b	d0,(a1)+
	dbf	d1,.VTLoop2
	lea	(-64/2-64,a1),a1
	subq.w	#1*2,d2
	bge.b	.VTLoop1

VibTremTab
	DC.W	$0000,$1800,$3100,$4a00,$6100,$7800,$8d00,$a100
	DC.W	$b400,$c500,$d400,$e000,$eb00,$f400,$fa00,$fd00
	DC.W	$ff00,$fd00,$fa00,$f400,$eb00,$e000,$d400,$c500
	DC.W	$b400,$a100,$8d00,$7800,$6100,$4a00,$3100,$1800
	DCB.B	15*64,0
.End
a/b is offline  
Old 28 February 2021, 19:03   #133
Antiriad_UK
OCS forever!
 
Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
Quote:
Originally Posted by a/b View Post
OK, I found an older test version, this should probably be more useful to you since it's shorter (only 2x mirroring, but larger base table which shouldn't matter) and no negation:
Thanks, I'll have a look

Edit: This is working nicely! It still seemed that the negative values came first but I just switched the order of the moves around as suggested and it matches the normal values perfectly. I'll add it to the github version shortly. Thanks

Last edited by Antiriad_UK; 28 February 2021 at 20:04.
Antiriad_UK is offline  
Old 28 February 2021, 21:33   #134
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,213
Would be great to have a version of this player with all options available as equates.

I used a stripped down version for Colombia, with the SFX handling stripped out and the master volume removed too (was able to remove all those tables)
DanScott is offline  
Old 28 February 2021, 21:52   #135
Antiriad_UK
OCS forever!
 
Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
Quote:
Originally Posted by DanScott View Post
Would be great to have a version of this player with all options available as equates.

I used a stripped down version for Colombia, with the SFX handling stripped out and the master volume removed too (was able to remove all those tables)
Yeah, I'll do my best to make changes configurable like that. I don't think phx will be keen on a lot of the stuff crazy 64K demo coders want, and the source is _really_ clean at the moment compared to the EQU insanity that is p61 so would be a shame to pollute the original code! So I'll just make available any changes I make as a side-project

Edit: I've updated the modified github version with phx's beta changes and a/b's sine generator. The default player (with all options/sfx turned on) is 13096 bytes. The default player with MINIMAL defined and saw/rect waves disabled is 5457 bytes. The modified player with the period/finetune/sine vibrato generation is 3116 bytes (plus 2672 bss).

Last edited by Antiriad_UK; 01 March 2021 at 11:16. Reason: Updated github.
Antiriad_UK is offline  
Old 01 March 2021, 15:28   #136
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,537
Quote:
Originally Posted by Antiriad_UK View Post
Hope you ok with me putting my modified version on GitHub with same license, mate.
Sure. If you read the license you know that it is public domain.

Quote:
Originally Posted by Antiriad_UK View Post
Yeah, I'll do my best to make changes configurable like that. I don't think phx will be keen on a lot of the stuff crazy 64K demo coders want
LOL
Yes... I would have to see it to judge how intrusive it is. There is already a lot of conditional assembly in the code (MINIMAL & Co).

Quote:
The default player (with all options/sfx turned on) is 13096 bytes. The default player with MINIMAL defined and saw/rect waves disabled is 5457 bytes. The modified player with the period/finetune/sine vibrato generation is 3116 bytes (plus 2672 bss).
Wow! Nice.
phx is offline  
Old 01 March 2021, 17:15   #137
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,213
Just popping Antiriads version into my demo system.

I'm getting a "repeatedly defined symbol" error, as the EQU's for the hardware registers are conflicting with my "custom.inc"

Might be worth popping an "CUSTOM_REGS equ 0/1" or similar, around those (and the CIA defines)
DanScott is offline  
Old 01 March 2021, 17:56   #138
Antiriad_UK
OCS forever!
 
Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
Quote:
Originally Posted by DanScott View Post
Just popping Antiriads version into my demo system.

I'm getting a "repeatedly defined symbol" error, as the EQU's for the hardware registers are conflicting with my "custom.inc"

Might be worth popping an "CUSTOM_REGS equ 0/1" or similar, around those (and the CIA defines)
Good idea.
Antiriad_UK is offline  
Old 01 March 2021, 18:15   #139
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,537
Quote:
Originally Posted by DanScott View Post
I'm getting a "repeatedly defined symbol" error, as the EQU's for the hardware registers are conflicting with my "custom.inc"
Why do you include your custom.inc into ptplayer.asm?

Quote:
Might be worth popping an "CUSTOM_REGS equ 0/1" or similar, around those (and the CIA defines)
Another solution is to generate multiple object files and use a linker. So each module keeps its own namespace.
phx is offline  
Old 01 March 2021, 18:23   #140
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,213
I don't link object files I'm old-school
DanScott is offline  
 


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

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 11:27.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.11768 seconds with 13 queries