<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://www.ninerpedia.org/index.php?action=history&amp;feed=atom&amp;title=Sound_with_CALL_LOAD</id>
	<title>Sound with CALL LOAD - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://www.ninerpedia.org/index.php?action=history&amp;feed=atom&amp;title=Sound_with_CALL_LOAD"/>
	<link rel="alternate" type="text/html" href="http://www.ninerpedia.org/index.php?title=Sound_with_CALL_LOAD&amp;action=history"/>
	<updated>2026-04-24T17:04:37Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>http://www.ninerpedia.org/index.php?title=Sound_with_CALL_LOAD&amp;diff=48774&amp;oldid=prev</id>
		<title>Stephen Shaw: add link to Garbage collection</title>
		<link rel="alternate" type="text/html" href="http://www.ninerpedia.org/index.php?title=Sound_with_CALL_LOAD&amp;diff=48774&amp;oldid=prev"/>
		<updated>2014-10-20T14:55:03Z</updated>

		<summary type="html">&lt;p&gt;add link to &lt;a href=&quot;/wiki/Garbage_collection&quot; title=&quot;Garbage collection&quot;&gt;Garbage collection&lt;/a&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 14:55, 20 October 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l118&quot;&gt;Line 118:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 118:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Line 160 turns the sound off. What happens if you omit it?&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Line 160 turns the sound off. What happens if you omit it?&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Let the program run for a long time. What happens when &amp;#039;garbage collection&amp;#039; takes place?&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Let the program run for a long time. What happens when &amp;#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/ins&gt;garbage collection&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/ins&gt;&amp;#039; takes place?&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  Try an experiment:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  Try an experiment:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Stephen Shaw</name></author>
	</entry>
	<entry>
		<id>http://www.ninerpedia.org/index.php?title=Sound_with_CALL_LOAD&amp;diff=48651&amp;oldid=prev</id>
		<title>Stephen Shaw: add link to mini memory pokev</title>
		<link rel="alternate" type="text/html" href="http://www.ninerpedia.org/index.php?title=Sound_with_CALL_LOAD&amp;diff=48651&amp;oldid=prev"/>
		<updated>2014-10-11T08:42:16Z</updated>

		<summary type="html">&lt;p&gt;add link to mini memory pokev&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 08:42, 11 October 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;TI BASIC and Extended BASIC use the subprogram CALL SOUND to generate sounds.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;TI BASIC and Extended BASIC use the subprogram CALL SOUND to generate sounds.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;See also [[Mini Memory#Automatic Music|Mini Memory]] for automatic playing of music loaded with POKEV.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;It is also possible -and potentially more powerful- to use CALL LOAD.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;It is also possible -and potentially more powerful- to use CALL LOAD.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Stephen Shaw</name></author>
	</entry>
	<entry>
		<id>http://www.ninerpedia.org/index.php?title=Sound_with_CALL_LOAD&amp;diff=48601&amp;oldid=prev</id>
		<title>Stephen Shaw: New article on generating Sound with CALL LOAD</title>
		<link rel="alternate" type="text/html" href="http://www.ninerpedia.org/index.php?title=Sound_with_CALL_LOAD&amp;diff=48601&amp;oldid=prev"/>
		<updated>2014-10-07T13:30:04Z</updated>

		<summary type="html">&lt;p&gt;New article on generating Sound with CALL LOAD&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;TI BASIC and Extended BASIC use the subprogram CALL SOUND to generate sounds.&lt;br /&gt;
&lt;br /&gt;
It is also possible -and potentially more powerful- to use CALL LOAD.&lt;br /&gt;
&lt;br /&gt;
For example, using either TI Basic with Mini Memory plugged in, or Extended BASIC with memory expansion:&lt;br /&gt;
&lt;br /&gt;
 10 CALL INIT&lt;br /&gt;
 20 S=-31744&lt;br /&gt;
 30 CALL LOAD(S,137,&amp;quot;&amp;quot;,S,63,&amp;quot;&amp;quot;,S,145,&amp;quot;&amp;quot;,S,228,&amp;quot;&amp;quot;,S,250)&lt;br /&gt;
 40 GOTO 40&lt;br /&gt;
&lt;br /&gt;
Notice the sound does not terminate. We have to turn it off, either by using CALL LOAD to set Tone 1 and Noise volume to zero... or use a negative CALL SOUND:&lt;br /&gt;
 CALL SOUND(-1,110,0)&lt;br /&gt;
&lt;br /&gt;
Now for the theory.&lt;br /&gt;
&lt;br /&gt;
For sound we use memory address decimal -31744&lt;br /&gt;
&lt;br /&gt;
 To use a tone, two bytes are passed.&lt;br /&gt;
 To use a noise or to set volume, one byte is passed.&lt;br /&gt;
 Each byte has to be looked at as 8 bits, as follows:&lt;br /&gt;
&lt;br /&gt;
 NOISE:&lt;br /&gt;
 The 8 bits are as follows&lt;br /&gt;
 &amp;lt;code&amp;gt;   BIT:  |  1       |   2    3    4   |  5        |  6  |  7     8   |&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; Means:  | always 1 |    operation    | always 0  |type | shift rate |&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt; TONES:  FIRST BYTE&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;  BIT:  |  1       |   2    3    4   |  5     6     7     8   |&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;Means:  | always 1 |    operation    |  Frequency - 4 LSB     |&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;TONES:  SECOND BYTE &amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;  BIT:  |  1       |   2      |  3   4   5   6   7   8   |&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;Means   | always 0 | Always 0 |  Frequency - 6 M.S.B.    |&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;VOLUME:&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;  BIT:  |  1       |   2    3    4   |   5    6    7    8   |&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;Means:  | always 1 |    Operation    | Attenuation 4 M.S.B. |&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 M S B means Most Significant Bits&lt;br /&gt;
 L S B means Least Significant Bits&lt;br /&gt;
&lt;br /&gt;
In BASIC sound is used with CALL SOUND in the format CALL SOUND(time,freq1,vol1,freq2,vol2,freq3,vol3,noise type,value)&lt;br /&gt;
&lt;br /&gt;
 OPERATION: &lt;br /&gt;
 Operation is used for Noise, Tone first byte, and volume.&lt;br /&gt;
The values placed in these three bits determine what you are doing and to which of the three tone generators:&lt;br /&gt;
 Value of the three bits defining Operation:&lt;br /&gt;
 000...Frequency of tone 1  001..Volume of tone one   110...Noise generator&lt;br /&gt;
 010...Frequency of tone 2  011..Volume of tone two   111...Noise volume&lt;br /&gt;
 100...Frequency of tone 3  101..Volume of tone three&lt;br /&gt;
&lt;br /&gt;
FREQUENCY: The actual frequency is held in ten bits, which is split between the two tone bytes, and is determined as follows:&lt;br /&gt;
 what frequency do you want? Say 110 Hz (or 110 cycles per second!):&lt;br /&gt;
 We find out how many times the frequency will go into 111860.8&lt;br /&gt;
 (Strange number, but thats how the computer works!)&lt;br /&gt;
 Thus: 111860.8 / 110 = 1017 (use the closest integer) &lt;br /&gt;
 Now, turn this into a binary number: 1111111001 (ten values)&lt;br /&gt;
 and split it into the 6 left most bits and the four right most bits:&lt;br /&gt;
 6 MSB = 111111 and 4 LSB = 1001&lt;br /&gt;
 And these values go into the tone bytes as shown on previous page.&lt;br /&gt;
&lt;br /&gt;
NOISE: Noise Type: O = periodic noise, 1 = white noise&lt;br /&gt;
 Shift Rate: If set at 11, sound varies with frequency of tone 3.&lt;br /&gt;
&lt;br /&gt;
VOLUME: SIXTEEN levels are available from full volume (0000) to silence (1111)&lt;br /&gt;
 The sound varies by 2db between levels.&lt;br /&gt;
&lt;br /&gt;
TIME: Notice: no time input! To switch off a tone, load the relevant generator with a zero volume. Actual timing is external: you have to do it!&lt;br /&gt;
&lt;br /&gt;
WORKED EXAMPLE:&lt;br /&gt;
TONE ONE SET AT 110 Hz. 2db volume. with white noise. shift rate 00. vol 20db:&lt;br /&gt;
 Tone one: Byte 1:&lt;br /&gt;
 1..0..0..0..1..0..0..1 (1001=4LSB as shown above)&lt;br /&gt;
 Tone One. byte 2:&lt;br /&gt;
 0..0..1..1..1..1..1..1 1111111=6 MSB as above)&lt;br /&gt;
 Tone One. volume: —&lt;br /&gt;
 1..0..0..1..0..0..0..1&lt;br /&gt;
 NOISE type:&lt;br /&gt;
 1..1..1..0..0..1..0..0&lt;br /&gt;
 Noise volume:&lt;br /&gt;
 1..1..1..1..1..0..1..0&lt;br /&gt;
&lt;br /&gt;
To use CALL LOAD we have to transfer these 8 bit bytes into a decimal value:&lt;br /&gt;
&lt;br /&gt;
the right most bit has a value of one if set. the 2nd from the right has a value of 2. then 4.8.16,32.64 and 128.&lt;br /&gt;
&lt;br /&gt;
 From which we can work out:&lt;br /&gt;
 10001001=137    00111111=63    10010001=145     11100100=228   11111010=250&lt;br /&gt;
&lt;br /&gt;
 USING EXTENDED BASIC PLUS 32k RAM or MINI MEMORY·ON ITS OWN:&lt;br /&gt;
 10 CALL INIT&lt;br /&gt;
 20 S=-31744&lt;br /&gt;
 30 CALL LOAD(S,137,&amp;quot;&amp;quot;,S,63,&amp;quot;&amp;quot;,S,145,&amp;quot;&amp;quot;,S,228,&amp;quot;&amp;quot;,S,250)&lt;br /&gt;
 40 GOTO 40&lt;br /&gt;
&lt;br /&gt;
 To end the sound, set Tone 1 and Noise volume to zero... or use a negative call&lt;br /&gt;
 sound...CALL SOUND(-1,110,0)&lt;br /&gt;
&lt;br /&gt;
NOTE:&lt;br /&gt;
&lt;br /&gt;
1. You can change the frequency while the tone is still sounding. It takes two bytes so it is not as smooth as it could be...&lt;br /&gt;
&lt;br /&gt;
2. You can change the volume while the sound is still present... and it is faster than using several negative CALL SOUNDS, making it possible to do some envelope shaping .... as we shall see in the first of our example programs:&lt;br /&gt;
&lt;br /&gt;
SAMPLE ONE: A sort of bell sound:&lt;br /&gt;
 100 CALL INIT&lt;br /&gt;
 110 S=-31744&lt;br /&gt;
 120 CALL LOAD(S,137,&amp;quot;&amp;quot;,S,63,&amp;quot;&amp;quot;,S,171,&amp;quot;&amp;quot;,S,26)&lt;br /&gt;
 130 FOR A=0 TO 15&lt;br /&gt;
 140 CALL LOAD(S,144+A,&amp;quot;&amp;quot;,S,176+A)&lt;br /&gt;
 150 NEXT A&lt;br /&gt;
 160 CALL LOAD(S,159,&amp;quot;&amp;quot;,S,191)&lt;br /&gt;
 170 GOTO 120&lt;br /&gt;
&lt;br /&gt;
Line 160 turns the sound off. What happens if you omit it?&lt;br /&gt;
&lt;br /&gt;
Let the program run for a long time. What happens when &amp;#039;garbage collection&amp;#039; takes place?&lt;br /&gt;
&lt;br /&gt;
 Try an experiment:&lt;br /&gt;
 Change line 130 to:&lt;br /&gt;
 130 FOR A=1 to 14 STEP 2&lt;br /&gt;
 Notice the change?&lt;br /&gt;
&lt;br /&gt;
 Remember: there are two bytes for frequency&lt;br /&gt;
 and there is no sound until you give a volume!&lt;br /&gt;
&lt;br /&gt;
[[Category:Programming]]&lt;/div&gt;</summary>
		<author><name>Stephen Shaw</name></author>
	</entry>
</feed>