  
  
  [0;33m*************************************************************************
  
  [33m    A GUIDE TO AMOS PART TWO - AMOS MUSIC AND SOUND COMMANDS 2
  
  [33m                  Written by Bruce Laing
  
  [33m    © 1994 Bruce Laing for Megadisc Digital Publishing
  
  [33m*************************************************************************


     [32m39  +-+  39  +-+  39  +-+  39  +-+  39  +-+  39  +-+  39  +-+  39[0m
  
  
   This is the second in the series of articles giving you the lowdown on
  AMOS and its associated commands.  The series will cover nearly all of
  the commands on all available versions of AMOS (including Easy AMOS and
  AMOS Professional.)  We will also cover some of the extension commands,
  (CTEXT, etc.) and will include a couple of example programs for you to 
  peruse at your own leisure.
  
  [0;33mWhat's in this article?[0m
  
  In this article, I will give a rundown of the sound commands not covered
  in part one and all of the AMOS Pro sound commands as well.  I will also
  include a few additional things I have observed since writing the first
  article and my tutorial which appeared in MD37.
  
  *************************************************************************
  
  [3mFellas, that was truly the kind of music that soothes the savage
  [3mbeast... And one of these days I'm gonna let you play for people!
  
  [3;33mSpike Jones addressing his band the City Slickers, 1948[0m
  
   This section of the article leads me into the first of the AMOS Pro
  specific commands covered in this series.  In part one I mentioned about
  the TRACK LOAD command, its syntax and how it is used for SoundTracker 
  modules.  The only problem of course is that it cannot play MED modules.
  Well François realised that and in the most recent adaptation of AMOS 
  (AMOS Pro) he added a few commands which will play MED modules and this
  is called the MED LOAD command.  This has the same syntax as the TRACK
  LOAD command and that is:
  
  [1mMED LOAD "Disk name:Module name",bank number[0m
  
  Change disk name to the name of the disk the module is on, module name
  to the name of the module and bank number to the bank that you wish to
  load the module into.  When the MED load command is invoked, AMOS Pro 
  checks in the LIBS: directory for the medplayer.library and if found,
  will open the library.  to play the module you use the MED PLAY command
  which has the syntax:
  
  [1mMED PLAY bank number,song number0m
  
  change bank number for the bank the MED module is located and song number
  to the song number in the bank.  you can have more than one song in the 
  bank concerned.  Some examples are:
  
  MED PLAY 2 (play the module in bank 2)
  MED PLAY ,2 (Play song number 2)
  MED PLAY 2,2 (Play Song number 2 in bank 2)
  
   The added advantage is that unlike the TRACK LOAD command, you can also
  play samples at the same time as when the MED module is playing.  but
  there is a down side to MED PLAY, and that is it cannot play OCTAMED
  modules. (I tried an OCTAMED module in AMOS Pro, which incidentally
  appeared in MD 27) and did not play properly.  4 channel modules are OK 
  though.
  
   To turn the module off, you use the MED STOP command, which is the same
  as the TRACK STOP command, and that is:
  
  MED STOP
  
  if you wish to continue the song the MED CONT command is very handy.
  This has the effect of restarting from where it left off (sneaky eh?)
  
  Some MED modules have some instructions for a MIDI interface (and if you
  are one of those lucky few) then the command to call is
  
  [1mMED MIDI ON[0m
  
  the additional thing to remember is to use this command before the
  medplayer.library is called (with MED LOAD).
  
  *************************************************************************
  
  [33mAMOS PRO SPEECH COMMANDS0m
  
   In part one we examined all of the speech handling commands available to
  all AMOS users, in this section we look at the additional speech commands
  available to AMOS Pro users, as the commands in pro have been augmented
  and expanded.
  
  If (like me) you upgraded from AMOS to AMOS Pro and had a look at the 
  speech commands, you will be surprised to find that François has added 
  a few additional commands.  The first command I will be looking at is the
  TALK MISC command.  Its syntax is as follows....
  
  [33mTALK MISC volume,frequency[0m
  
  Volume means that you can adjust the volume of the speech and frequency 
  means that your speech can sound like a deep growl to a half-chipmunk
  sound.  The volume option can be from 0 (silence) to 63 (full boar).  
  Meanwhile the frequency can be from 5000 (unintelligible growl) to a
  maximum of 25000 (a half-chipmunk voice)
  
  Somehow, in the development of AMOS pro, there was a survey sent out to
  ask what commands were required. and one of these was the ability to 
  animate a "Talking mouth" (?)  These commands were included...
  
  [43mMOUTH WIDTH[0m
  
  Which returns the width of the animated mouth
  
  [43mMOUTH HEIGHT[0m
  
  This returns the height of the animated mouth.  Both commands will give a
  negative result if the speech is finished and both are measured in pixels
  
  and finally:
  
  [43mMOUTH READ[0m
  
  This function waits for a mouth movement and then reads the values
  directly into the MOUTH WIDTH and MOUTH HEIGHT functions.
  
  *************************************************************************
  
  [33mGENERAL AMOS COMMANDS[0m
  
  And now, the general AMOS sound commands that were not included in part 1
  
  In part one we showed you the use of the MUSIC command to play AMOS music
  banks, but we have a few more thing in our box of tricks than just the
  one command.  The first of these commads are the VOICE instruction.  This
  allows you to play one or all of the sound channels.  the syntax for this
  is:
  
  [33mVOICE bitpattern[0m
  
  an example of this would be in the following text
  
  Music 1
  Voice 9 (this turns on both left channels)
  
  Samples can be loaded into a special data and can be played using the SAM
  RAW command.  This command has three options and this is:
  
  [33mSAM RAW channel,sample start,frequency[0m
  
   Change channel to the voice number that you want the sample to be played
  from, sample start to the starting address of the sample and frequency to
  the frequency you want the sample to play.  (simple huh?)
  
   If you don't wish to use any external sample file then you can use the
  Amys sound chips to generate the sounds.  The PLAY command is like the 
  bell and shoot commands mentioned and this has the syntax:
  
  [33mPLAY Channel,note,duration[0m
  
  channel means the same as bitpattern in the VOICE command.  NOTE means
  the frequency of the note.  It can be from 1 (booming) to 95 (a "ping"
  sound) and duration is the length in 50ths of a second (if you live in
  America this will change to 1/60th of a second).  If you want to use
  sound samples for the play command then the SAMPLE command is just what
  the doctor ordered.  This has the syntax
  
  [33mSAMPLE sample to voices[0m 
  
  the sample can be anything up to the limit of the number of samples used
  in the particular sample bank.
  
  So far I have not mentioned how to change the ADSR (attack, decay,
  sustain, release) or the envelope of the built in sounds in AMOS or
  or your own predefined waveform.  To change the envelope the SET ENVEL
  command has the following syntax:
  
  [33mSet Envel Wave no, Phase no to duration, volume[0m
  
   Wave number means either of the two pre-defined waveforms (0 = NOISE,
  and 1 = SINE).  Phase number refers to one of seven individual sections
  of the original waveform and is expressed in units of 1/50th (or 1/60th
  of a second).  basically it means how slow you want it to play, and
  and volume is pretty straightforward.
  
  But is there a way of defining your own waveforms?  in the words of
  former Curiosity Show and regular Hey Hey its saturday presenter, Deane
  Hutton... "Im Glad you asked!".  in fact, there is and its with the
  SET WAVE command and the syntax for this is:
  
  [33mSET WAVE number, shape$
  
  change the number to the number of the waveform that you wish to design.
  Please note that waveforms 0 and 1 cannot be altered so it is suggested
  that you use waveform 2 onwards. the Shape$ is basically the defined
  waveform which you created.  The values of the waveform can be from -128
  to 127 - But hang on, string variables can only have POSITIVE numbers
  (ie. from 0 to 255) but for this we have to convert the numerical value
  simply by adding 256 to the chr$ code.  This is how its done..
  
  For X= -128 to 127:W=X
  If x< 0 then add W,256 (or for easy AMOS users, W=W+256
  A$=A$+chr$(W)
  Next
  
  to use the waveform we use the WAVE command, which has the same syntax as
  the Sample command (IE. WAVE 2 to 15)
  
  the NOISE TO command can be used in the same way for the noise waveform.
  
  What if you no longer require the waveform any more?  simply use the DEL
  WAVE command to delete the waveform this has the syntax:
  
  DEL WAVE x
  
  where x can be from 2 onwards (remember you cannot delete the pre-defined
  waveforms)
  
  And finally, did you know that your power LED can also be used as a band-
  pass filter which allows you to hear the sounds and music clearer?  Thats
  right, and this can be done with the [1mLED[0m commands, and
  there are of course two commands:
  
  [43mLED OFF[0m
  
   This turns off not only the power LED but also the filter while:
  
  [43mLED ON[0m
  
  turns on the filtering and the power LED.
  
  *************************************************************************
  
  [33mTHE END OF PART 2[0m
  
   Well, this marks the end of this section of the series, if you would
  like to try out any of these commands you will find in this directory
  (and in the AMOSProUsers directory) a couple of example programs.  Both 
  listings have been tested and will run without any problems.  The AMOS
  Professional specific commands can be found in the AMOS Pro Users only
  directory and all the general commands can be found in the main
  directory.  In the next Megadisc I will be looking at the menuing
  commands (sorry Easy AMOS owners, but don't feel left out I will be
  showing a few ways around this.)
  
  So until the next Megadisc:
  
  BCNU
  
  © 1994 Bruce Laing for Megadisc
  
  28-2-1994
  

    [32m39  +-+  39  +-+  39  +-+  39  +-+  39  +-+  39  +-+  39  +-+  39  [0m
  
