Page 12 of 20
Posted: Sun Feb 25, 2007 2:28 pm
by TmEE co.(TM)
I almost finished my 2ch driver and the result was like 6KHz or so
Then I made it into 1ch driver and started to optimize it. Now the single channel stuff runs at blazing 37KHz

. There are some thing left to do (commands, sample end detection), but I'll upload it on Monday. I won't give out the source yet (little messed up, even I don't understand it).
Posted: Sun Feb 25, 2007 6:36 pm
by Stef
TmEE co.(TM) wrote:Stef wrote:Using signed 8 bits sample permit to keep the quality of 8 bits sample and have only an extra "add $80" instruction.
Which is faster, shift or add ?
A simple add or shift take 4 cycles (if working on register only).
If you need shift x 2 then you're on 8 cycles. I'm doing a ADD $80 which take 7/8 cycle also. In fact the 7 bits unsigned sample seems as the best solution

Posted: Sun Feb 25, 2007 6:40 pm
by Stef
TmEE co.(TM) wrote:I almost finished my 2ch driver and the result was like 6KHz or so
Then I made it into 1ch driver and started to optimize it. Now the single channel stuff runs at blazing 37KHz

. There are some thing left to do (commands, sample end detection), but I'll upload it on Monday. I won't give out the source yet (little messed up, even I don't understand it).
6 Khz isn't that bad to start with. I started mine with a bit more then i optimised up to 14 Khz

Congrats anyway for making it, that's not easy to deal with

37 Khz is very fast, actually too much for the DAC !
Posted: Mon Feb 26, 2007 6:39 am
by TmEE co.(TM)
Anyway I've uploaded it
Posted: Mon Feb 26, 2007 7:36 am
by Stef
TmEE co.(TM) wrote:Anyway I've uploaded it
Very nice tune =) Sound like sort of amiga Turrican.
Posted: Mon Feb 26, 2007 8:31 am
by TmEE co.(TM)
Stef wrote:Very nice tune =) Sound like sort of amiga Turrican.
Actually its a tune from Mega Turrican

I chose it, because it does 2ch mixing aswell @ 15KHz like yours

Posted: Mon Feb 26, 2007 10:52 am
by Stef
TmEE co.(TM) wrote:Stef wrote:Very nice tune =) Sound like sort of amiga Turrican.
Actually its a tune from Mega Turrican

I chose it, because it does 2ch mixing aswell @ 15KHz like yours

Mega Turrican ? the genesis version one ? well strange i didn't recognized it... I almost know all MT tune

Also i didn't know it was doing 15 Khz 2 ch mixing :p
I'll try to improve mine to reach the famous 16 Khz, it would be nice =)
Posted: Mon Feb 26, 2007 3:38 pm
by Pascal
well it's nice to have more khz

but more khz mean more rom space :s my game is 200ko for 2.2 mo of audio samples :s
Posted: Mon Feb 26, 2007 4:45 pm
by TmEE co.(TM)
Pascal wrote:well it's nice to have more khz

but more khz mean more rom space :s my game is 200ko for 2.2 mo of audio samples :s
I NEED more KHz, because cymbals(vital part of metal) don't sound very good if not playedback at high sample rate.
You may also want to experiment with FM synth to get SFX if you're not doing so already. YM2612 can do really cool sounds

.
Anyway, I managed to improve my soon to be 2ch player, and now it plays @ 41 KHz

!!!
Stef, I noticed lots of JRs in your code, JR slower than JP (I'm not sure if in all cases) on Z80. AS maybe optimizing those to JPs but I'm not sure. I lost 1KHz

if I changed just one JR to JP !!!
You change bank for every sample, that just kills sampling rate in my driver implementation

41KHz turns to 18... how fast does your driver go if you play only one channel (2nd disabled) and change bank only if required ???
Posted: Mon Feb 26, 2007 6:43 pm
by Stef
Pascal wrote:well it's nice to have more khz

but more khz mean more rom space :s my game is 200ko for 2.2 mo of audio samples :s
Actually i want to add a variable sample rate feature (as the one channel player) but first i want to optimise the 2ch player a bit, having a maximum of 16 Khz would be pretty nice
Anyway, I managed to improve my soon to be 2ch player, and now it plays @ 41 KHz

!!!
Stef, I noticed lots of JRs in your code, JR slower than JP (I'm not sure if in all cases) on Z80. AS maybe optimizing those to JPs but I'm not sure. I lost 1KHz

if I changed just one JR to JP !!!
JR are faster when the branchement isn't taken, it's why i reorganised my code to avoid branchement when possible. When i can't avoid them, i'm using JP
You change bank for every sample, that just kills sampling rate in my driver implementation

41KHz turns to 18... how fast does your driver go if you play only one channel (2nd disabled) and change bank only if required ???
I did 2 different driver :
My 2ch player plays at a stable 14 Khz whatever you're doing. It set bank each time for each sample even when they aren't playing...
My single channel player can play up to 56 Khz in fastest mode but with variable bit rate feature, it can play up to 40 Khz, which is anyway more than enough

Posted: Mon Feb 26, 2007 6:49 pm
by Fonzie
or maybe you can do one channel at 8 khz and one at 16

Even better and faster

Posted: Mon Feb 26, 2007 7:04 pm
by Stef
Fonzie wrote:or maybe you can do one channel at 8 khz and one at 16

Even better and faster

It's an idea but i guess it wouldn't be easy to use it

Posted: Mon Feb 26, 2007 7:10 pm
by Fonzie
Well, i don't know... It seems viable to me.. using one channel for sfx and the other for bgm ^^

Posted: Mon Feb 26, 2007 7:22 pm
by Stef
Fonzie wrote:Well, i don't know... It seems viable to me.. using one channel for sfx and the other for bgm ^^

Well, you're right, it can be quite usefull in this view. Implement it not will be that easy tough

Posted: Tue Feb 27, 2007 9:37 am
by TmEE co.(TM)
8 and 16KHz, sounds interesting, but changing banks is still a real sample rate killer...
My idea: play 1 sample alone, no mixing, play 2nd sample and mix it with one from another channel. Then you can have 2 channels, which one plays at half speed.