SIMH Simple Sound System

From Computer History Wiki
Jump to: navigation, search

SIMH is a wonderful and versatile program to simultate a great multitude of computers. One feature it lacks (at least in my opinion) is that it does not simulate the computers' sounds.

While I'm not a programmer, I've tried to fill that gap, at least for the time being for the sounds of the VAX-11/750 blower and an RK07 removable disk drive.

The blower sound was taken from my real VAX (which is not yet working), the RK07 seek sound is synthetic yet, but controlled by the SIMH RK07 disk drive, so that it depends on the disks' seek activties.

See and hear: SIMH VAX-11/750 booting and running VMS V3.0 from an RK07 disk drive for an impression.

Sorry, Windows folks, as of now the SIMH Simple Sound System is limited to a Linux environment.

Status quo

The following c source line is inserted where disk seek are performed (two places in pdp11_hk.c, see my SIMH Simple Sound System Kit):

int sound_status = system ("[ -f disk.wav ] && aplay -q disk.wav &");

This it how it works (for non-programmers):

  • If a sound file disk.wav is found in the SIMH directory, it gets played in a detached process.
  • If the sound file disk.wav is not found, the next step is skipped, i.e. nothing happens.

The disk sound is very short (just some kind of "click").

Detached Process

As not everybody needs to know the term "detached process", here is a short explanation:

When "detached process" is started, it is not waited for it to end; instead the next process starts immediately after the start of the detached process. The detached process runs in parallel to the process started next.

I use "detached processes" in my shell scripts to:

  • avoid "sound gaps", and
  • play sounds in parallel

Adding Blower Sound

To add the blower sound including the special start and stopping sequences, I used some simple shell scripts.

The main shell script is run750.sh:

  • It starts the script running_sound.sh as a detached process
    • running_sound.sh starts playing blower_starting.wav once as a detached process.
    • Then running_sound.sh waits for about .72 seconds (= run time of blower_starting.wav) and starts playing blower_running19.wav in an endless loop under the process name Blower.
  • After running_sound.sh has been started, the SIMH VAX simulator (modified for sound) is initiated, boots, and runs until being shut down. Every time the RK07 disk drive does a seek operation, the disk.wav sound will be played.
  • When the SIMH VAX simulator is finally stopped, stop_sound.sh is started.
    • stop_sound.sh starts playing blower_stopping_fadeout.wav once as a detached process.
    • About 0.3 seconds after blower_stopping_fadeout.wav is started, the process Blower (the endless blower sound loop) is stopped.

You can get and use the SIMH Simple Sound System Kit yourself.

My primitive ways to accomplish the SIMH sounds are probably a little embarrassing, but at least it's a start.

Anyone willing and capable of doing it better (and host system independent?) is invited to do so!

Who has got a real RK07 and can provide its real sound? It would be much nicer to hear the geniune sound instead of the synthetic one!

Timing

Some alterations of the SIMH timing values are reasonable for the SIMH Simple Sound System. They are realized via commands in the SIMH ini file.

RK07 Disk Timing

The SIMH Simple Sound System needs a little tweaking of the RK07 disk drive timing inside the VAX-11/750 simulator.

There are three configurable parameters (all values in microseconds):

  • CTIME = Command time, default: 5
  • STIME = Seek time per cylinder, default: 10
  • RTIME = Rotational delay time, default: 10

All these values are way too low for a realistic RK07 timing, fortunately they can be altered in the SIMH ini file.

My interim recommandations are:

DEPOSIT HK CTIME 5000
DEPOSIT HK STIME 80
DEPOSIT HK RTIME 12500 

VAX-11/750 Timing

For a really realistic behaviour of the VAX-11/750, its simulator must be throttled down to about 700 kiloinstructions per second.

You can achieve this by using the SIMH command SET THROTTLE 700K. SIMH will automatically calibrate itself to the set value soon after it is started. When you know the throttling rate needed (SIMH tells you when you enter SHOW THROTTLE at the SIMH prompt), you can set it right from the beginning using the command SET THROTTLE 750/1. The throttling rate 750/1 (pause every 750 instructions for 1 ms) in the foregoing example is the value on my computer, yours may differ depending on your computers power.

Triple Tone

Now there is version 2 of the SIMH Simple Sound System Kit that differentiates between three kinds of seeks, because seeks of different length (spanning more or less disk cylinders) usually give (slightly) varying sounds.

The RK07 has got 815 cylinders, and I will distribute the three seek levels not linear, because short seeks are mostly made of disk head acceleration and deceleration, whereas the longer ones have longer phases of approximately constant veloctity.

  • Short seeks (< 10 cylinders)
  • Medium seeks (< 100 cylinders)
  • Long seeks (> 100 cylinders)

Have you got any further ideas for optimizations? Let me know!