English Amiga Board


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

 
 
Thread Tools
Old 09 June 2021, 19:16   #121
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by ross View Post
Different possibilities:
- copper, but you need to be the first routine in VBI or you call for problem
True. Especially when the whole game engine runs in VBI.

Quote:
- a CIA IRQ , which, however, would not be invasive because it is linked to the VBI
Which means I would set up TimerB interrupts for writing DMACON/AUDxLC exactly like I do now, but from a level-3 instead of a level-6 interrupt?
Can be done, but if I really do the VBI option I would not want to use a second interrupt vector.

Quote:
- next VBI, but you would have the same problems as p61
Yes. Should be avoided.

(Currently this discussion has not much to do with Blitz Basic. Sorry for that.)
phx is offline  
Old 09 June 2021, 19:28   #122
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by phx View Post
Which means I would set up TimerB interrupts for writing DMACON/AUDxLC exactly like I do now, but from a level-3 instead of a level-6 interrupt?
Can be done, but if I really do the VBI option I would not want to use a second interrupt vector.
Yes, a set up for a timed IRQ6 inside the IRQ3.
The alternative is a delay by "raster lines count"..

(promised, last derail for the thread sorry)
ross is offline  
Old 10 June 2021, 02:41   #123
neumanix
Registered User
 
Join Date: Jan 2017
Location: Jakobstad/Finland
Posts: 13
Thanks for the help guys. As the noob I am, I didn't realize the wait for line $96, caused it Commented that out and it runs just fine with music.
neumanix is offline  
Old 16 August 2021, 06:45   #124
saimon69
J.M.D - Bedroom Musician
 
Join Date: Apr 2014
Location: los angeles,ca
Posts: 3,516
Do you know if the routine has problems with F00? Am using it in a couple interactions and Colin say it gurus the game
saimon69 is offline  
Old 05 September 2021, 09:33   #125
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,160
@phx I found some parasite remaining playing sound when playing some samples (after the sample has been played)

Only a move.w #$F,dmacon stops it.

Doesn't happen with all samples. Only some of them. What could be the reason? Wrong length?
jotd is offline  
Old 05 September 2021, 13:19   #126
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by jotd View Post
@phx I found some parasite remaining playing sound when playing some samples (after the sample has been played)
?
I would guess that the first two bytes of that sample are not zero. They are used for idling, when a one-shot sample has played. See also the last two questions of the ptplayer FAQ.

An alternative is to build ptplayer with the symbol NULL_IS_CLEARED=1. Then the player uses two bytes at $0 instead, which is your responsibility to keep them cleared.
phx is offline  
Old 05 September 2021, 20:51   #127
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,160
damn. I'm pretty sure you already mentionned that. Thanks!
jotd is offline  
Old 02 December 2021, 20:56   #128
Zener
Registered User
 
Zener's Avatar
 
Join Date: Jan 2009
Location: Barcelona / Spain
Posts: 432
Hi, not sure if it has been explained already, but how do I play a sound in loop? Like the LoopSound command in Blitz but with this lib
Zener is offline  
Old 12 December 2021, 19:28   #129
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,160
You can use:

Code:
    lea _custom,a6
    bra _mt_loopfx
(with A0 sample structure loaded)

Beware: this new loop feature is cool (uses CIA super accurate timers for looping, which prevents from sound glitches like if using VBL) but it has bugs.

- not stopping the loop before doing _mt_stopfx with the proper channel exposes to music not playing fully
- same thing if you don't stop a loop (with _mt_stopfx) before starting another one on the same channel.

On the new pacman version I was working on, the intermission music was always missing the bass. That's because of the in-game sound loops.

calling loop stop before _mt_end and before _mt_loopfx workarounds the issue. But that's still a bug.
jotd is offline  
Old 14 December 2021, 17:23   #130
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Not sure if that helps Zener, because he was asking for Blitz Basic. Otherwise I would have replied earlier.

Quote:
Originally Posted by jotd View Post
- not stopping the loop before doing _mt_stopfx with the proper channel exposes to music not playing fully
I don't understand. _mt_stopfx stops the looped sfx, so which loop do you want to stop before?

Quote:
- same thing if you don't stop a loop (with _mt_stopfx) before starting another one on the same channel.
As far as I remember you should be able to start a new looped sfx on the same channel immediately with _mt_loopfx, without having to stop the previous one with _mt_stopfx first - unless it is playing on a different channel. But maybe I'm wrong. I didn't verify that now.

Quote:
On the new pacman version I was working on, the intermission music was always missing the bass. That's because of the in-game sound loops.

calling loop stop before _mt_end and before _mt_loopfx workarounds the issue. But that's still a bug.
Yes, indeed, there may be a bug, because _mt_end neither resets the channel's looped-flag nor the sfx-priority in it.

I tried to fix that here: http://sun.hasenbraten.de/~frank/TEST/ptplayer.asm
When there are still problems, please elaborate.

Hmm... when I think about it: maybe there are situations where you want to continue your looped sfx while exchanging the music mod currently being replayed?
phx is offline  
Old 14 December 2021, 19:18   #131
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,160
Quote:
not stopping the loop before doing _mt_stopfx with the proper channel exposes to music not playing fully
I meant "mt_end" sorry.

Quote:
Hmm... when I think about it: maybe there are situations where you want to continue your looped sfx while exchanging the music mod currently being replayed?
well, I don't mind calling stop_fx before mt_end. It's just that not doing it causes a hard-to-understand bug.
Or there should be a mt_music_stop

thanks for the fix I'm going to try it.
jotd is offline  
Old 04 January 2022, 19:42   #132
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,893
Sorry to resurrect an old thread but I am trying to use this player in my target Renegade game but when I play music I just get weird clicks. It is not trying to play the mod as if I don't load it, I get the same sounds. I copied the ptplayer.obj from the thread and rebuilt the Blitzlib using Blitzman but to no avail. Also, Blitzman only allows libs from 1-127 but this one is 195???

Any help would be useful as BB2's tracker playback is poor and doesn't play nicely with sound effects. Plus it has been noted that the mod is playing back incorrectly...

Have tried a different mod with the same outcomes.
Havie is offline  
Old 07 January 2022, 23:55   #133
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,893
Got it working at last! Two problems:

1)My mod was dodgy for some reason!
2)Using the Loadbank commmand doesn't work

Seeing others use the IncBin command has sorted it!

Hooray!
Havie is offline  
Old 08 January 2022, 00:17   #134
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Quote:
Originally Posted by Havie View Post
Got it working at last! Two problems:

1)My mod was dodgy for some reason!
2)Using the Loadbank commmand doesn't work

Seeing others use the IncBin command has sorted it!

Hooray!
I didn't have any problems using LoadBank with the library myself, but..

Were you using LoadBank BankId,Path$,2 to load into chipram?
earok is offline  
Old 08 January 2022, 08:57   #135
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,893
Quote:
Originally Posted by earok View Post
I didn't have any problems using LoadBank with the library myself, but..

Were you using LoadBank BankId,Path$,2 to load into chipram?
Yep - that's what I had and even tried different bank numbers but just ended up with clicks and white noise. At first I thought it might be related to WinUAE but when I copied my game to my 1200, got the same result. After a number of frustrating hours, I realised was that the mod didn't seem to be loading as I got the same noise if I didn't load anything first. This would imply I had the path wrong but I didn't.

The IncBin method is more complicated and adds code but at least it works. For multiple mods, I am currently stopping the previous mod and then loading the new one and copying into chipram. Cleverer people than me could probably copy more than one at once but as each level of Target Renegade has only one tune, it's not a problem and this helps reduce chipram usuage!
Havie is offline  
Old 08 January 2022, 09:02   #136
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,893
Time for a public shaming - went back to my original code and guess what...

I had the path wrong -doh!!!! How much wasted time did I have on this. What a complete idiot.

It's only when I just wrote, that I didn't have the path wrong that I thought to check -arghhhhhh!!!!!!

Havie is offline  
Old 08 January 2022, 16:39   #137
E-Penguin
Banana
 
E-Penguin's Avatar
 
Join Date: Jul 2016
Location: Darmstadt
Posts: 1,213
I was just about to say that I'd tested the updated library I posted and it worked...

Glad you sorted it out!
E-Penguin is offline  
Old 08 January 2022, 17:56   #138
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,893
Thanks - typical silly bug! At least I can get on with the game as the music problem was annoying me.
Havie is offline  
Old 25 June 2023, 12:25   #139
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
I just wanted to check if there was a version of the library built for Blitz that uses at least version 6.1 of PTPlayer and has NULL_IS_CLEARED set to true.

If not - I'll see if I can build it, but I wanted to check if it had already been done.
earok is offline  
Old 25 June 2023, 22:55   #140
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
I've done a build with e-penguin's repo using NULL_IS_CLEARED, seems to work great.

I just wanted to check - should I have it storing the old content of $0.w (and restoring it on quit) just incase, for example, someone has something in workbench before the game is loaded that has changed that value to something other than 0?
earok 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 20:23
Sound issue, not all sound effects played. Connorsdad support.WinUAE 16 23 February 2015 16:32
Sound Effects in IK+ noel411 support.Games 3 07 September 2007 03:12
IK+ sound effects not working andreas support.WinUAE 4 26 July 2005 20:21
How to rip sound / effects wlcina support.Games 16 18 April 2005 03: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 08:46.

Top

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