About the Datalink
What is it?
Download Protocol
Display Segments
Memory Map
150 vs 150s
EEProms

Wristapp Programming
Reference
Creating Wristapps
Wristapp Format
The State Table
Wristapp Routines
Wristapps

Wristapp Programming
Tutorials
1 - Hello World
2 - Getting Input
3 - Better Input
4 - Showing Selection
5 - PassWord
6 - Day Find
7 - Playing with Sound
8 - Using Callbacks
9 - Hex Dump
10 - EEPROM Dumper
11 - Spend Watch
12 - Sound Schemes
13 - Random Numbers
14 - Hourly Chimes
15 - Lottery Picker

Sound Schemes
Sound Hardware
[This Page] Sound Scheme Format

Home Send Mail

Important Terms:

Sound Scheme - A set of sounds (this is the .SPC file in the SND directory of the Datalink application) which are downloaded to the watch. A sound scheme contains all the Soundlets and Sound Sequences for all 10 defined system sound values. This file is loaded in thewatch so that the end of it is at $0435 in memory.

System Sound - is one of the 10 defined system sound values:
Value Symbol Purpose
$80 SND_NONE No sound at all
$c1 SND_BUTTON Button Beep
$c2 SND_RETURN Return to time
$83 SND_HOURLY Hourly Chime
$c4 SND_CONF Confirmation
$85 SND_APPT Appointment Beep
$86 SND_ALARM Alarm Beep
$87 SND_DLOAD Program Download
$88 SND_EXTRA Extra sound
$89 SND_COMERR Comm Error
$8a SND_DONE Comm done

Sound Sequence - The sequence of soundlets which are played to for a given System Sound. There can be as few as 1 Sound Sequence and as many as 10 different Sound Sequences. Each System Sound maps to one Sound Sequence although the same Sound Sequence can be used for more than one System Sound. A Sound Sequence is represented by two series of numbers.

The first series is called the Soundlet Count Table and consists of a series of one or more bytes where the last byte in the series has the high bit set ($80). For each entry in the Soundlet Count Table, the number of times that a sound is played is determined by clearing the tip bit and then using the resulting number as a count. So $81 indicates the last entry with a repeat count of 1. $A0 indicates the last entry with a repeat count of 20. $0A indicates an entry (with at least one more following it) with a repeat count of 10.

The second series is the Soundlet Pointer Table which consists of exactly the same number of entries as the Soundlet Count Table. Each entry in this table is simply a pointer to the start of the corresponding Soundlet

Soundlet - A sequence of Notes terminated by a 0 note. There is no practical limit on the number of notes in a Soundlet except for the total size of 256 bytes for the entire Sound Scheme.

Note - A single sound to be played. The note consists of a single byte broken into two Nibbles. The high order nibble is the tone to be played and the low order nibble is the duration for that tone in 1/10th of a second intervals.

Tone - One of 14 tones supported by the sound hardware on the watch as well as the two values which produce silence:
Hardware Tones
0 Tone_END - This seems to generate silence
1 Low C
2 High C
3 Middle C
4 Very High C
5 High F (Reported to be a little bit lower than F)
6 Middle F
7 Low F
8 Very High G# (G-Sharp)
9 High G# (G-Sharp)
10 Middle G# (G-Sharp)
11 Low G# (G-Sharp)
12 High D
13 Middle D
14 Low D
15 Silence

The format of a sound scheme

Given the default sounds in the ROM, I propose that this is how we would interpret and code them:

TONE_END        EQU     $00     ; END
TONE_LOW_C      EQU     $10     ; Low C
TONE_HI_C       EQU     $20     ; High C
TONE_MID_C      EQU     $30     ; Middle C
TONE_VHI_C      EQU     $40     ; Very high C
TONE_HI_F       EQU     $50     ; High F (little bit lower than F)
TONE_MID_F      EQU     $60     ; Middle F
TONE_LO_F       EQU     $70     ; Low F
TONE_VHI_GSHARP EQU     $80     ; Very High G# (G Sharp)
TONE_HI_GSHARP  EQU     $90     ; High G#
TONE_MID_GSHARP EQU     $A0     ; Middle G#
TONE_LO_GSHARP  EQU     $B0     ; Low G#
TONE_HI_D       EQU     $C0     ; High D
TONE_MID_D      EQU     $D0     ; Middle D
TONE_LO_D       EQU     $E0     ; Low D
TONE_PAUSE      EQU     $F0     ; Pause
;
; This is the default sound table
;
DEF_SOUNDS
        db      SP_1-SD_1       ; 0000: 08

        db      SD_1-DEF_SOUNDS ; 0001: 0b   BUTTON BEEP
        db      SD_2-DEF_SOUNDS ; 0002: 0c   RETURN TO TIME
        db      SD_3-DEF_SOUNDS ; 0003: 0d   HOURLY CHIME
        db      SD_4-DEF_SOUNDS ; 0004: 0e   CONFIRMATION
        db      SD_5-DEF_SOUNDS ; 0005: 0f   APPOINTMENT BEEP
        db      SD_5-DEF_SOUNDS ; 0006: 0f   ALARM BEEP
        db      SD_5-DEF_SOUNDS ; 0007: 0f   PROGRAM DOWNLOAD
        db      SD_5-DEF_SOUNDS ; 0008: 0f   EXTRA
        db      SD_6-DEF_SOUNDS ; 0009: 11   COMM ERROR
        db      SD_7-DEF_SOUNDS ; 000a: 12   COMM DONE
;
; This is the soundlet count table which contains the duration
; counts for the individual soundlets
;
SD_1    db      SND_END+1       ; 000b: 81
SD_2    db      SND_END+1       ; 000c: 81
SD_3    db      SND_END+2       ; 000d: 82
SD_4    db      SND_END+4       ; 000e: 84
SD_5    db      10,SND_END+24   ; 000f: 0a a8
SD_6    db      SND_END+10      ; 0011: 8a
SD_7    db      SND_END+16      ; 0012: a0
;
; This is the soundlet pointer table which contains the pointers to the soundlets
;
SP_1    db      SL_2-DEF_SOUNDS ; 0013: 1d
SP_2    db      SL_1-DEF_SOUNDS ; 0014: 1b
SP_3    db      SL_3-DEF_SOUNDS ; 0015: 1f
SP_4    db      SL_2-DEF_SOUNDS ; 0016: 1d
SP_5    db      SL_4-DEF_SOUNDS ; 0017: 22
        db      SL_5-DEF_SOUNDS ; 0018: 27
SP_6    db      SL_5-DEF_SOUNDS ; 0019: 2a
SP_7    db      SL_2-DEF_SOUNDS ; 001a: 1d
;
; These are the soundlets themselves.  The +1 or other number
indicates the duration for the sound.
;
SL_1    db      TONE_HI_GSHARP+1                ; 001b: 91
        db      TONE_END                        ; 001c: 00

SL_2    db      TONE_MID_C+1                    ; 001d: 31
        db      TONE_END                        ; 001e: 00

SL_3    db      TONE_MID_C+2                    ; 001f: 32
        db      TONE_PAUSE+2                    ; 0020: f2
        db      TONE_END                        ; 0021: 00

SL_4    db      TONE_HI_C+2                     ; 0022: 22
        db      TONE_PAUSE+2                    ; 0023: f2
        db      TONE_HI_C+2                     ; 0024: 22
        db      TONE_PAUSE+10                   ; 0025: fa
        db      TONE_END                        ; 0026: 00

SL_5    db      TONE_HI_C+2                     ; 0027: 22
        db      TONE_PAUSE+2                    ; 0028: f2
        db      TONE_END                        ; 0029: 00

SL_6    db      TONE_HI_C+3                     ; 002a: 23
        db      TONE_MID_C+3                    ; 002b: 33
        db      TONE_END                        ; 002c: 00
;
; This is the tone that the comm app plays for each record
;
        db      TONE_MIDC/16                    ; 002d: 03

Sound Files

The sound sceme stored in a file is nearly identical with the exception of a 4 byte header.  Given the default sound, you might picture it as below (with thanks to Pigeon for his first representation of this).

[Image]

Brent Davidson gives a pretty good explaination of this:  ("Absolute offset" refer refer to the offset location in the file.  "Relative offset" refers to the location without the "header" (25 04 19 69).

The 08 at absolute offset 0004 indicates that the soundlet count table is 8 bytes long.  In this case, we have only 7 different sounds, but one sound has two entries because it uses two soundlets.

The next 10 bytes represent the relative offsets of the sound sequences. The relative offset of each byte reflects the system sound it represents. This table is fixed in size because there are only 10 system sounds.

The next 8 (or however many are indicated by absolute offset 0004) bytes (the soundlet count table) are in the relative offsets pointed to by the sound sequence table. The high order nibble of the byte indicates the last entry for this sound.  If it is clear, there are more soundlets associated with this sound.  The remaining 7 bits in the byte are the number of times that the corresponding soundlet is to be played.  Hence, a value of 0a indicates that the corresponding soundlet is to be played 10 times and the next entry in the soundlet count table is to be used for the sound.  A value of 81 indicates that the corresponding soundlet is to be played once.

The next 8 bytes (or however many are indicated by absolute offset 0004) are the soundlet pointer table. They are parallel to the previous 8 bytes, and reference the relative offsets of the soundlets.

The remainder of the bytes (except for the final byte) are the soundlets themselves. The high order nibble indicates the tone, the low order nibble indicates the duration. A byte of 00 signals the end of each soundlet.

The low order nibble of the final byte of the file indicates the tone played after each record is downloaded during transmission, it's high order nibble is always 0, and it's count cannot be set.

1