home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sauce 'n' Code 2
/
sauce-n-code-02.adf
/
ASCII_Source
/
DiskSample.asc
< prev
next >
Wrap
Text File
|
1995-07-02
|
2KB
|
70 lines
MAIN:
' Direct from Disk sample playing by Freak of NFA.
' ------------------------------------------------
' This version actually WORKS as opposed to the one
' in the AMOSPro manual that stuttered like mad on
' MY bloody machine.
' ------------------------------------------------
' Programmed on A1200 with 4Mb Fast RAM and a very
' slooooow (400k/s) harddrive running DiskExpander!
' ------------------------------------------------
' Permission given to ßudda/NFA to use this source
' in his excellent AMOS mag - "Sauce n' Code".
FILE$="A:DiCK/Our_Song.smp"
Open In 1,FILE$
FLEN=Lof(1)
Close 1
' Explanation of Variables
' ------------------------
' SECONDS = Seconds of Lead-in Time, low as 2s is okay!
' SPEED = Speed you want to play the sample at.
' CHUNKSIZE = Speed of Sample * Lead-in time
' CHUNKS = Number of chunks to load and play
' LASTCHUNK = "Remainder" for last chunk (it's SMALLER!)
' FLEN = Length of the sample you want to play
' BANK = Bank currently loading/playing
'
SECONDS=5 : SPEED=8343
CHUNKSIZE=SPEED*SECONDS
CHUNKS=FLEN/CHUNKSIZE
If CHUNKS*CHUNKSIZE<>FLEN Then Inc CHUNKS
LASTCHUNK=FLEN-(CHUNKSIZE*(CHUNKS-1))
' Two banks of size CHUNKSIZE reserved, one to
' play while the other is being filled.
Reserve As Chip Work 10,CHUNKSIZE
Reserve As Chip Work 11,CHUNKSIZE
BANK=10
' Playing the samples, remember:
' ------------------------------
' 1 - No need to wait before playing FIRST chunk
' 2 - All but the LAST chunks are the same length.
' 3 - LAST chunk is smaller and thus shorter.
Led Off
Open In 1,FILE$
For CHUNK=1 To CHUNKS
Timer=0
BANK=21-BANK
Sload 1 To Start(BANK),CHUNKSIZE
If CHUNK<>1 Then While Timer<>(50*SECONDS) : Wend
If CHUNK<>CHUNKS
Sam Raw 15,Start(BANK),CHUNKSIZE,SPEED
Else
Sam Raw 15,Start(BANK),LASTCHUNK,SPEED
End If
Next CHUNK
Close 1
Erase 10
Erase 11