The Prompt Commands; Beep; Choose - HP 39g Master Manual

Graphing calculator
Hide thumbs Also See for 39g:
Table of Contents

Advertisement

T
h
e
P
r
o
m
p
t
c
o
T
h
e
P
r
o
m
p
t
c
o
BEEP <frequency>;<duration>
This will use the piezo crystal in the calculator to create a sound of the
specified frequency for the specified duration (in seconds). The resulting
frequency is not terribly accurate, varying by up to 5% from one calculator to
the next and depending also on the temperature.
The frequencies of the twelve semi-tone jumps in
the harmonic scale form a geometric sequence,
and since the ratio from C to C' is 2, the ratio for
each semi-tone must be 2
frequency used in tuning instruments is usually
440 cycle/sec for the note A. Since much of the
simple music used by students is written using the
scale of C, I use 440
of C as 261.6 cycles/sec.
We can use this to form a standard 'header' for
any program we want to use to play music. The
header shown right in the rounded box sets up the
scale of C major. The code which then follows plays the first two bars of the
tune "Strangers in the Night".
In this header, the duration of a note (T) is set to 0.5 seconds. It is easy to
change the tempo of the music by adjusting this. In this case you may find
that the music sounds a little better with T set to 0.55 or 0.6 seconds. T is a
crotchet, T/2 a quaver etc.
CHOOSE <variable>;<title>;<menu option1>;....
This command pops up a menu with
the title specified and with however
many options follow. The number of
the menu option highlighted when the
user presses
variable. The initial value of the
variable before the CHOOSE statement
determines which option is initially highlighted.
m
m
a
n
d
s
m
m
a
n
d
s
. The standard
12
) to find the frequency
9
12
/ (
2
is returned in the
240

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

40g39g+

Table of Contents