Replies: 5 comments 5 replies
-
I think it's a good idea, I implemented PCM support on this branch https://github.com/nesbox/TIC-80/tree/pcm, the binaries will be soon here https://github.com/nesbox/TIC-80/actions/runs/8402082845 Could someone test it and give us feedback? |
Beta Was this translation helpful? Give feedback.
-
A very simple example on JS to generate a sin wave using PCM // script:js
let t=0
function TIC()
{
cls(13)
for(let i=0;i<128;i++)
poke(0x14E24+i,(Math.sin(t*128+i)+1)*128)
t++
} |
Beta Was this translation helpful? Give feedback.
-
So what sample rate are we talking about here? 128 samples per frame * 60 frames per second would indicate 7680Hz? EDIT: nevermind, just read the original post. nice! |
Beta Was this translation helpful? Give feedback.
-
In case anyone wondering how it sounds: |
Beta Was this translation helpful? Give feedback.
-
This has just invalidated all my work on creating an aPCM that tries to produce the most perfect sound possible using sound registers ,_, |
Beta Was this translation helpful? Give feedback.
-
Currently the only way to play PCM data on TIC-80 it's through the
Sound Registers
, but the sound suffers a lot from this, since it is only able to play up to 1920hz and there is only 4 bits of depth, and on top of that there is also the fact that some flat lines are threated as noise, which makes it even worse to deal with. There was a mention about being able to poke to the sound registers duringSCN
to help with that but this was never really addressed.So, I was thinking about how else it could be done, and the idea was to have only a small buffer in
RAM
(no pitch control or whatever) that would be fetched every frame and played back, e.g. having 128 bytes of samples would result in a sound quality of 7680hz, which is way better than what is currently possible, but still sounds retro enough, and can be used for any audio related stuff, like custom synths, ability to play voice clips for sfx, generative audio stuff, etc.Beta Was this translation helpful? Give feedback.
All reactions