Add a three-voice sound chip for the PmodAMP2 on JA

Ports 90h-9Dh: three square-wave voices and a noise source, a mixer,
16 log volumes with attack/decay envelopes, summed and played through a
sigma-delta output on JA[0]. CLS and reset hush it. Includes a
testbench (scripts/sim-sound.sh), a BASIC example and manual section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
brad ArantandClaude Opus 5.5 committed 2026-11-30 11:13:37 -08:00
1 parent b629cbec00
commit 2d1be15786
11 files changed
+428 -3

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
10 REM SOUND DEMO - NEEDS A PMODAMP2 ON THE TOP ROW OF PMOD JA
20 REM PITCH = 125000 / FREQUENCY. PORTS: 144-149 PITCHES, 150 NOISE,
30 REM 151 MIXER, 152-154 VOLUMES, 155-157 ENVELOPES (ATTACK*16+DECAY)
40 PRINT "A SCALE"
50 OUT 151, 1: OUT 155, 3
60 FOR I = 1 TO 8
70 READ P: GOSUB 500
80 OUT 152, 15
90 IF INP(152) > 0 THEN 90
100 NEXT I
110 PRINT "A LASER"
120 OUT 151, 4: OUT 149, 0: OUT 157, 0: OUT 154, 13
130 FOR P = 30 TO 250 STEP 6: OUT 148, P: NEXT P
140 OUT 154, 0
150 PRINT "AN EXPLOSION"
160 OUT 151, 16: OUT 150, 24: OUT 156, 8: OUT 153, 15
170 IF INP(153) > 0 THEN 170
180 PRINT "A CHORD"
190 OUT 151, 7
200 OUT 144, 221: OUT 145, 1: OUT 146, 123: OUT 147, 1: OUT 148, 63: OUT 149, 1
210 OUT 155, 69: OUT 156, 69: OUT 157, 69
220 OUT 152, 12: OUT 153, 12: OUT 154, 12
230 IF INP(152) > 0 THEN 230
240 END
500 OUT 144, P - INT(P / 256) * 256: OUT 145, INT(P / 256): RETURN
900 DATA 477, 425, 379, 358, 319, 284, 253, 239