'A guide to AMOS - part 2 - sound commands2
'
'Written by Bruce Laing for Megadisc Digital Publishing
'
'© 1994 Bruce Laing for Megadisc Digital Publishing
'
'commands covered: 
'
'Sam Raw - Play sampled sound
'
'Voice - Play one or more voices 
'
'Set Wave - define waveform
'
'Wave - set up waveform to play
'
'Del Wave - Delete waveform
'
'Sample - set up sample as a waveform
'
'Set Envel - Define sound envelope 
'
'play - play note
'
Global DISK$,MUS$,SAM$,S$
Screen Open 0,640,256,2,Hires : Hide On : Curs Off : Colour 1,$FFF : Cls 
Locate ,1 : Centre "A GUIDE TO AMOS SERIES PART 2 - MUSIC & SOUND COMMANDS 2"
Locate ,3 : Centre "Written by Bruce Laing for Megadisc"
Locate ,5 : Centre "© 1994 Bruce Laing for Megadisc" : Print 
Locate ,8 : Print "Press:"
Locate ,10 : Print "1 for AMOS"
Locate ,12 : Print "2 for Easy AMOS"
Locate ,14 : Print "3 for AMOS Professional"
BACK:
Repeat : A$=Inkey$ : Until A$<>""
A=Val(A$) : If A<1 or A>3 Then Goto BACK
Locate ,20 : Centre "SETTING UP....."
If Length(10)>0 Then Goto SKIPLOAD
On A Proc AMOS,EZAMOS,AMOSPRO
SKIPLOAD: PRESSIT
Fade 3 : Wait 75 : Cls : Colour 1,$FFF
Locate ,1 : Centre "The Sam Raw Command"
Sam Bank 10
Sam Raw 15,Start(10),Length(10),10000
Wait 350 : Locate ,3 : Centre "Press any key" : Wait Key 
Locate ,5 : Centre "The PLAY command"
DING
Locate ,7 : Centre "The SET WAVE command"
SETWV
Locate ,9 : Centre "The NOISE command"
Noise To 15
DING
Locate ,11 : Centre "The SAMPLE Command"
Sam Bank 5
Sample 5 To 15
DING
Locate ,13 : Centre "The SET ENVEL command"
Set Envel 1,0 To 10,63 : Wave 1 To 15
DING
Music 1 : Locate ,15 : Centre "The LED command"
FLA
Locate ,17 : Centre "and finally, the VOICE command"
VOYCE
Locate ,22 : Centre "Thats all folks!"
Locate ,23 : Centre "until next time......." : Wait 150
Fade 3 : For X=63 To 0 Step -1 : Mvolume X : Wait 3 : Next X : Music Off : Erase 3 : Erase 10 : Erase 5 : Edit 
Procedure VOYCE
   For X=1 To 15
      Voice X
      Wait 50
   Next X
End Proc
Procedure FLA
   For X=1 To 5
      Led Off 
   Wait 50 : Led On : Wait 50 : Next X
End Proc
Procedure AMOS
   DISK$="AMOS_DATA:" : MUS$=DISK$+"music/music.abk" : SAM$=DISK$+"samples/samples.abk"
   LODFILE
End Proc
Procedure EZAMOS
   DISK$="Easy_examples:" : MUS$=DISK$+"Sounds/tricycle_music.abk" : SAM$=DISK$+"Sounds/Block_samples.abk"
   LODFILE
End Proc
Procedure AMOSPRO
   DISK$="amospro_examples:" : MUS$=DISK$+"music/music.abk" : SAM$=DISK$+"samples/Mixture.abk"
   LODFILE
End Proc
Procedure LODFILE
   Reserve As Chip Data 10,56000
   Bload SAM$,Start(10)
   Load MUS$
   Load SAM$,5
End Proc
Procedure DING
   For X=1 To 5
      Play 9,70,10
      Wait 15
   Next X
End Proc
Procedure PRESSIT
Locate ,20 : Centre "Press any key....." : Wait Key 
End Proc
Procedure SETWV
   S$=""
   For I=-128 To 127
      X=I : If X<0 Then X=X+256
      S$=S$+Chr$(X)
   Next I
   Set Wave 2,S$ : DING
   Wave 1 To 15 : Del Wave 2
End Proc
