Simple sound in Matrix Brandy (Linux)?

I remember Soruk saying that sound hadn't seen much (if any) attention in Matrix Brandy. What I'm trying to do is play a very simple monophonic tune using SOUND over one channel. It makes sound all right, just they're all the same pitch ...
   10 FOR i%=1 TO 27
   20   READ P%, D%
   30   PRINT P%, D%
   40   SOUND 1, -5, P%, D%
   50 NEXT i%
   60 END
   70 REM it's that LG tune again - scruss
   80 DATA 105,12,125,4,121,4,113,4,105
   90 DATA 12,93,12,97,4,93,4,97,4,85
  100 DATA 4,93,4,97,4,93,12,105,12,105
  110 DATA 12,125,4,121,4,113,4,105,12
  120 DATA 125,12,125,4,133,4,125,4,121
  130 DATA 4,113,4,121,4,125,48
If you have an LG washer/dryer, you should recognize this tune.

This code plays as expected on a BBC Micro. If you're using BBC BASIC for SDL 2.0 (or indeed, BBC BASIC on the Amstrad NC100 ☺), change:
   40   SOUND 1, -5, P%, D%
to
   40   SOUND 1, -5, P% + 47, D%
and it'll play that happy little tune properly.

I'm not needing sound to work on Matrix Brandy at all: more wondering if I'm doing it wrong than anything else.

Comments

  • Soruk
    edited September 2022
    (Old reply deleted)

    Having checked in with David Hawes (who wrote this), he understood if no delay parameter was set a note just overwrote the previous, and sadly his Arc no longer powers up. (Though, I think newer RPCEmu supports sound.) I've checked in a tiny change that if no delay is set it assumes "-1" (which was his suggested workaround, to add a delay of -1), but no delay can be specified as zero.

    (My old Samsung washing machine used to play Schubert's "The Trout"...)
  • Aha, thanks!