English Amiga Board


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

 
 
Thread Tools
Old 21 October 2019, 18:44   #61
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,928
An update to the latest version of Phx's library is probably overdue. :/
idrougge is offline  
Old 18 November 2019, 12:35   #62
MickGyver
Registered User

MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 503
Quote:
Originally Posted by idrougge View Post
An update to the latest version of Phx's library is probably overdue. :/
I used a diff tool in an attempt to build a 5.3 version of this library. Got nowhere though. I'm not familiar with assemblers, I tried Asm-One, but get an error at the first astatement, next line "args word,byte" throws an error: "Illegal operand". What assembler did you use to build this and what extra steps would one need to take?

Attached is the updated source if you want to try and build it.

Last edited by MickGyver; 27 November 2019 at 09:41. Reason: Removed the attached source, not needed any more.
MickGyver is offline  
Old 18 November 2019, 13:02   #63
MickGyver
Registered User

MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 503
I tried VASM, there I get a few errors about missing symbols (runerrs, _soundobjectcheck and _volumecheck). Searched the sources and it seems that those symbols are indeed missing.

EDIT: I replaced the symbol names with zeroes, it then compiles, I get no errors when I run an example, but only get silence. Building the source on GitHub with vasm also results in just silence, no errors or crashes. Maybe that version you (idrougge) uploaded to GitHub is an older unfinished version?

Code:
error 3009 in line 7 of "libheader": undefined symbol <runerrs> at CODE+0x2c, reloc type 1
        called from line 112 of "ptplayer.asm"
>            Dc.l    \4,0,0,0,\5

error 3009 in line 2 of "subs": undefined symbol <_soundobjectcheck> at CODE+0x202, reloc type 1
        called from line 153 of "ptplayer.asm"
>            Dc.w    \2

error 3009 in line 2 of "subs": undefined symbol <_volumecheck> at CODE+0x270, reloc type 1
        called from line 159 of "ptplayer.asm"
>            Dc.w    \2

Last edited by MickGyver; 18 November 2019 at 20:30.
MickGyver is offline  
Old 27 November 2019, 09:40   #64
MickGyver
Registered User

MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 503
Since I couldn't get any sound from idrougge's source when compiling with VASM, I started from "scratch" with the v5.3 source and referenced the library source based on v5.0 by idrougge. This version might still need some fixes, I have not tested everything thoroughly yet.

Attached is version 5.3 of the bb2 library, with an added statement (below). All the statements from v5.0 work but the author of the original library (phx) recommends to use the new MTPlayFX statement instead of MTSoundFX.

New statement and newtype to use with it
Code:
MTPlayFX sfxStructAddress.l

NEWTYPE .sfx
  sfxPtr.l ; Pointer to sample start in chip ram, even address
  sfxLen.w ; Sample length
  sfxPer.w ; Hardware replay period for sample
  sfxVol.w ; Volume 0..64, is unaffected by the song's master volume
  sfxCha.b ; 0..3 selected replay channel, -1 selects best channel
  sfxPri.b ; unsigned priority, must be non-zero
End NEWTYPE
The archive includes an include file with the sfx structure as a newtype, and a statement to initialize the newtype from a sound object. Also included is the source, an example and a .bat file with the command used to compile the library using VASM.

Changelog (for the original library)
Code:
5.1:
- Included C header file, ptplayer.h, provided by BSzili.
- Fixed bug where other level 6 interrupts could trigger sample replay.
- Eliminated relocations in the fine-tune table, by replacing pointers
  with word-offsets (asman).
- More optimizations in the Timer B interrupt handlers and made it
  PC-relative (asman).
- Include a public domain license.

5.2:
- Make it work with broken mods, which have a sample repeat length of zero.
- Never break looped samples with sound effects, except we have looped
  samples on all four channels at once!
- New variable _mt_SongEnd to automatically stop the song when having
  played the last position. Don't use it! Doesn't work perfectly yet.

5.3:
- No longer clear the first word of each sample for idle looping.
  Either we have a good Amiga tracker MOD with repeat-length one, which
  already cleared that word, or we have a PC tracker MOD with a zero
  repeat length. In the latter case the idle loop will now point to
  address $0. Make sure that the word at this address is cleared!
- Treat samples with a length of one word the same as with zero length
  as a workaround for broken PC trackers.
- Changed APTR to void* in the C headers, for better Kickstart 1.x
  OS header file compatibility.
- Fixed detection of negative fine-tuning (broken due to optimizations
  in V5.1).
Attached Files
File Type: zip ptplayer53.zip (52.9 KB, 9 views)
MickGyver is offline  
Old 27 November 2019, 13:49   #65
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 4,346
Excellent, thanks! I'll try this library out in a project I'm working on (when I have the time...)

The first change about not clearing the first word: Is that fixing an issue I think I had with the older version where certain sound effects were getting stuck playing a high pitched note? I hadn't gotten around to clearing the first two bytes of the sample to confirm it...
Daedalus is offline  
Old 27 November 2019, 14:43   #66
Cobe
Registered User

 
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 36
Posts: 681
Fabulous!
I've just fiddled with the example and it works.
sfxCha.b was exactly what I missed in previous version.
Thanks!
Cobe is offline  
Old 27 November 2019, 14:49   #67
MickGyver
Registered User

MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 503
Quote:
Originally Posted by Daedalus View Post
The first change about not clearing the first word: Is that fixing an issue I think I had with the older version where certain sound effects were getting stuck playing a high pitched note? I hadn't gotten around to clearing the first two bytes of the sample to confirm it...
I have no idea to be honest, I still think the first word needs to be cleared. It has got something to do with it, that's for sure.
MickGyver is offline  
Old 28 November 2019, 12:17   #68
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,484
Quote:
Originally Posted by Daedalus View Post
The first change about not clearing the first word: Is that fixing an issue I think I had with the older version where certain sound effects were getting stuck playing a high pitched note? I hadn't gotten around to clearing the first two bytes of the sample to confirm it...
This was probably a PC-tracker MOD with a zero repeat-length (which doesn't happen in original Amiga MODs). A zero repeat length was just increased to two, as a workaround, before 5.3. As a consequence this required the first word to be zero, which usually is not the case in PC-MODs. As a result it is playing the high pitched noise there, as long as you don't clear the word yourself.

To conclude: Yes, this should hopefully be fixed with 5.3.
phx is offline  
Old 28 November 2019, 12:21   #69
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 4,346
That's great, thanks for the detailed explanation And, of course, your work on the original library!
Daedalus is offline  
Old 28 November 2019, 16:39   #70
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,928
Quote:
Originally Posted by MickGyver View Post
I used a diff tool in an attempt to build a 5.3 version of this library. Got nowhere though. I'm not familiar with assemblers, I tried Asm-One, but get an error at the first astatement, next line "args word,byte" throws an error: "Illegal operand". What assembler did you use to build this and what extra steps would one need to take?[/S]
I used PhxAss, by Phx himself.
idrougge is offline  
Old 29 November 2019, 11:49   #71
earok
Registered User

 
Join Date: Dec 2013
Location: Auckland
Posts: 2,153
Thanks for the updates! Amazing work all

I still had some issues with high pitch after some samples, but I didn't know about the first word thing before. With this tiny tweak to the included sample function

Code:
Statement SFXInit {*fx.sfx, snd.w, vol.w, cha.b, pri.b}
  *_snd.sound=Addr Sound(snd)  ; Get the pointer to the sound
  Poke.w *_snd\_data,0 ; Set first word of sample data to 0
  *fx\sfxPtr=*_snd\_data       ; Copy the data
  *fx\sfxLen=*_snd\_length     ; ...
  *fx\sfxPer=*_snd\_period
  *fx\sfxVol=vol
  *fx\sfxCha=cha
  *fx\sfxPri=pri
End Statement
Everything came right for me
earok is offline  
Old 29 November 2019, 14:13   #72
MickGyver
Registered User

MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 503
Quote:
Originally Posted by earok View Post
Thanks for the updates! Amazing work all

I still had some issues with high pitch after some samples, but I didn't know about the first word thing before. With this tiny tweak to the included sample function

Code:
Statement SFXInit {*fx.sfx, snd.w, vol.w, cha.b, pri.b}
  *_snd.sound=Addr Sound(snd)  ; Get the pointer to the sound
  Poke.w *_snd\_data,0 ; Set first word of sample data to 0
  *fx\sfxPtr=*_snd\_data       ; Copy the data
  *fx\sfxLen=*_snd\_length     ; ...
  *fx\sfxPer=*_snd\_period
  *fx\sfxVol=vol
  *fx\sfxCha=cha
  *fx\sfxPri=pri
End Statement
Everything came right for me
Cheers! By the way, you should be able to use MTInstall 1=PAL/0=NTSC with this version and you NEED to call MTRemove when you want to remove the CIA player from the system.

Last edited by MickGyver; 30 November 2019 at 08:46.
MickGyver is offline  
Old 30 November 2019, 04:03   #73
earok
Registered User

 
Join Date: Dec 2013
Location: Auckland
Posts: 2,153
Quote:
Originally Posted by MickGyver View Post
Cheers! By the way, you should be able to use MTInstall 1=PAL/2=NTSC with this version and you NEED to call MTRemove when you want to remove the CIA player from the system.
Thanks for the heads up!
earok is offline  
Old 30 November 2019, 08:49   #74
MickGyver
Registered User

MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 503
Quote:
Originally Posted by earok View Post
Thanks for the heads up!
For MTInstall, it is 1 for PAL and 0 for NTSC, I corrected my post above.
MickGyver 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
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 18:41.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.08450 seconds with 14 queries