It is currently Wed Aug 16, 2017 6:57 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Tue Dec 27, 2016 7:18 pm 
Offline

Joined: Sat Oct 22, 2016 3:36 am
Posts: 8
Wondering if someone can help me with SFX.

I'm using FamiTone2 to play SFX in my game. SFX work fine when played in the first channel but when trying to play it in any other channel, I get a 'ting' sound (attached).

Here's the code I'm using to play the Hit SFX in the second channel:
Code:
    LDA #SFX_HIT_1
    LDX #$01
    JSR FamiToneSfxPlay

And settings for FamiTone2:
Code:
 FT_BASE_ADR      = $0300   ;page in the RAM used for FT2 variables, should be $xx00
 FT_TEMP         = $00   ;3 bytes in zeropage used by the library as a scratchpad
 FT_DPCM_OFF      = $C000   ;$c000..$ffc0, 64-byte steps
 FT_SFX_STREAMS   = 4      ;number of sound effects played at once, 1..4

 FT_DPCM_ENABLE         ;undefine to exclude all DMC code
 FT_SFX_ENABLE         ;undefine to exclude all sound effects code
 FT_THREAD            ;undefine if you are calling sound effects from the same thread as the sound update call

 FT_PAL_SUPPORT         ;undefine to exclude PAL support
 FT_NTSC_SUPPORT         ;undefine to exclude NTSC support

Any help is appreciated. Thanks!


Attachments:
famitone2 ting.mp3 [20.41 KiB]
Downloaded 15 times
Top
 Profile  
 
PostPosted: Wed Dec 28, 2016 2:01 am 
Offline
User avatar

Joined: Sat Aug 15, 2015 3:42 pm
Posts: 96
Location: France
To select the sfx channel stream, you need to use FT_SFX_CHx vars like this :

Code:
    LDA #SFX_HIT_1
    LDX #FT_SFX_CH0
    JSR FamiToneSfxPlay

    LDA #SFX_JUMP
    LDX #FT_SFX_CH1
    JSR FamiToneSfxPlay



Top
 Profile  
 
PostPosted: Wed Dec 28, 2016 2:19 am 
Offline

Joined: Sat Oct 22, 2016 3:36 am
Posts: 8
glutock wrote:
To select the sfx channel stream, you need to use FT_SFX_CHx vars like this :

Code:
    LDA #SFX_HIT_1
    LDX #FT_SFX_CH0
    JSR FamiToneSfxPlay

    LDA #SFX_JUMP
    LDX #FT_SFX_CH1
    JSR FamiToneSfxPlay



Thanks, that was it!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group