• Please review our updated Terms and Rules here

Nyan Cat for the IBM PC

It's not using my soundblaster, it comes out of the PC-speaker, with a high pitched wine.

Does it not use soundblaster?
 
For those of you with networking capability ...


It is not responding at the moment but it is a web page that gives you instructions on how to telnet into their Nyan cat server. There are also pictures from a wide variety of computers showing them connected to the server. If you are adventurous you can download the code for Linux to create your own Nyan cat server.

Here are my two DOS machines participating:



-Mike
 
Ahh ok.. On my model 25 it includes a aweful high pitched whine. Must be something specific to the model 25.
You are going to hear that high pitch noise on almost any PC-speaker unless the hardware happens to run the sound through a filter.

The pc-speaker is only 1-bit sound, so it uses a trick modifying bits while playing a high-pitch frequency to produce somewhat realistic audio. There were a number of programs and games that did this on the PC and Apple II. I even recall one for the TRS-80 Model III where a game would audibly exclaim "Game Over Player One!"

That's what we need now. Ports of this to other platforms! :D
 
This is AWESOME! Works fine on my 5150, although the sound is so quiet it's almost inaudible. You should add Sound Blaster support. Don't even need to screw around with DMA. Turn on speakers when the program starts, DSP command 0xD1. Then since you're already using the timer interrupt for outputting each sample, just use the direct 8-bit output SB DSP command 8000 times per second. (output to baseport + 0xC: command 0x10, followed by sample byte to same port) When your program exits, turn off speakers with command 0xD3. Couldn't be easier.
 
Ahh ok.. On my model 25 it includes a aweful high pitched whine. Must be something specific to the model 25.

To have something going on (pageflip animation) while the speaker is playing digitized sound is impressive, so you should be impressed that it is not using the sound blaster :)

As for the whine, that's because the playback method is PWM which reproduces the carrier frequency used for playback, and since the playback rate is lower than the rate of human hearing, you hear the carrier wave.

Hey JoJo -- for version 1.1, try doubling the playback rate and just play each sample twice. That will get rid of the high-pitched whine.
 
This is AWESOME! Works fine on my 5150, although the sound is so quiet it's almost inaudible.

A "loudness" improvement could be made by just toggling the speaker on and off using only the high bit of the sample. It's the same technique as in the ATOM.EXE demo. This is distorted, but it sure is LOUD...

(output to baseport + 0xC: command 0x10, followed by sample byte to same port)

Believe it or not this is double the port writes as outputting to the speaker. It may likely not run fast enough on an XT. Also, the Sound Blaster has a upper limit on samplerate when you do it this way (I think it's 12KHz but don't quote me on that). Any program using a Sound Blaster should use DMA, it's the only sane option (and you get to do stuff while the sound is playing ;-) .
 
To have something going on (pageflip animation) while the speaker is playing digitized sound is impressive, so you should be impressed that it is not using the sound blaster :)

As for the whine, that's because the playback method is PWM which reproduces the carrier frequency used for playback, and since the playback rate is lower than the rate of human hearing, you hear the carrier wave.

Hey JoJo -- for version 1.1, try doubling the playback rate and just play each sample twice. That will get rid of the high-pitched whine.

Tried that, the oversampling, but it still sounded with the high pitch beep...
 
It should have worked (it does in other programs). Remember, you don't wait for the interrupt and then output the sample twice; you double the interrupt rate and output the same sample two interrupts in a row. If you have any spare CPU time (usually not on a XT), you can perform linear interpolation to try to smooth out the quantization noise. Some people mistake quantization noise for "whine"...
 
A "loudness" improvement could be made by just toggling the speaker on and off using only the high bit of the sample. It's the same technique as in the ATOM.EXE demo. This is distorted, but it sure is LOUD...



Believe it or not this is double the port writes as outputting to the speaker. It may likely not run fast enough on an XT. Also, the Sound Blaster has a upper limit on samplerate when you do it this way (I think it's 12KHz but don't quote me on that). Any program using a Sound Blaster should use DMA, it's the only sane option (and you get to do stuff while the sound is playing ;-) .

Yeah, if I were writing a program from scratch to use the SB I would go with DMA, but I thought in this particular case it might be a reasonable option. I was looking at his code, and his audio loop uses HLT before each sample output to wait for the timer interrupt so I would assume there's some idle time in there anyway. In that case, an extra OUT shouldn't hurt anything.
 
Feature request: support for MDA/Monographics. :D

Finally got around to trying it on my XT clone with a monographics card, and discovered this only supports CGA. But the program still ran and I could hear the sound, the screen was just blank.

Also, loading the samples from disk seems like it could be faster.

Awesome program!
 
It ran wonderfully on my Taiwanese XT clone using EGA. Although quiet the sound was crisp with no distortion whatsoever.
 

Attachments

  • IMAG0027.JPG
    IMAG0027.JPG
    74.6 KB · Views: 1
Last edited:
Back
Top