Skip to content

Trigger a sound on Jupiter Ace

Reuse a small real effect, understand who stops it, and compare its native output with an omitted-trigger control.

Give an accepted action a sound. The same caller changes its picture and triggers this effect; a second version performs the action with the trigger removed. Listen to both.

Working effect

Trigger omitted

Take the effect

The reusable effect

click.fth
: CLICK 478 120 BEEP ;

CLICK has stack effect ( – ). It supplies 478 and 120 to ROM BEEP, which consumes both operands and blocks for the generated tone. The running turn count below them stays on the stack.

Compile CLICK before the caller. Its stack effect is ( – ): the two BEEP operands are pushed and consumed inside the word. The manual defines the lower operand as a period in eight-microsecond units and the upper as milliseconds; this requests 120 ms. The PCM check establishes changing output, not a pitch or duration calibration.

Change it and recognise a mistake

Change CLICK’s two BEEP operands using the manual’s pitch/duration rules. Their units are not interchangeable with BASIC SOUND on other machines.

The omitted-trigger control still accepts the action but fails the same audio guard as the working caller. Keyboard clicks or other machine output are not enough: the BASIC checks compare against a separate rejected-command recording.

Deliberately omitted sound trigger

no-sound.fth
: CLICK ;
: NEWKEY
BEGIN INKEY 0= UNTIL
BEGIN INKEY ?DUP UNTIL ;
: BOX CR ." XXX" CR ." X X" CR ." XXX" ;
: TURNS 0 BEGIN
CLS ." TURN " DUP U. BOX
NEWKEY 49 = IF 1+ CLICK THEN
0 UNTIL ;
TURNS

The working implementation above repairs that omission. If an effect instead drones on, check the mute/service path and that its state is initialised. Servicing twice makes a counted effect shorter; servicing only after input can leave it running while the player waits. Those are lifecycle decisions to test when adapting it.

Run the caller

Compile demo.fth in its listed order. Its final TURNS starts the caller. Press 1, let go, and press it again: the count reaches two.

Jupiter Ace native caller after accepted input.
Captured from the running caller in the configuration below.

Where setup, trigger and service belong

demo.fth
: CLICK 478 120 BEEP ;
: NEWKEY
BEGIN INKEY 0= UNTIL
BEGIN INKEY ?DUP UNTIL ;
: BOX CR ." XXX" CR ." X X" CR ." XXX" ;
: TURNS 0 BEGIN
CLS ." TURN " DUP U. BOX
NEWKEY 49 = IF 1+ CLICK THEN
0 UNTIL ;
TURNS

Compare blocking, serviced and queued sound when choosing the next step.

Verification and sources

Target: stock 3 KiB Ace, recorded FORTH ROM. These callers were executed with released Emu198x 0.44.1; assembly uses Asm198x 0.0.71. The sample folder contains reproduction instructions and retained observations. The independent checker binds source, native captures and actual output; its rejection tests exercise wrong state, missing files and false audio claims.

This qualifies the named emulator/firmware path. Pitch accuracy, original hardware and other peripherals require their own observations.

Jupiter Cantab, Jupiter Ace User Manual: INKEY, ?DUP, conditional loops and BEEP; chapter on the loudspeaker and music.