Home » Recent acquisitions » Acorn ADFS disks » adfs_ArchimedesWorld_199201.adf » January92 » !AWJan92/Goodies/ArcAut/Automatons/Sound

!AWJan92/Goodies/ArcAut/Automatons/Sound

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Recent acquisitions » Acorn ADFS disks » adfs_ArchimedesWorld_199201.adf » January92
Filename: !AWJan92/Goodies/ArcAut/Automatons/Sound
Read OK:
File size: 04CC bytes
Load address: 0000
Exec address: 0000
File contents
AUTOMATON*

  Sound_Waves

  This uses the HPP_Gas model to perform an experiment. A uniform gas is set
  up & into this inserted a compressed region (represented by a solid block
  of particles); this corresponds to the air surrounding the source of a loud
  burst of noise. As the automaton runs, we observe the compressive
  longitudinal wave spreading out from the centre; notice how we are
  temporarily left with a vacuum in the centre as the outward bound gas
  overshoots. With difficulty you may also be able to see that the incoming
  ripple which forms, then compresses the central region & bounces back out,
  to create a secondary outward bound wave front of lower intensity than the
  first. If you use a relatively small window (say 128x128) you will also
  observe patterns formed by the original wavefront wrapping around &
  interfering with the other waves.

INITIALISATION*

  10DEF PROCdo
  20*SetEval wrap on
  30*SetEval neig margolus
  40ENDPROC

SCREEN*

  10DEF PROCdo
  20PROCsoup(255,1,.5)
  30c%=FNacol(255):GCOL c%AND63 TINT c%
  40CIRCLE FILL 0,0,80
  50ENDPROC

CODE*

( READ_NEIG
  CELL OPP = IF (CW CCW = IF (CELL CW <> IF (CW ==)))
                                            OPP ==    )

END*
00000000  41 55 54 4f 4d 41 54 4f  4e 2a 0a 0a 20 20 53 6f  |AUTOMATON*..  So|
00000010  75 6e 64 5f 57 61 76 65  73 0a 0a 20 20 54 68 69  |und_Waves..  Thi|
00000020  73 20 75 73 65 73 20 74  68 65 20 48 50 50 5f 47  |s uses the HPP_G|
00000030  61 73 20 6d 6f 64 65 6c  20 74 6f 20 70 65 72 66  |as model to perf|
00000040  6f 72 6d 20 61 6e 20 65  78 70 65 72 69 6d 65 6e  |orm an experimen|
00000050  74 2e 20 41 20 75 6e 69  66 6f 72 6d 20 67 61 73  |t. A uniform gas|
00000060  20 69 73 20 73 65 74 0a  20 20 75 70 20 26 20 69  | is set.  up & i|
00000070  6e 74 6f 20 74 68 69 73  20 69 6e 73 65 72 74 65  |nto this inserte|
00000080  64 20 61 20 63 6f 6d 70  72 65 73 73 65 64 20 72  |d a compressed r|
00000090  65 67 69 6f 6e 20 28 72  65 70 72 65 73 65 6e 74  |egion (represent|
000000a0  65 64 20 62 79 20 61 20  73 6f 6c 69 64 20 62 6c  |ed by a solid bl|
000000b0  6f 63 6b 0a 20 20 6f 66  20 70 61 72 74 69 63 6c  |ock.  of particl|
000000c0  65 73 29 3b 20 74 68 69  73 20 63 6f 72 72 65 73  |es); this corres|
000000d0  70 6f 6e 64 73 20 74 6f  20 74 68 65 20 61 69 72  |ponds to the air|
000000e0  20 73 75 72 72 6f 75 6e  64 69 6e 67 20 74 68 65  | surrounding the|
000000f0  20 73 6f 75 72 63 65 20  6f 66 20 61 20 6c 6f 75  | source of a lou|
00000100  64 0a 20 20 62 75 72 73  74 20 6f 66 20 6e 6f 69  |d.  burst of noi|
00000110  73 65 2e 20 41 73 20 74  68 65 20 61 75 74 6f 6d  |se. As the autom|
00000120  61 74 6f 6e 20 72 75 6e  73 2c 20 77 65 20 6f 62  |aton runs, we ob|
00000130  73 65 72 76 65 20 74 68  65 20 63 6f 6d 70 72 65  |serve the compre|
00000140  73 73 69 76 65 0a 20 20  6c 6f 6e 67 69 74 75 64  |ssive.  longitud|
00000150  69 6e 61 6c 20 77 61 76  65 20 73 70 72 65 61 64  |inal wave spread|
00000160  69 6e 67 20 6f 75 74 20  66 72 6f 6d 20 74 68 65  |ing out from the|
00000170  20 63 65 6e 74 72 65 3b  20 6e 6f 74 69 63 65 20  | centre; notice |
00000180  68 6f 77 20 77 65 20 61  72 65 0a 20 20 74 65 6d  |how we are.  tem|
00000190  70 6f 72 61 72 69 6c 79  20 6c 65 66 74 20 77 69  |porarily left wi|
000001a0  74 68 20 61 20 76 61 63  75 75 6d 20 69 6e 20 74  |th a vacuum in t|
000001b0  68 65 20 63 65 6e 74 72  65 20 61 73 20 74 68 65  |he centre as the|
000001c0  20 6f 75 74 77 61 72 64  20 62 6f 75 6e 64 20 67  | outward bound g|
000001d0  61 73 0a 20 20 6f 76 65  72 73 68 6f 6f 74 73 2e  |as.  overshoots.|
000001e0  20 57 69 74 68 20 64 69  66 66 69 63 75 6c 74 79  | With difficulty|
000001f0  20 79 6f 75 20 6d 61 79  20 61 6c 73 6f 20 62 65  | you may also be|
00000200  20 61 62 6c 65 20 74 6f  20 73 65 65 20 74 68 61  | able to see tha|
00000210  74 20 74 68 65 20 69 6e  63 6f 6d 69 6e 67 0a 20  |t the incoming. |
00000220  20 72 69 70 70 6c 65 20  77 68 69 63 68 20 66 6f  | ripple which fo|
00000230  72 6d 73 2c 20 74 68 65  6e 20 63 6f 6d 70 72 65  |rms, then compre|
00000240  73 73 65 73 20 74 68 65  20 63 65 6e 74 72 61 6c  |sses the central|
00000250  20 72 65 67 69 6f 6e 20  26 20 62 6f 75 6e 63 65  | region & bounce|
00000260  73 20 62 61 63 6b 20 6f  75 74 2c 0a 20 20 74 6f  |s back out,.  to|
00000270  20 63 72 65 61 74 65 20  61 20 73 65 63 6f 6e 64  | create a second|
00000280  61 72 79 20 6f 75 74 77  61 72 64 20 62 6f 75 6e  |ary outward boun|
00000290  64 20 77 61 76 65 20 66  72 6f 6e 74 20 6f 66 20  |d wave front of |
000002a0  6c 6f 77 65 72 20 69 6e  74 65 6e 73 69 74 79 20  |lower intensity |
000002b0  74 68 61 6e 20 74 68 65  0a 20 20 66 69 72 73 74  |than the.  first|
000002c0  2e 20 49 66 20 79 6f 75  20 75 73 65 20 61 20 72  |. If you use a r|
000002d0  65 6c 61 74 69 76 65 6c  79 20 73 6d 61 6c 6c 20  |elatively small |
000002e0  77 69 6e 64 6f 77 20 28  73 61 79 20 31 32 38 78  |window (say 128x|
000002f0  31 32 38 29 20 79 6f 75  20 77 69 6c 6c 20 61 6c  |128) you will al|
00000300  73 6f 0a 20 20 6f 62 73  65 72 76 65 20 70 61 74  |so.  observe pat|
00000310  74 65 72 6e 73 20 66 6f  72 6d 65 64 20 62 79 20  |terns formed by |
00000320  74 68 65 20 6f 72 69 67  69 6e 61 6c 20 77 61 76  |the original wav|
00000330  65 66 72 6f 6e 74 20 77  72 61 70 70 69 6e 67 20  |efront wrapping |
00000340  61 72 6f 75 6e 64 20 26  0a 20 20 69 6e 74 65 72  |around &.  inter|
00000350  66 65 72 69 6e 67 20 77  69 74 68 20 74 68 65 20  |fering with the |
00000360  6f 74 68 65 72 20 77 61  76 65 73 2e 0a 0a 49 4e  |other waves...IN|
00000370  49 54 49 41 4c 49 53 41  54 49 4f 4e 2a 0a 0a 20  |ITIALISATION*.. |
00000380  20 31 30 44 45 46 20 50  52 4f 43 64 6f 0a 20 20  | 10DEF PROCdo.  |
00000390  32 30 2a 53 65 74 45 76  61 6c 20 77 72 61 70 20  |20*SetEval wrap |
000003a0  6f 6e 0a 20 20 33 30 2a  53 65 74 45 76 61 6c 20  |on.  30*SetEval |
000003b0  6e 65 69 67 20 6d 61 72  67 6f 6c 75 73 0a 20 20  |neig margolus.  |
000003c0  34 30 45 4e 44 50 52 4f  43 0a 0a 53 43 52 45 45  |40ENDPROC..SCREE|
000003d0  4e 2a 0a 0a 20 20 31 30  44 45 46 20 50 52 4f 43  |N*..  10DEF PROC|
000003e0  64 6f 0a 20 20 32 30 50  52 4f 43 73 6f 75 70 28  |do.  20PROCsoup(|
000003f0  32 35 35 2c 31 2c 2e 35  29 0a 20 20 33 30 63 25  |255,1,.5).  30c%|
00000400  3d 46 4e 61 63 6f 6c 28  32 35 35 29 3a 47 43 4f  |=FNacol(255):GCO|
00000410  4c 20 63 25 41 4e 44 36  33 20 54 49 4e 54 20 63  |L c%AND63 TINT c|
00000420  25 0a 20 20 34 30 43 49  52 43 4c 45 20 46 49 4c  |%.  40CIRCLE FIL|
00000430  4c 20 30 2c 30 2c 38 30  0a 20 20 35 30 45 4e 44  |L 0,0,80.  50END|
00000440  50 52 4f 43 0a 0a 43 4f  44 45 2a 0a 0a 28 20 52  |PROC..CODE*..( R|
00000450  45 41 44 5f 4e 45 49 47  0a 20 20 43 45 4c 4c 20  |EAD_NEIG.  CELL |
00000460  4f 50 50 20 3d 20 49 46  20 28 43 57 20 43 43 57  |OPP = IF (CW CCW|
00000470  20 3d 20 49 46 20 28 43  45 4c 4c 20 43 57 20 3c  | = IF (CELL CW <|
00000480  3e 20 49 46 20 28 43 57  20 3d 3d 29 29 29 0a 20  |> IF (CW ==))). |
00000490  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
000004b0  20 20 20 20 20 20 20 20  20 20 20 4f 50 50 20 3d  |           OPP =|
000004c0  3d 20 20 20 20 29 0a 0a  45 4e 44 2a              |=    )..END*|
000004cc