4 channels of 8-bit sound + 2 original sounds on standard C64. Why not MSX?

Pagina 1/3
| 2 | 3

Door Totta

Expert (88)

afbeelding van Totta

30-05-2010, 10:05

In 2008 a couple of coders managed to squeeze out 4 separate channels of 8-bit sound from an unexpanded C64.
And this together with the possibility to play two analogue channels too. PLUS individual filtering of all channels, including the digital ones.

Since this is only mathematics and the MSX-1 has a faster processor than the C64. Wouldn't it be possible to recreate the same routine on a standard MSX-1 with the same results?

Read and listen here:
http://www.youtube.com/watch?v=Y6mXLxUZvzg
or
http://www.youtube.com/watch?v=ZMioAPZcays&feature=related
(starts at 0:50)

Aangemeld of registreer om reacties te plaatsen

Van Leo

Paragon (1236)

afbeelding van Leo

30-05-2010, 11:07

what do you call analog channel ?
Mathematics involves precalculations on pc( viterbi ? ) or also sound rendering on 8 bit machine ?
what is sample rate ?
on msx/psg you can play wav's so you can mix on pc ? or youmean this is a tracker ?
maybe spectrum scene is more advanced in z80+psg sound rendering than msx , maybe you can check on spectrum side better ?
otherwise someone already commented that msx had so many sound cards that psg coding never evolved on msx as good as spectrum or others ...

Van Totta

Expert (88)

afbeelding van Totta

30-05-2010, 11:24

Leo: On a standard C64 (~1mhz, 64kb ram), they are since 2008 capable of playing 4 simultaneus channels of 8 bit samples at the same time as they can play two of the soundchip's original analogue sound channels, leaving the computer playing 6 sounds at the same time (4 digital and 2 analogue).

This is without any pre calculations besides converting samples to 8-bit beforehand.

The normal SID-chip in the C64 has 3 analogue channels and one noice generator. Much like the sound chip in the MSX.

The mixing engine can loop the samples, put low pass, high pass and band pass on all six channels and all this in real time without any other hardware than a normal unexpanded C64.

Since the MSX-1 runs at a higher processor speed, it should be possible to convert the routine to work with the MSX too.

Van wolf_

Ambassador_ (10135)

afbeelding van wolf_

30-05-2010, 11:45

..it's just that I think that in context of a game or demo, coders (and even artists) would rather spend their precious CPU cycles on AI and/or visual effects. Because of two main reasons:
- Konami proved that conventional 3-channel PSG could sound amusing
- MSX has external sound extensions, and most people have 'em.. up to 42 channels if you can!

Van Leo

Paragon (1236)

afbeelding van Leo

30-05-2010, 11:53

are the filters needed for anti aliasing or just a equalizer feature ?
filters in audio can be done with infinite impulse response (IIR) order 2 that means =
sample out(n) = coef1*sample in(n-1) + coef2 * sample (n-2) - coef3 * sample out (n-1)
so if you carefully choose coefs ( like -1 or +1 is ideal .. ) you need 2 or 3 adds per sample.
then all depends on your sample rate you want for the filter , @4khz it is not the same as 11kHz, ...
what is sample rate on c64 ?

Van bore

Master (182)

afbeelding van bore

30-05-2010, 12:16

You can't just look at the clock frequency when you try to judge wether one cpu is faster than the other.
On a MSX each instruction will take in the range 5 to 8 clock cycles giving you a calculation speed in the range 400k - 700k instructions/second
The 6510 uses about 2 to 4 cycles for equivalent instructions which will result in somewhere around 250k - 500k instructions/second
The 6510 also has the zero-page addressing, 2-cycle relative conditional jump and a few interesting indexed addressing modes that gives a 1MHz 6510 the edge over a 3.5MHz z80.

Have a look at the datasheet here:
http://archive.6502.org/datasheets/mos_6510_mpu.pdf

Van Hrothgar

Champion (479)

afbeelding van Hrothgar

30-05-2010, 13:44

Wasn't there a (Dutch) MSX game playing 6 PSG channels at the same time through some trick? The sounds were a bit less clear, but on a C64 that isn't much of an issue obviously.

Van PingPong

Enlighted (4156)

afbeelding van PingPong

30-05-2010, 13:46


The 6510 also has the zero-page addressing, 2-cycle relative conditional jump and a few interesting indexed addressing modes that gives a 1MHz 6510 the edge over a 3.5MHz z80.

I do not agree. What you call "edge" is a *required* feature to compensate for the register-less architecture of the 6502.
Without those modes, even a simple linear search on memory for a byte will be a pain to code.
the 6502 pratically is missing of a number of register useful for any operation. Thus it *need* to emulate those by using page 0 and more complex address modes.

Pratice has shown that registers are the way to go if performances are required. Modern processors have a lot of general purpose registers.
take an example, if one need to increment a 16bit ptr and do some addressing with this ptr, on z80 there is a way to use HL,BC,DE in a loop. The 6502 must emulate those 16 bit registers with two bytes on page0. Of course the 6502 can take those bytes and Address some location, a thing that a z80 cannot do directly. But:

- even on page 0, this kind of addressing is slow, compared to implied register addressing. Please note that pre-indexing and post indexing modes of 6502 are the slowest instructions on 6502.
- incrementing a 16 bit ptr, because it's not on a register require two memory accesses, 8 bit at time

the z80 (and any other processor register based) can do this more and more faster.

Real pratice have shown that computationally heavy operations perform on a z80 @3.5Mhz much faster than on a 6502 @1Mhz between 20 to 40% more faster.

About clock speed, you are right. Comparing clock speed between processors does not mean nothing in terms of performances. It's more meaningful comparing the performances of processors when used in specific hw configurations, like the C64 and MSX. For example , if while it's true that a z80 @4Mhz is twice faster than the same @2Mhz, if the faster clocked processor take a lot of wait states when working with memory, maybe the 2Mhz without wait states can outperform the 4Mhz version!

Of course, a 6502 @4Mhz can outperform the z80 at the same speed a lot of times, but consider that if one can cope (memory wise) with a 6502 at 4Mhz, the same could be done with a z80 @16Mhz!

Van Latok

msx guru (3960)

afbeelding van Latok

30-05-2010, 14:17

I do know the MSX turboR is capable of playing 4 channel AMIGA MOD-files. Both Michel Shuqair and Alex Wulms made programs which did just that. I also remember talking to one of them and he said really only turboR can do it because of the R800 multiply instructions.

Van Totta

Expert (88)

afbeelding van Totta

30-05-2010, 15:06

One C64 demo showed just that. They played an Amiga MOD with the routine mentioned above. They had just converted the samples to 8bit (and probably shortened them). I think it's the second link in my original post.

And yes, I know about all the sound cards available to MSX but the real fun of programming is to do something spectacular on inferior equipment. Anyone can play a digitized sound on hardware designed to do it but we all knew the feeling we felt the first time we played an Aackosoft game and we heard speech on a vanilla MSX1, right?

Van wolf_

Ambassador_ (10135)

afbeelding van wolf_

30-05-2010, 16:28

Possibly so. It depends a bit on the purpose. Coders may see a purpose of trying to stretch the boundaries, even if it doesn't gain anything practical. Gamers would rather see more games using approved concepts.

Pagina 1/3
| 2 | 3