From 584bd2fa2af0be6b355d69c27c39f2fbb5cb894d Mon Sep 17 00:00:00 2001 From: Daniel Serpell Date: Sun, 25 Feb 2018 13:16:24 -0300 Subject: [PATCH] Adds a new form of SOUND command, with only one parameter. --- manual.md | 5 +++++ src/basic.syn | 12 ++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/manual.md b/manual.md index 855b94f..4e0c476 100644 --- a/manual.md +++ b/manual.md @@ -938,12 +938,17 @@ Graphic and Sound Statements **Adjust voice sound parameters** **SOUND _voice_, _pitch_, _dist_, _vol_ / S.** +**SOUND _voice_** **SOUND** Adjust sound parameters for _voice_ (from 0 to 3) ot the given _pitch_, _distortion_ and _volume_. + If only the _voice_ parameter is + present, that voice is cleared so no + sound is produced by that voice. + If no parameters are given, clears all voices so that no sounds are produced. diff --git a/src/basic.syn b/src/basic.syn index c5216f4..e2a10bf 100644 --- a/src/basic.syn +++ b/src/basic.syn @@ -400,6 +400,15 @@ NEXT_VARNAME: POSITION: emit TOK_BYTE emit COLCRS EXPR "," emit TOK_DPOKE emit TOK_BYTE emit ROWCRS EXPR emit TOK_POKE +# SOUND arguments, three possibilities: +# SOUND voice, freq, distort, vol +# SOUND voice +# SOUND +SOUND: + EXPR emit TOK_USHL emit TOK_NUM word AUDF1 emit TOK_ADD "," EXPR "," EXPR_AB emit TOK_SHL8 emit TOK_ADD emit TOK_DPOKE emit TOK_NUM word AUDCTL emit TOK_0 emit TOK_POKE emit TOK_NUM word SKCTL emit TOK_BYTE emit 3 emit TOK_POKE + EXPR emit TOK_USHL emit TOK_NUM word AUDF1 emit TOK_ADD emit TOK_0 emit TOK_DPOKE + emit TOK_SOUND_OFF + # Arrays ARRAY_WORD_ADDR: emit TOK_VAR_LOAD E_VAR_ARRAY_WORD PAR_EXPR emit TOK_USHL emit TOK_ADD @@ -540,8 +549,7 @@ PARSE_LINE_COMMAND: "DRawto" POSITION emit TOK_DRAWTO "FIllto" POSITION emit TOK_FILLTO "SEtcolor" EXPR emit TOK_NUM word COLOR0 emit TOK_ADD "," EXPR_AB emit TOK_POKE - "Sound" EXPR emit TOK_USHL emit TOK_NUM word AUDF1 emit TOK_ADD "," EXPR "," EXPR_AB emit TOK_SHL8 emit TOK_ADD emit TOK_DPOKE emit TOK_NUM word AUDCTL emit TOK_0 emit TOK_POKE emit TOK_NUM word SKCTL emit TOK_BYTE emit 3 emit TOK_POKE - "Sound" emit TOK_SOUND_OFF + "Sound" SOUND "DIm" DIM_VAR DIM_MORE "CLose" IO_CHAN emit TOK_CLOSE "Open" IO_CHAN_COMMA emit TOK_BYTE emit OPEN XIO_EXPR