Atari ST series Technical Reference Manual page 86

Hide thumbs Also See for ST series:
Table of Contents

Advertisement

cymbals. Those whose volume is varied according to a small-
period waveform hum like a motor. Both noise and tones
may be enabled in a single channel, which then produces
both types of sound.
Figure 4-3. Waveform Shapes and the Sounds They Create
H a v e f o r n Con t r o l Bits
Reg i s t e r
13
Bit 3
Dec inal
C o n tinue
V alue
0-3
B
4-7
B
8
1
3
1
IB
1
11
1
12
1
13
1
14
1
IS
1
Program 4-3 demonstrates the use of the XBIOS Giac-
cess() call to produce tones of a constant volume. It turns
the top row of the ST keyboard into a musical keyboard.
Program 4-3. XGIACCES.C
/*
XGIACCES.C —
/*
PSG registers to produce musical
/*
tones. The program turns the top
/ *
row of the keyboard into a 'piano'.
/*
To quit, press "q".
/*
/*
/a***************************************
#include <osbind.h>
#define CON 2
unsigned notest 13) =
{
478,
/* C
= 261.6 Hz */
/ *
451,
C# = 277.2 Hz
426,
/* D
= 293.7 Hz
402,
/* D# = 311.1 Hz
379,
/* E
= 329.6 Hz */
358,
/* F
= 349.2 Hz */
338,
/* F# = 370.0 Hz */
319,
/ *
G
= 392.0 HZ
78
CHAPTER 4
Bit 1
Bit 2
Bit 8
Att a c k
A l t e r n a t e
B
-
1
-
B
B
B
B
8
1
1
8
1
8
1
8
1
1
1
1
( d u r ation of one cycle!
Demonstrates use of
^
/* For macro definitions */
/* console keyboard device no. */
/* the period setting for the notes */
/* of the chromatic scale */
* /
* /
* /
* /
U a v e f o r n
H old
X
-
A
___________
-
8
1
v v v w w
8
1
>4------------
/ W V V H / H 4 W
B
1
/
/ w w w \
B
1
y|
II
V
E n v e l o p e P e r io d
***/
*/
*/
*/
*/
*/
*/
*/
" */

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents