Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

TIC-80

Fantasy computer for making, playing and sharing tiny games. · By Nesbox

SFX bug

A topic by HomineLudens created Jan 01, 2017 Views: 774 Replies: 12
Viewing posts 1 to 5

If I'm not doing something wrong:

- make a new sfx with ID=1 and use "Noise" as wave form.

- Recal the sfx with

function TIC()

cls(0)

print("Sfx test")

if btn(0) then

sfx(1,20,0,15)

else

sfx(-1,0,0)

end

end


It sound using the square waveform

Developer (1 edit)
sfx [id [note [channel [volume [speed] ] ] ] ]

third parameter is channel index, TIC has 4 channels: 0-square 1-square 2-triangle 3-noise by default (you can change channel type in 0.0.13)

So, just call sfx(1,20,3) to generate noise wave

I got it wrong, I thought channels was maximum number of simultaneous sound. That's a lot better thanks.

FIY in case you call channel number 4 TIC crash badly. Something like :

sfx(1,40,4)

Developer

Will fix the crash, thanks

(1 edit)

I test that code :

function TIC()
 if btn(0) then
  sfx(0,34,2,5)
 elseif btn(1) then
  sfx(0,34,2,15)
 else
  sfx(-1,0,0)
 end
end

But the sound don't stop and there aren't difference with volume parameter.

Why ? (I use 0.15.0 dev version/same problem on 0.16.0)


Others problems detect on 0.16.0:

shortcuts Alt+1..5 don't work (but F1...5 work fine ;) )

Developer

You are playing sfx on channel 2 and stoping it on 0

try to call instead

sfx(-1,0,2)

Thanks, but the volume still not working argument. (even if I don't care for my current project ;) )

Developer

yes, channel #2 has triangle waveform by default and the wave has no volume control. It plays sound only if volume > 0 and silence otherwise, all other waves have volume control.

Developer

shortcuts Alt+1..5 work only with left ALT because right ALT reserved for AZERTY keyboards

Yes, left ALT+1...5 don't work on 0.16.0, they worked on 0.15.0.

Developer

Hmm, works on my side. Ok maybe a bug, what keyboard type (QWERTY/AZERTY) and system do you use?

AZERTY, Linux Ubuntu 64bit, TIC 0.16.0 64bit

Developer

I added AZERTY support in 0.16.0 and I think it's the reason why ALT+1..5 doesn't work for you.