Home » Archimedes archive » Archimedes World » AW-1996-08.adf » !6502DEm_6502Dem » !6502Dem/Resources/Sound7a

!6502Dem/Resources/Sound7a

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 » Archimedes archive » Archimedes World » AW-1996-08.adf » !6502DEm_6502Dem
Filename: !6502Dem/Resources/Sound7a
Read OK:
File size: 0B34 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM > Sound7a
   20REM
   30REM BBC Sound and Speech emulation library
   40REM For Mike Borcherds BBC emulator
   50REM This file by Dominic Symes
   60
   70REM Set up global defaults
   80DEF PROCsound_define
   90REM Size of circular buffer for each channel
  100sound_buf_size_log%=10
  110sound_buf_size%=(1<<sound_buf_size_log%)
  120ENDPROC
  130
  140REM Call to set up sound tables
  150DEF PROCsound_init
  160LOCAL a,f%
  170PROCsound_define
  180REMvolume%=127
  190DIM sound_buffer% (4*sound_buf_size%)
  200DIM sound_vol_table% &40
  210DIM sound_sample% &200
  220DIM sound_stack% &80
  230FOR f%=0 TO &3FF
  240?(sound_buffer%+f%)=f%*10
  250NEXT
  260SYS "Sound_Volume",127 TO sc_vol
  270REM Set up sound sample for pitch channels - half way between
  280REM a sine wave and square wave gives best likeness.
  290FOR f%=0 TO &7F
  300SYS "6502_Sound",f%,A%
  310a=SIN((f%/128)*PI)
  320IF a<>0 THEN a=a^.2
  330SYS "Sound_SoundLog",&7FFFFFFF*a TO a
  340?(sound_sample%+f%)=a
  350?(sound_sample%+&80+f%)=a+1
  360NEXT
  370REM Set up the sound sample for the pulse generator
  380FOR f%=0 TO &3F
  390?(sound_sample%+&100+f%)=?(sound_sample%+f%*(8/4))
  400NEXT
  410FOR f%=0 TO &BF
  420?(sound_sample%+&110+f%)=?(sound_sample%+&80+f%*(8/12))
  430NEXT
  440SYS "Sound_Volume",sc_vol
  450sound_voice%=code+!(code+22*4)
  460!(sound_voice%+0)=sound_buffer%
  470!(sound_voice%+4)=sound_vol_table%
  480!(sound_voice%+8)=sound_sample%
  490!(sound_voice%+12)=sound_stack%+&40
  500sound_voice%+=16
  510ENDPROC
  520
  530DEFPROCsound_reinit
  540sound_voice%=code+!(code+22*4)
  550!(sound_voice%+0)=sound_buffer%
  560!(sound_voice%+4)=sound_vol_table%
  570!(sound_voice%+8)=sound_sample%
  580!(sound_voice%+12)=sound_stack%+&40
  590sound_voice%+=16
  600ENDPROC
  620
  630REM Call just before starting the emulator
  640DEF PROCsound_setup
  641IF NOTsound_on% THEN ENDPROC
  650LOCAL f%,a%
  660SYS "Sound_InstallVoice",sound_voice%,0 TO ,sound_voice_slot%
  670SYS "Sound_Configure",4,208,48,0,0 TO sc_0,sc_1,sc_2,sc_3,sc_4
  680SYS "Sound_AttachVoice",1,1 TO ,sv_1
  690SYS "Sound_AttachVoice",2,1 TO ,sv_2
  700SYS "Sound_AttachVoice",3,1 TO ,sv_3
  710SYS "Sound_AttachVoice",4,1 TO ,sv_4
  720SYS "Sound_AttachNamedVoice",1,"6502Emulator"
  730SYS "Sound_AttachNamedVoice",2,"6502Emulator"
  740SYS "Sound_AttachNamedVoice",3,"6502Emulator"
  750SYS "Sound_AttachNamedVoice",4,"6502Emulator"
  760REM Start infinite duration notes on each of the channels
  770SYS "Sound_Volume",volume% TO sc_vol
  780REM Set up the linear to log volume conversion
  790FOR f%=0 TO &F
  800a%=f%+(f%<<4)
  810a%=a%+(a%<<8)
  820a%=a%+(a%<<16)
  830SYS "Sound_SoundLog",(a%>>>1) TO a%
  840REMPRINT a%
  850?(sound_vol_table%+f%)=a%
  860NEXT
  870SOUND 1,-1,1,255
  880SOUND 2,-1,1,255
  890SOUND 3,-1,1,255
  900SOUND 4,-1,1,255
  901sound%=TRUE
  910ENDPROC
  920
  930REM Call after exiting the emulator
  940DEF PROCsound_restore
  941IF NOTsound_on% THEN ENDPROC
  950SYS "Sound_Volume",sc_vol
  960SYS "Sound_Configure",sc_0,sc_1,sc_2,sc_3,sc_4
  970SYS "Sound_AttachVoice",1,sv_1
  980SYS "Sound_AttachVoice",2,sv_2
  990SYS "Sound_AttachVoice",3,sv_3
 1000SYS "Sound_AttachVoice",4,sv_4
 1010SYS "Sound_RemoveVoice",0,sound_voice_slot%
 1011sound%=FALSE
 1020ENDPROC
 1030

� > Sound7a
�
,� BBC Sound and Speech emulation library
(%� For Mike Borcherds BBC emulator
2 � This file by Dominic Symes
<
F� Set up global defaults
P� �sound_define
Z.� Size of circular buffer for each channel
dsound_buf_size_log%=10
n,sound_buf_size%=(1<<sound_buf_size_log%)
x�
�
�!� Call to set up sound tables
�� �sound_init
�
� a,f%
��sound_define
��volume%=127
�'� sound_buffer% (4*sound_buf_size%)
�� sound_vol_table% &40
�� sound_sample% &200
�� sound_stack% &80
�� f%=0 � &3FF
�?(sound_buffer%+f%)=f%*10
��
"ș "Sound_Volume",127 � sc_vol
?� Set up sound sample for pitch channels - half way between
6� a sine wave and square wave gives best likeness.
"� f%=0 � &7F
,ș "6502_Sound",f%,A%
6a=�((f%/128)*�)
@� a<>0 � a=a^.2
J'ș "Sound_SoundLog",&7FFFFFFF*a � a
T?(sound_sample%+f%)=a
^?(sound_sample%+&80+f%)=a+1
h�
r5� Set up the sound sample for the pulse generator
|� f%=0 � &3F
�6?(sound_sample%+&100+f%)=?(sound_sample%+f%*(8/4))
��
�� f%=0 � &BF
�;?(sound_sample%+&110+f%)=?(sound_sample%+&80+f%*(8/12))
��
�ș "Sound_Volume",sc_vol
�"sound_voice%=code+!(code+22*4)
�#!(sound_voice%+0)=sound_buffer%
�&!(sound_voice%+4)=sound_vol_table%
�#!(sound_voice%+8)=sound_sample%
�'!(sound_voice%+12)=sound_stack%+&40
�sound_voice%+=16
��

��sound_reinit
"sound_voice%=code+!(code+22*4)
&#!(sound_voice%+0)=sound_buffer%
0&!(sound_voice%+4)=sound_vol_table%
:#!(sound_voice%+8)=sound_sample%
D'!(sound_voice%+12)=sound_stack%+&40
Nsound_voice%+=16
X�
l
v,� Call just before starting the emulator
�� �sound_setup
�� �sound_on% � �
�� f%,a%
�?ș "Sound_InstallVoice",sound_voice%,0 � ,sound_voice_slot%
�@ș "Sound_Configure",4,208,48,0,0 � sc_0,sc_1,sc_2,sc_3,sc_4
�&ș "Sound_AttachVoice",1,1 � ,sv_1
�&ș "Sound_AttachVoice",2,1 � ,sv_2
�&ș "Sound_AttachVoice",3,1 � ,sv_3
�&ș "Sound_AttachVoice",4,1 � ,sv_4
�0ș "Sound_AttachNamedVoice",1,"6502Emulator"
�0ș "Sound_AttachNamedVoice",2,"6502Emulator"
�0ș "Sound_AttachNamedVoice",3,"6502Emulator"
�0ș "Sound_AttachNamedVoice",4,"6502Emulator"
�;� Start infinite duration notes on each of the channels
&ș "Sound_Volume",volume% � sc_vol
0� Set up the linear to log volume conversion
� f%=0 � &F
 a%=f%+(f%<<4)
*a%=a%+(a%<<8)
4a%=a%+(a%<<16)
>%ș "Sound_SoundLog",(a%>>>1) � a%
H
�PRINT a%
R?(sound_vol_table%+f%)=a%
\�
f� 1,-1,1,255
p� 2,-1,1,255
z� 3,-1,1,255
�� 4,-1,1,255
�sound%=�
��
�
�%� Call after exiting the emulator
�� �sound_restore
�� �sound_on% � �
�ș "Sound_Volume",sc_vol
�1ș "Sound_Configure",sc_0,sc_1,sc_2,sc_3,sc_4
�!ș "Sound_AttachVoice",1,sv_1
�!ș "Sound_AttachVoice",2,sv_2
�!ș "Sound_AttachVoice",3,sv_3
�!ș "Sound_AttachVoice",4,sv_4
�.ș "Sound_RemoveVoice",0,sound_voice_slot%
�sound%=�
��

�
00000000  0d 00 0a 0f f4 20 3e 20  53 6f 75 6e 64 37 61 0d  |..... > Sound7a.|
00000010  00 14 05 f4 0d 00 1e 2c  f4 20 42 42 43 20 53 6f  |.......,. BBC So|
00000020  75 6e 64 20 61 6e 64 20  53 70 65 65 63 68 20 65  |und and Speech e|
00000030  6d 75 6c 61 74 69 6f 6e  20 6c 69 62 72 61 72 79  |mulation library|
00000040  0d 00 28 25 f4 20 46 6f  72 20 4d 69 6b 65 20 42  |..(%. For Mike B|
00000050  6f 72 63 68 65 72 64 73  20 42 42 43 20 65 6d 75  |orcherds BBC emu|
00000060  6c 61 74 6f 72 0d 00 32  20 f4 20 54 68 69 73 20  |lator..2 . This |
00000070  66 69 6c 65 20 62 79 20  44 6f 6d 69 6e 69 63 20  |file by Dominic |
00000080  53 79 6d 65 73 0d 00 3c  04 0d 00 46 1c f4 20 53  |Symes..<...F.. S|
00000090  65 74 20 75 70 20 67 6c  6f 62 61 6c 20 64 65 66  |et up global def|
000000a0  61 75 6c 74 73 0d 00 50  13 dd 20 f2 73 6f 75 6e  |aults..P.. .soun|
000000b0  64 5f 64 65 66 69 6e 65  0d 00 5a 2e f4 20 53 69  |d_define..Z.. Si|
000000c0  7a 65 20 6f 66 20 63 69  72 63 75 6c 61 72 20 62  |ze of circular b|
000000d0  75 66 66 65 72 20 66 6f  72 20 65 61 63 68 20 63  |uffer for each c|
000000e0  68 61 6e 6e 65 6c 0d 00  64 1a 73 6f 75 6e 64 5f  |hannel..d.sound_|
000000f0  62 75 66 5f 73 69 7a 65  5f 6c 6f 67 25 3d 31 30  |buf_size_log%=10|
00000100  0d 00 6e 2c 73 6f 75 6e  64 5f 62 75 66 5f 73 69  |..n,sound_buf_si|
00000110  7a 65 25 3d 28 31 3c 3c  73 6f 75 6e 64 5f 62 75  |ze%=(1<<sound_bu|
00000120  66 5f 73 69 7a 65 5f 6c  6f 67 25 29 0d 00 78 05  |f_size_log%)..x.|
00000130  e1 0d 00 82 04 0d 00 8c  21 f4 20 43 61 6c 6c 20  |........!. Call |
00000140  74 6f 20 73 65 74 20 75  70 20 73 6f 75 6e 64 20  |to set up sound |
00000150  74 61 62 6c 65 73 0d 00  96 11 dd 20 f2 73 6f 75  |tables..... .sou|
00000160  6e 64 5f 69 6e 69 74 0d  00 a0 0a ea 20 61 2c 66  |nd_init..... a,f|
00000170  25 0d 00 aa 11 f2 73 6f  75 6e 64 5f 64 65 66 69  |%.....sound_defi|
00000180  6e 65 0d 00 b4 10 f4 76  6f 6c 75 6d 65 25 3d 31  |ne.....volume%=1|
00000190  32 37 0d 00 be 27 de 20  73 6f 75 6e 64 5f 62 75  |27...'. sound_bu|
000001a0  66 66 65 72 25 20 28 34  2a 73 6f 75 6e 64 5f 62  |ffer% (4*sound_b|
000001b0  75 66 5f 73 69 7a 65 25  29 0d 00 c8 1a de 20 73  |uf_size%)..... s|
000001c0  6f 75 6e 64 5f 76 6f 6c  5f 74 61 62 6c 65 25 20  |ound_vol_table% |
000001d0  26 34 30 0d 00 d2 18 de  20 73 6f 75 6e 64 5f 73  |&40..... sound_s|
000001e0  61 6d 70 6c 65 25 20 26  32 30 30 0d 00 dc 16 de  |ample% &200.....|
000001f0  20 73 6f 75 6e 64 5f 73  74 61 63 6b 25 20 26 38  | sound_stack% &8|
00000200  30 0d 00 e6 11 e3 20 66  25 3d 30 20 b8 20 26 33  |0..... f%=0 . &3|
00000210  46 46 0d 00 f0 1d 3f 28  73 6f 75 6e 64 5f 62 75  |FF....?(sound_bu|
00000220  66 66 65 72 25 2b 66 25  29 3d 66 25 2a 31 30 0d  |ffer%+f%)=f%*10.|
00000230  00 fa 05 ed 0d 01 04 22  c8 99 20 22 53 6f 75 6e  |.......".. "Soun|
00000240  64 5f 56 6f 6c 75 6d 65  22 2c 31 32 37 20 b8 20  |d_Volume",127 . |
00000250  73 63 5f 76 6f 6c 0d 01  0e 3f f4 20 53 65 74 20  |sc_vol...?. Set |
00000260  75 70 20 73 6f 75 6e 64  20 73 61 6d 70 6c 65 20  |up sound sample |
00000270  66 6f 72 20 70 69 74 63  68 20 63 68 61 6e 6e 65  |for pitch channe|
00000280  6c 73 20 2d 20 68 61 6c  66 20 77 61 79 20 62 65  |ls - half way be|
00000290  74 77 65 65 6e 0d 01 18  36 f4 20 61 20 73 69 6e  |tween...6. a sin|
000002a0  65 20 77 61 76 65 20 61  6e 64 20 73 71 75 61 72  |e wave and squar|
000002b0  65 20 77 61 76 65 20 67  69 76 65 73 20 62 65 73  |e wave gives bes|
000002c0  74 20 6c 69 6b 65 6e 65  73 73 2e 0d 01 22 10 e3  |t likeness..."..|
000002d0  20 66 25 3d 30 20 b8 20  26 37 46 0d 01 2c 19 c8  | f%=0 . &7F..,..|
000002e0  99 20 22 36 35 30 32 5f  53 6f 75 6e 64 22 2c 66  |. "6502_Sound",f|
000002f0  25 2c 41 25 0d 01 36 13  61 3d b5 28 28 66 25 2f  |%,A%..6.a=.((f%/|
00000300  31 32 38 29 2a af 29 0d  01 40 13 e7 20 61 3c 3e  |128)*.)..@.. a<>|
00000310  30 20 8c 20 61 3d 61 5e  2e 32 0d 01 4a 27 c8 99  |0 . a=a^.2..J'..|
00000320  20 22 53 6f 75 6e 64 5f  53 6f 75 6e 64 4c 6f 67  | "Sound_SoundLog|
00000330  22 2c 26 37 46 46 46 46  46 46 46 2a 61 20 b8 20  |",&7FFFFFFF*a . |
00000340  61 0d 01 54 19 3f 28 73  6f 75 6e 64 5f 73 61 6d  |a..T.?(sound_sam|
00000350  70 6c 65 25 2b 66 25 29  3d 61 0d 01 5e 1f 3f 28  |ple%+f%)=a..^.?(|
00000360  73 6f 75 6e 64 5f 73 61  6d 70 6c 65 25 2b 26 38  |sound_sample%+&8|
00000370  30 2b 66 25 29 3d 61 2b  31 0d 01 68 05 ed 0d 01  |0+f%)=a+1..h....|
00000380  72 35 f4 20 53 65 74 20  75 70 20 74 68 65 20 73  |r5. Set up the s|
00000390  6f 75 6e 64 20 73 61 6d  70 6c 65 20 66 6f 72 20  |ound sample for |
000003a0  74 68 65 20 70 75 6c 73  65 20 67 65 6e 65 72 61  |the pulse genera|
000003b0  74 6f 72 0d 01 7c 10 e3  20 66 25 3d 30 20 b8 20  |tor..|.. f%=0 . |
000003c0  26 33 46 0d 01 86 36 3f  28 73 6f 75 6e 64 5f 73  |&3F...6?(sound_s|
000003d0  61 6d 70 6c 65 25 2b 26  31 30 30 2b 66 25 29 3d  |ample%+&100+f%)=|
000003e0  3f 28 73 6f 75 6e 64 5f  73 61 6d 70 6c 65 25 2b  |?(sound_sample%+|
000003f0  66 25 2a 28 38 2f 34 29  29 0d 01 90 05 ed 0d 01  |f%*(8/4)).......|
00000400  9a 10 e3 20 66 25 3d 30  20 b8 20 26 42 46 0d 01  |... f%=0 . &BF..|
00000410  a4 3b 3f 28 73 6f 75 6e  64 5f 73 61 6d 70 6c 65  |.;?(sound_sample|
00000420  25 2b 26 31 31 30 2b 66  25 29 3d 3f 28 73 6f 75  |%+&110+f%)=?(sou|
00000430  6e 64 5f 73 61 6d 70 6c  65 25 2b 26 38 30 2b 66  |nd_sample%+&80+f|
00000440  25 2a 28 38 2f 31 32 29  29 0d 01 ae 05 ed 0d 01  |%*(8/12)).......|
00000450  b8 1c c8 99 20 22 53 6f  75 6e 64 5f 56 6f 6c 75  |.... "Sound_Volu|
00000460  6d 65 22 2c 73 63 5f 76  6f 6c 0d 01 c2 22 73 6f  |me",sc_vol..."so|
00000470  75 6e 64 5f 76 6f 69 63  65 25 3d 63 6f 64 65 2b  |und_voice%=code+|
00000480  21 28 63 6f 64 65 2b 32  32 2a 34 29 0d 01 cc 23  |!(code+22*4)...#|
00000490  21 28 73 6f 75 6e 64 5f  76 6f 69 63 65 25 2b 30  |!(sound_voice%+0|
000004a0  29 3d 73 6f 75 6e 64 5f  62 75 66 66 65 72 25 0d  |)=sound_buffer%.|
000004b0  01 d6 26 21 28 73 6f 75  6e 64 5f 76 6f 69 63 65  |..&!(sound_voice|
000004c0  25 2b 34 29 3d 73 6f 75  6e 64 5f 76 6f 6c 5f 74  |%+4)=sound_vol_t|
000004d0  61 62 6c 65 25 0d 01 e0  23 21 28 73 6f 75 6e 64  |able%...#!(sound|
000004e0  5f 76 6f 69 63 65 25 2b  38 29 3d 73 6f 75 6e 64  |_voice%+8)=sound|
000004f0  5f 73 61 6d 70 6c 65 25  0d 01 ea 27 21 28 73 6f  |_sample%...'!(so|
00000500  75 6e 64 5f 76 6f 69 63  65 25 2b 31 32 29 3d 73  |und_voice%+12)=s|
00000510  6f 75 6e 64 5f 73 74 61  63 6b 25 2b 26 34 30 0d  |ound_stack%+&40.|
00000520  01 f4 14 73 6f 75 6e 64  5f 76 6f 69 63 65 25 2b  |...sound_voice%+|
00000530  3d 31 36 0d 01 fe 05 e1  0d 02 08 04 0d 02 12 12  |=16.............|
00000540  dd f2 73 6f 75 6e 64 5f  72 65 69 6e 69 74 0d 02  |..sound_reinit..|
00000550  1c 22 73 6f 75 6e 64 5f  76 6f 69 63 65 25 3d 63  |."sound_voice%=c|
00000560  6f 64 65 2b 21 28 63 6f  64 65 2b 32 32 2a 34 29  |ode+!(code+22*4)|
00000570  0d 02 26 23 21 28 73 6f  75 6e 64 5f 76 6f 69 63  |..&#!(sound_voic|
00000580  65 25 2b 30 29 3d 73 6f  75 6e 64 5f 62 75 66 66  |e%+0)=sound_buff|
00000590  65 72 25 0d 02 30 26 21  28 73 6f 75 6e 64 5f 76  |er%..0&!(sound_v|
000005a0  6f 69 63 65 25 2b 34 29  3d 73 6f 75 6e 64 5f 76  |oice%+4)=sound_v|
000005b0  6f 6c 5f 74 61 62 6c 65  25 0d 02 3a 23 21 28 73  |ol_table%..:#!(s|
000005c0  6f 75 6e 64 5f 76 6f 69  63 65 25 2b 38 29 3d 73  |ound_voice%+8)=s|
000005d0  6f 75 6e 64 5f 73 61 6d  70 6c 65 25 0d 02 44 27  |ound_sample%..D'|
000005e0  21 28 73 6f 75 6e 64 5f  76 6f 69 63 65 25 2b 31  |!(sound_voice%+1|
000005f0  32 29 3d 73 6f 75 6e 64  5f 73 74 61 63 6b 25 2b  |2)=sound_stack%+|
00000600  26 34 30 0d 02 4e 14 73  6f 75 6e 64 5f 76 6f 69  |&40..N.sound_voi|
00000610  63 65 25 2b 3d 31 36 0d  02 58 05 e1 0d 02 6c 04  |ce%+=16..X....l.|
00000620  0d 02 76 2c f4 20 43 61  6c 6c 20 6a 75 73 74 20  |..v,. Call just |
00000630  62 65 66 6f 72 65 20 73  74 61 72 74 69 6e 67 20  |before starting |
00000640  74 68 65 20 65 6d 75 6c  61 74 6f 72 0d 02 80 12  |the emulator....|
00000650  dd 20 f2 73 6f 75 6e 64  5f 73 65 74 75 70 0d 02  |. .sound_setup..|
00000660  81 14 e7 20 ac 73 6f 75  6e 64 5f 6f 6e 25 20 8c  |... .sound_on% .|
00000670  20 e1 0d 02 8a 0b ea 20  66 25 2c 61 25 0d 02 94  | ...... f%,a%...|
00000680  3f c8 99 20 22 53 6f 75  6e 64 5f 49 6e 73 74 61  |?.. "Sound_Insta|
00000690  6c 6c 56 6f 69 63 65 22  2c 73 6f 75 6e 64 5f 76  |llVoice",sound_v|
000006a0  6f 69 63 65 25 2c 30 20  b8 20 2c 73 6f 75 6e 64  |oice%,0 . ,sound|
000006b0  5f 76 6f 69 63 65 5f 73  6c 6f 74 25 0d 02 9e 40  |_voice_slot%...@|
000006c0  c8 99 20 22 53 6f 75 6e  64 5f 43 6f 6e 66 69 67  |.. "Sound_Config|
000006d0  75 72 65 22 2c 34 2c 32  30 38 2c 34 38 2c 30 2c  |ure",4,208,48,0,|
000006e0  30 20 b8 20 73 63 5f 30  2c 73 63 5f 31 2c 73 63  |0 . sc_0,sc_1,sc|
000006f0  5f 32 2c 73 63 5f 33 2c  73 63 5f 34 0d 02 a8 26  |_2,sc_3,sc_4...&|
00000700  c8 99 20 22 53 6f 75 6e  64 5f 41 74 74 61 63 68  |.. "Sound_Attach|
00000710  56 6f 69 63 65 22 2c 31  2c 31 20 b8 20 2c 73 76  |Voice",1,1 . ,sv|
00000720  5f 31 0d 02 b2 26 c8 99  20 22 53 6f 75 6e 64 5f  |_1...&.. "Sound_|
00000730  41 74 74 61 63 68 56 6f  69 63 65 22 2c 32 2c 31  |AttachVoice",2,1|
00000740  20 b8 20 2c 73 76 5f 32  0d 02 bc 26 c8 99 20 22  | . ,sv_2...&.. "|
00000750  53 6f 75 6e 64 5f 41 74  74 61 63 68 56 6f 69 63  |Sound_AttachVoic|
00000760  65 22 2c 33 2c 31 20 b8  20 2c 73 76 5f 33 0d 02  |e",3,1 . ,sv_3..|
00000770  c6 26 c8 99 20 22 53 6f  75 6e 64 5f 41 74 74 61  |.&.. "Sound_Atta|
00000780  63 68 56 6f 69 63 65 22  2c 34 2c 31 20 b8 20 2c  |chVoice",4,1 . ,|
00000790  73 76 5f 34 0d 02 d0 30  c8 99 20 22 53 6f 75 6e  |sv_4...0.. "Soun|
000007a0  64 5f 41 74 74 61 63 68  4e 61 6d 65 64 56 6f 69  |d_AttachNamedVoi|
000007b0  63 65 22 2c 31 2c 22 36  35 30 32 45 6d 75 6c 61  |ce",1,"6502Emula|
000007c0  74 6f 72 22 0d 02 da 30  c8 99 20 22 53 6f 75 6e  |tor"...0.. "Soun|
000007d0  64 5f 41 74 74 61 63 68  4e 61 6d 65 64 56 6f 69  |d_AttachNamedVoi|
000007e0  63 65 22 2c 32 2c 22 36  35 30 32 45 6d 75 6c 61  |ce",2,"6502Emula|
000007f0  74 6f 72 22 0d 02 e4 30  c8 99 20 22 53 6f 75 6e  |tor"...0.. "Soun|
00000800  64 5f 41 74 74 61 63 68  4e 61 6d 65 64 56 6f 69  |d_AttachNamedVoi|
00000810  63 65 22 2c 33 2c 22 36  35 30 32 45 6d 75 6c 61  |ce",3,"6502Emula|
00000820  74 6f 72 22 0d 02 ee 30  c8 99 20 22 53 6f 75 6e  |tor"...0.. "Soun|
00000830  64 5f 41 74 74 61 63 68  4e 61 6d 65 64 56 6f 69  |d_AttachNamedVoi|
00000840  63 65 22 2c 34 2c 22 36  35 30 32 45 6d 75 6c 61  |ce",4,"6502Emula|
00000850  74 6f 72 22 0d 02 f8 3b  f4 20 53 74 61 72 74 20  |tor"...;. Start |
00000860  69 6e 66 69 6e 69 74 65  20 64 75 72 61 74 69 6f  |infinite duratio|
00000870  6e 20 6e 6f 74 65 73 20  6f 6e 20 65 61 63 68 20  |n notes on each |
00000880  6f 66 20 74 68 65 20 63  68 61 6e 6e 65 6c 73 0d  |of the channels.|
00000890  03 02 26 c8 99 20 22 53  6f 75 6e 64 5f 56 6f 6c  |..&.. "Sound_Vol|
000008a0  75 6d 65 22 2c 76 6f 6c  75 6d 65 25 20 b8 20 73  |ume",volume% . s|
000008b0  63 5f 76 6f 6c 0d 03 0c  30 f4 20 53 65 74 20 75  |c_vol...0. Set u|
000008c0  70 20 74 68 65 20 6c 69  6e 65 61 72 20 74 6f 20  |p the linear to |
000008d0  6c 6f 67 20 76 6f 6c 75  6d 65 20 63 6f 6e 76 65  |log volume conve|
000008e0  72 73 69 6f 6e 0d 03 16  0f e3 20 66 25 3d 30 20  |rsion..... f%=0 |
000008f0  b8 20 26 46 0d 03 20 11  61 25 3d 66 25 2b 28 66  |. &F.. .a%=f%+(f|
00000900  25 3c 3c 34 29 0d 03 2a  11 61 25 3d 61 25 2b 28  |%<<4)..*.a%=a%+(|
00000910  61 25 3c 3c 38 29 0d 03  34 12 61 25 3d 61 25 2b  |a%<<8)..4.a%=a%+|
00000920  28 61 25 3c 3c 31 36 29  0d 03 3e 25 c8 99 20 22  |(a%<<16)..>%.. "|
00000930  53 6f 75 6e 64 5f 53 6f  75 6e 64 4c 6f 67 22 2c  |Sound_SoundLog",|
00000940  28 61 25 3e 3e 3e 31 29  20 b8 20 61 25 0d 03 48  |(a%>>>1) . a%..H|
00000950  0d f4 50 52 49 4e 54 20  61 25 0d 03 52 1d 3f 28  |..PRINT a%..R.?(|
00000960  73 6f 75 6e 64 5f 76 6f  6c 5f 74 61 62 6c 65 25  |sound_vol_table%|
00000970  2b 66 25 29 3d 61 25 0d  03 5c 05 ed 0d 03 66 10  |+f%)=a%..\....f.|
00000980  d4 20 31 2c 2d 31 2c 31  2c 32 35 35 0d 03 70 10  |. 1,-1,1,255..p.|
00000990  d4 20 32 2c 2d 31 2c 31  2c 32 35 35 0d 03 7a 10  |. 2,-1,1,255..z.|
000009a0  d4 20 33 2c 2d 31 2c 31  2c 32 35 35 0d 03 84 10  |. 3,-1,1,255....|
000009b0  d4 20 34 2c 2d 31 2c 31  2c 32 35 35 0d 03 85 0c  |. 4,-1,1,255....|
000009c0  73 6f 75 6e 64 25 3d b9  0d 03 8e 05 e1 0d 03 98  |sound%=.........|
000009d0  04 0d 03 a2 25 f4 20 43  61 6c 6c 20 61 66 74 65  |....%. Call afte|
000009e0  72 20 65 78 69 74 69 6e  67 20 74 68 65 20 65 6d  |r exiting the em|
000009f0  75 6c 61 74 6f 72 0d 03  ac 14 dd 20 f2 73 6f 75  |ulator..... .sou|
00000a00  6e 64 5f 72 65 73 74 6f  72 65 0d 03 ad 14 e7 20  |nd_restore..... |
00000a10  ac 73 6f 75 6e 64 5f 6f  6e 25 20 8c 20 e1 0d 03  |.sound_on% . ...|
00000a20  b6 1c c8 99 20 22 53 6f  75 6e 64 5f 56 6f 6c 75  |.... "Sound_Volu|
00000a30  6d 65 22 2c 73 63 5f 76  6f 6c 0d 03 c0 31 c8 99  |me",sc_vol...1..|
00000a40  20 22 53 6f 75 6e 64 5f  43 6f 6e 66 69 67 75 72  | "Sound_Configur|
00000a50  65 22 2c 73 63 5f 30 2c  73 63 5f 31 2c 73 63 5f  |e",sc_0,sc_1,sc_|
00000a60  32 2c 73 63 5f 33 2c 73  63 5f 34 0d 03 ca 21 c8  |2,sc_3,sc_4...!.|
00000a70  99 20 22 53 6f 75 6e 64  5f 41 74 74 61 63 68 56  |. "Sound_AttachV|
00000a80  6f 69 63 65 22 2c 31 2c  73 76 5f 31 0d 03 d4 21  |oice",1,sv_1...!|
00000a90  c8 99 20 22 53 6f 75 6e  64 5f 41 74 74 61 63 68  |.. "Sound_Attach|
00000aa0  56 6f 69 63 65 22 2c 32  2c 73 76 5f 32 0d 03 de  |Voice",2,sv_2...|
00000ab0  21 c8 99 20 22 53 6f 75  6e 64 5f 41 74 74 61 63  |!.. "Sound_Attac|
00000ac0  68 56 6f 69 63 65 22 2c  33 2c 73 76 5f 33 0d 03  |hVoice",3,sv_3..|
00000ad0  e8 21 c8 99 20 22 53 6f  75 6e 64 5f 41 74 74 61  |.!.. "Sound_Atta|
00000ae0  63 68 56 6f 69 63 65 22  2c 34 2c 73 76 5f 34 0d  |chVoice",4,sv_4.|
00000af0  03 f2 2e c8 99 20 22 53  6f 75 6e 64 5f 52 65 6d  |..... "Sound_Rem|
00000b00  6f 76 65 56 6f 69 63 65  22 2c 30 2c 73 6f 75 6e  |oveVoice",0,soun|
00000b10  64 5f 76 6f 69 63 65 5f  73 6c 6f 74 25 0d 03 f3  |d_voice_slot%...|
00000b20  0c 73 6f 75 6e 64 25 3d  a3 0d 03 fc 05 e1 0d 04  |.sound%=........|
00000b30  06 04 0d ff                                       |....|
00000b34