Topic : The GFA-Basic Compendium Author : GFA Systemtechnik GmbH Version : GFABasic.HYP v2.98 (12/31/2023) Subject : Documentation/Programming Nodes : 899 Index Size : 28056 HCP-Version : 3 Compiled on : Atari @charset : atarist @lang : @default : Document not found @help : Help @options : +g -i -s +z @width : 75 @hostname : STRNGSRV @hostname : CAB @hostname : HIGHWIRE @hostname : THING View Ref-FileDMACONTROL ctrl DMASOUND beg,end,rate[,ctrl] beg, end, rate, ctrl: iexp These commands allow sampled 8-bit DMA sound to be played on STE compatible hardware. The DMACONTROL command controls the method used to play back the sound as follows: Method Bits ctrl Stop sound %00 0 Play once %01 1 - %10 - Play in loop %11 3 The DMASOUND command causes the sound to be played. The parameters are as follows: beg - Sample starting address end - Sample ending address rate - Sample rate: 0 = 6.25 kHz (not supported on the Atari Falcon030) 1 = 12.5 kHz 2 = 25 kHz 3 = 50 kHz ctrl - See command DMACONTROL above. Example: ' Try each of the DMASOUND lines for different effect. n%=360*32 DIM a|(n%) ' DMASOUND V:a|(0),V:a|(n%),0,3 ' DMASOUND V:a|(0),V:a|(n%),1,3 ' DMASOUND V:a|(0),V:a|(n%),2,3 DMASOUND V:a|(0),V:a|(n%),3,3 FOR i%=0 TO n% a|(i%)=128+SINQ(i%*i%/7200)*127 NEXT i% REPEAT UNTIL MOUSEK DMACONTROL 0 Memo: Sound playback can be prematurely halted with DMACONTROL 0. The DMASOUND command could allow 16-bit playback on the Falcon030 if bit 6 was set in the rate, however GFA clobbers that bit assuming it won't ever be used. The DMASOUND command can be used to play mono sound samples if bit 7 is set to 'on' in the rate parameter. Example: rate&=BSET(rate&,7) DMA sound data format: signed (-128 to 127) 8-bit PCM Mono: sample must be of even length Stereo 8-bit: word (15--left--8/7--right--0) DMASOUND defaults to 'play in loop' due to a bug if ctrl is omitted. DMASOUND does not work if the sample buffer is located in fastram! Care must be taken when allocating sample buffers and also pay close attention to the program header flags when compiling. If you use the XBIOS sound functions, the program header flags must be set Global or Super, otherwise a call to Buffoper() results in a crash. The Falcon030 Sound System+, Locksnd()+, Unlocksnd()+, Soundcmd()+, Setbuffer()+, Setmode()+, Settracks()+, Setmontracks()+, Setinterrupt()+, Buffoper()+, Dsptristate()+, Gpio()+, Devconnect()+, Sndstatus()+, Buffptr()+