Authors
Publication
Pub Details
Date
Pages
First this month we are going to talk about how to get the SOUND when using the SPECTRUM rom on your TS2068.
To get the SOUND on the SPECTRUM you would change the SOUND Statement for OUT 245 for the register and OUT 246 for the data.
Here is an example:
10 SOUND 8,16;9,16;10,16
You would change this line so it would look like this:
10 OUT 245,8: OUT 246,16: OUT 245,9: OUT 246,16: OUT 245,10: OUT 246,16
See, it’s simple! All you do is change the register for OUT 245,(register) and the data for OUT 246,(data)! There is only one little thing when using this method, the tempo will slow down since the computer has more commands to read. To avoid this just change the tempo for a faster one! By the way this tip was sent by JAMES KERR of Dolton, Illinois. Thanks James!
The next thing we are going to talk about is how to make your own envelope without using the Envelope Generator.
This one is pretty simple too, what you do is play with the music amplitude registers (8-10), lowering and raising the volume to create an envelope. Let’s say you wanted the notes in a music to fade away once they’re played, well you just have to have a FOR-NEXT routine that would lower the volume right after the note has been played. Here is an example:
10 FOR Z=1 TO 18
15 READ A,B,C
20 SOUND 8,15;7,62;0,A;1,B;: PAUSE C*8
30 FOR F=14 TO 5 STEP -1
40 SOUND 8,F
50 NEXT F
60 NEXT Z
70 DATA …,…
I will explain line 30 to 50:
Line 30 will initialise F, it starts at 14 since the first value of the register 8 was 15 then it will decrement by 1 until 5. That will create the effect.
Line 40 will change the register 8 with the value of F.
Line 50 will complete the loop.
You can make your own envelopes using this technique. The best results obtained by this technique are in machine language since it is much faster you can create better envelopes.
Anyways I’m done for this one so let’s move on for the Finale in this series of the SOUND EFFECTS with the TWO VOICE BEEP!
To create an illusion of a two voice BEEP you need a machine language routine since BASIC is too slow to handle such a task.
First let’s explain the theory:
A sound is represented by vibrations or pulses such as 0010100101 (1 sound on, 0 sound off).
Let’s say we have:VOICE 1: 0000100001VOICE 2: 0101010101SOUND generated when the two are mixed (voice 1 + voice 2): 0101110101, this would give the illusion of a two voice BEEP!
Based on this principle, we created a program that will simulate a two voice BEEP. That program is in fact only two counters (voice 1 & 2). These counters hold the pitch for each notes. Say we have voice 1 = 255 and voice 2 = 200. What the program would do is make a noise (pulse) each time one of the two counters is equal to 0 (zero) and then resets it to the original value (pitch). So every 200 and 255 times the computer would make a noise (pulse) and that would create the illusion of two voices.
This program is included right after this magazine (so are two examples of the previous techniques). We did not have time to find the notes so we just made a sine wave sound effect. We will leave it to you to find the right notes!
See you next month!!!
Products
Downloadable Media
Image Gallery
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.