English Amiga Board


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

 
 
Thread Tools
Old 04 September 2019, 23:08   #41
Shatterhand
Warhasneverbeensomuchfun

Shatterhand's Avatar
 
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 36
Posts: 3,430
If I use this library on my Blitz Basic game, I should credit both Idrougge and Phx ?
Shatterhand is offline  
Old 05 September 2019, 17:41   #42
Zener
Registered User
Zener's Avatar
 
Join Date: Jan 2009
Location: Barcelona / Spain
Posts: 253
I have pending to try this lib, I could use for future games and Redpill. Lib authors will be credited.
Zener is offline  
Old 05 September 2019, 18:49   #43
Cobe
Registered User

 
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 36
Posts: 681
Does anyone else have lag on sound effects?

I haven't been experimenting with it. Its just my first experience. It could easily be my code not the lib. I just ask to know what to expect.

edit: I've been experimenting and I always have a constant lag(approximately little less than half a second) no matter if its within the existing game or clean code with nothing else going on, no matter if I add mtinstall(which doesn't crash at my side), channel mask and/or play sfx loaded like sounds or like banks.

Last edited by Cobe; 06 September 2019 at 23:57.
Cobe is offline  
Old 14 September 2019, 12:20   #44
Zener
Registered User
Zener's Avatar
 
Join Date: Jan 2009
Location: Barcelona / Spain
Posts: 253
I noticed the lag on FX, but it also happens with standard Blitz command.

Is there a way to stop FX? Or if a new sound plays and the last one is still playing it stops and plays the new one?


Quote:
Originally Posted by Cobe View Post
Does anyone else have lag on sound effects?

I haven't been experimenting with it. Its just my first experience. It could easily be my code not the lib. I just ask to know what to expect.

edit: I've been experimenting and I always have a constant lag(approximately little less than half a second) no matter if its within the existing game or clean code with nothing else going on, no matter if I add mtinstall(which doesn't crash at my side), channel mask and/or play sfx loaded like sounds or like banks.
Zener is offline  
Old 14 September 2019, 16:48   #45
MickGyver
Registered User

MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 503
Quote:
Originally Posted by Cobe View Post
Does anyone else have lag on sound effects?

I haven't been experimenting with it. Its just my first experience. It could easily be my code not the lib. I just ask to know what to expect.

edit: I've been experimenting and I always have a constant lag(approximately little less than half a second) no matter if its within the existing game or clean code with nothing else going on, no matter if I add mtinstall(which doesn't crash at my side), channel mask and/or play sfx loaded like sounds or like banks.
Quote:
Originally Posted by Zener View Post
I noticed the lag on FX, but it also happens with standard Blitz command.

Is there a way to stop FX? Or if a new sound plays and the last one is still playing it stops and plays the new one?
Is this on WinUAE or real Amigaz?
MickGyver is offline  
Old 14 September 2019, 17:32   #46
Cobe
Registered User

 
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 36
Posts: 681
i'wouldn't think of that,
i'm currently at some 'hacker space' with retro room and i could swear there's no lag on real amiga
Cobe is offline  
Old 14 September 2019, 20:50   #47
Zener
Registered User
Zener's Avatar
 
Join Date: Jan 2009
Location: Barcelona / Spain
Posts: 253
In my case it was a real Amiga with 060, as said it happened too with the default Blitz funcion Sound
Zener is offline  
Old 15 September 2019, 02:12   #48
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,484
Sorry, mised that.

Quote:
Originally Posted by Cobe View Post
Does anyone else have lag on sound effects?
No. At least not in my games, and also not in other games using ptplayer.

Quote:
edit: I've been experimenting and I always have a constant lag(approximately little less than half a second)
Half a second is a lot.

When you call mt_playfx for a new sound effect, it will take until the next CIA-B music timer interrupt before replay starts. This delay depends on the tempo of the MOD (default is 50 times per second, or tempo 125, which you can modify with command Fxx, where xx is >= $20).

So either you have loaded/initialized (mt_init) a very slow MOD, or it is a problem with Blitz Basic.

Quote:
Originally Posted by Zener View Post
I noticed the lag on FX, but it also happens with standard Blitz command.
What does that mean? There is a Blitz command for sound effects? And did you try it with the ptplayer-extension running, or stand-alone?

Quote:
Is there a way to stop FX? Or if a new sound plays and the last one is still playing it stops and plays the new one?
When the same channel is selected for the new effect, and the priority of the old effect is lower or same, then it wil be replaced. Default behaviour is to allocate all four channels, if you play four effects at the same time.
phx is offline  
Old 15 September 2019, 04:21   #49
earok
Registered User

 
Join Date: Dec 2013
Location: Auckland
Posts: 2,153
Going out on a limb here, but are you sure the samples in question have no silence at the start?
earok is offline  
Old 15 September 2019, 17:18   #50
Zener
Registered User
Zener's Avatar
 
Join Date: Jan 2009
Location: Barcelona / Spain
Posts: 253
There is a sound FX player in Blitz:

Sound Sound#,Channelmask[, Vol1[, Vol2...]
Sound causes a previously created sound object to be played through the Amiga's
audio hardware. Channelmask specifies which of the Amiga's four audio channels the
sound should be played through, and should be in the range one through fifhteen.

To be clear, the lag is in the game itself, not in the sound, the sound plays fine but it is the game that has a minor slowdown when playing it. It may be something from Blitz itself, or something I do that is messing up with the CIAs, because it happens to me with all libs


Quote:
Originally Posted by phx View Post
Sorry, mised that.


No. At least not in my games, and also not in other games using ptplayer.

Half a second is a lot.

When you call mt_playfx for a new sound effect, it will take until the next CIA-B music timer interrupt before replay starts. This delay depends on the tempo of the MOD (default is 50 times per second, or tempo 125, which you can modify with command Fxx, where xx is >= $20).

So either you have loaded/initialized (mt_init) a very slow MOD, or it is a problem with Blitz Basic.


What does that mean? There is a Blitz command for sound effects? And did you try it with the ptplayer-extension running, or stand-alone?

When the same channel is selected for the new effect, and the priority of the old effect is lower or same, then it wil be replaced. Default behaviour is to allocate all four channels, if you play four effects at the same time.
Zener is offline  
Old 16 September 2019, 13:47   #51
Cobe
Registered User

 
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 36
Posts: 681
@earok
First thing I double checked before posting is that samples accidentally don't have some silence at the beginnings and they didn't.

@all
I heard it right, there was no lag on real Amiga. So I checked my winuae setup better and found that I had sound buffer set to 8. So I put it to min and now there's no lag.
So false alarm. Sorry guys, it was my stupid "mistake".
Cobe is offline  
Old 24 September 2019, 18:40   #52
Cobe
Registered User

 
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 36
Posts: 681
Is there a way to force sfx on desired channel?

e.g.
if nuclear attack from the left side mtsoundfx boom,64,channel 2
if nuclear attack from the right side mtsoundfx boom,64,channel 3
Cobe is offline  
Old 25 September 2019, 03:32   #53
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,928
You could probably use MTMusicMask to set only one channel available for effects.
idrougge is offline  
Old 25 September 2019, 15:48   #54
Cobe
Registered User

 
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 36
Posts: 681
Seems that you can set musicmask just once..
Cobe is offline  
Old 25 September 2019, 15:54   #55
Cobe
Registered User

 
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 36
Posts: 681
edit: solved. You have to call mtinstall every time you change the mask.
edit2: and start the music again. So noo...
Cobe is offline  
Old 19 October 2019, 02:59   #56
Nightshft
Registered User

Nightshft's Avatar
 
Join Date: Mar 2018
Location: Austria
Age: 44
Posts: 233
After initial troubles rebuilding deflibs (see the other thread. But with libman (and avoiding lib number collisions) it works well) I got this running fine.
Thank you phx and idrougge!

I tried 10 mods and 8 work well.

----

May I give some feedback?

mtInstall was NOT needed, but did no harm in my installation (winuae, a1200, amiblitz 2.42)

How to check if a mod could be loaded:
If the modfile is not found you won't get any error or crash, but play will play garbage.
LoadBank doesn't return a value but there's a nice way to check it:

Code:
LoadBank 0,"filename.mod",2
If Bank(0) = 0 then NPrint "cant load mod":VWait 50: End
(As bank returns the adress of the loaded bank.)

Trivia:
If you load a file named "" the above method will still return a value lol.

--

Idea:
"mtPlay off" will leave the last note continue playing.
"mtEnd" pauses the song and ends the note (still possible to continue the song)

How about replacing "mtPlay off" with the function of "mtEnd"? (unless somebody needs it of course)

And replacing "mtEnd" with something that stops and rewinds the song. Like mtEnd:MtInit x,0
Just an idea of course...

Great work, thanks for this lib!
Nightshft is offline  
Old 21 October 2019, 10:47   #57
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 4,346
I've been trying this library out recently too, and by and large it's excellent, thanks! However, I have a slight issue with a sound sample that plays a high pitch tone when the sound is finished, until that channel is used again by the mod or another sound. The sample is only a very short blip, and plays fine using the original Blitz commands.

Any ideas? Is there a minimum length the samples should be, or am I missing something?
Daedalus is offline  
Old 21 October 2019, 13:42   #58
Nightshft
Registered User

Nightshft's Avatar
 
Join Date: Mar 2018
Location: Austria
Age: 44
Posts: 233
I dont have the time right now to search for where it was, but I think I read it's a known issue and the first two bytes of the sample have to be zero because this is what's getting looped. (I could be wrong)

Btw, thanks for all your help Daedalus! Highly appreciate it!

edit: This thread?

Last edited by Nightshft; 21 October 2019 at 14:40.
Nightshft is offline  
Old 21 October 2019, 13:50   #59
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 2,388
I think it was discussed in the original thread or some other with phx PT engine topic.
daxb is offline  
Old 21 October 2019, 16:45   #60
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 4,346
Ah, sounds like a lead, thanks guys!
Daedalus 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 19:19.


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