Then I made it into 1ch driver and started to optimize it. Now the single channel stuff runs at blazing 37KHz
how can i do music on megadrive?
Moderator: BigEvilCorporation
-
TmEE co.(TM)
- Very interested
- Posts: 2452
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
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).
Then I made it into 1ch driver and started to optimize it. Now the single channel stuff runs at blazing 37KHz
Mida sa loed ? Nagunii aru ei saa 
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
-
Stef
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
A simple add or shift take 4 cycles (if working on register only).TmEE co.(TM) wrote:Which is faster, shift or add ?Stef wrote:Using signed 8 bits sample permit to keep the quality of 8 bits sample and have only an extra "add $80" instruction.
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
-
Stef
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
6 Khz isn't that bad to start with. I started mine with a bit more then i optimised up to 14 KhzTmEE 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).
37 Khz is very fast, actually too much for the DAC !
-
TmEE co.(TM)
- Very interested
- Posts: 2452
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
Anyway I've uploaded it
Mida sa loed ? Nagunii aru ei saa 
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
-
TmEE co.(TM)
- Very interested
- Posts: 2452
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
Stef wrote:Very nice tune =) Sound like sort of amiga Turrican.
Actually its a tune from Mega Turrican
Mida sa loed ? Nagunii aru ei saa 
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
-
Stef
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Mega Turrican ? the genesis version one ? well strange i didn't recognized it... I almost know all MT tuneTmEE co.(TM) wrote:Stef wrote:Very nice tune =) Sound like sort of amiga Turrican.
Actually its a tune from Mega TurricanI chose it, because it does 2ch mixing aswell @ 15KHz like yours
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 =)
-
TmEE co.(TM)
- Very interested
- Posts: 2452
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
I NEED more KHz, because cymbals(vital part of metal) don't sound very good if not playedback at high sample rate.Pascal wrote:well it's nice to have more khzbut more khz mean more rom space :s my game is 200ko for 2.2 mo of audio samples :s
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
You change bank for every sample, that just kills sampling rate in my driver implementation
Mida sa loed ? Nagunii aru ei saa 
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
-
Stef
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
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 nicePascal wrote:well it's nice to have more khzbut more khz mean more rom space :s my game is 200ko for 2.2 mo of audio samples :s
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 JPAnyway, 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 1KHzif I changed just one JR to JP !!!
I did 2 different driver :You change bank for every sample, that just kills sampling rate in my driver implementation41KHz turns to 18... how fast does your driver go if you play only one channel (2nd disabled) and change bank only if required ???
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
Last edited by Stef on Mon Feb 26, 2007 7:05 pm, edited 2 times in total.
-
TmEE co.(TM)
- Very interested
- Posts: 2452
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
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.
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.
Mida sa loed ? Nagunii aru ei saa 
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen