28825 Parallax Inc, 28825 Datasheet - Page 4

MINI SOUND PLAYER SOUNDPAL

28825

Manufacturer Part Number
28825
Description
MINI SOUND PLAYER SOUNDPAL
Manufacturer
Parallax Inc
Datasheet

Specifications of 28825

Accessory Type
Sound Player
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With/related Products
BASIC Stamp®
For Use With
28824 - SERVOPAL SERVO PULSER TIMER
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
iopin
baud
reset
'----Reset the SoundPAL---------------------
DoReset:
Playing Individual Notes
Pitch and Duration
Sounds are played by the SoundPAL as musical notes, each having an associated pitch and duration. The
pitches available to the programmer are those of the 12-note chromatic scale, and spanning 2½ octaves,
plus four programmable octave offsets, yielding a total range of 6½ octaves. In addition, there is one
pitch corresponding to a “rest”, which makes it possible to program silent intervals as well. The
illustration below shows the notes available in octave zero (oct0).
The note names shown between the staffs above are defined later in a sequence of CON statements in a
PBASIC code template. This template is also available for download from the SoundPAL product page on
the Parallax website.
Three additional octave ranges (oct1 – oct3) are available, each one an octave higher than its
predecessor. Without specifiying an octave range, the SoundPAL defaults to oct2, in which C_0 is middle
C, and A_0 is A440.
Each note or rest may have one of eight durations. These durations, along with their musical equivalents
and PBASIC names from the SoundPAL template, are shown below:
A single note in PBASIC consists of a pitch and duration and occupies one byte. If the note is a quarter
note, only the pitch need be given, since quarter notes are the default. To change to a different duration,
just add the duration name to the note name. For example, middle C in oct0 played as a dotted eighth
note would be de+C_2, and an eighth rest would be e+ZZZ. For consistency, always put the duration
ahead of the pitch.
The actual note duration depends on the tempo. Four tempos are available (tmp0 - tmp3). Without
specifying a tempo, the SoundPAL defaults to tmp1, in which there are 266 quarter note beats per
minute. Each successive tempo is double the speed of its predecessor, so the range for quarter note
© Parallax, Inc. • SoundPAL (2007.10.29)
DO:LOOP UNTIL iopin
SEROUT iopin, reset, [0]
RETURN
PIN
CON
CON
15
$8000 + 84
$8000 + 813
'Pin number used for communicaiton with SoundPAL.
'Communication baudrate is 9600 for BS2, BS2e, and BS2pe.
'Reset baudrate is 1200 for BS2, BS2e, and BS2pe.
'See BASIC Stamp Manual for settings with other Stamps.
'Make sure SoundPAL is powered up.
'Output 9 low bits at 1200 baud (i.e. a 7.5ms pulse).
Page 4 of 12

Related parts for 28825