Amos Professional Manual  Contents  Index

Samples


Changing a sample bank
Digital sound samples are normally stored in memory bank 5, but there are no restrictions on assigning other banks to hold samples.

SAM BANK
instruction: change the current sample bank
Sam Bank bank number

The SAM BANK instruction dictates that all future SAM PLAY commands will take samples from the newly specified memory bank. If several parallel banks are set up, AMOS Professional can swap between them with a simple call to the SAM BANK command. To hear all of the samples used in one of the AMOS Professional example games, load the following file and listen to what is stored in the memory bank, using this routine:

E> Load "AMOSPro_Productivity:Wonderland/Wonderland Samples.Abk"
   Sam Bank 6
   For A=1 To 5
    Print "Sample number ";A
    For B=1 To 3
     Sam Play A
     Wait 20
    Next B
   Next A

Playing a sample from memory
Samples do not have to be held in a special bank. In fact, a "raw" sound sample can be stored anywhere in the computer's memory using BLOAD, and then played with the following command:

SAM RAW
instruction: play a raw sample from memory
Sam Raw voice,address,length,frequency

SAM RAW plays a raw sample, and can be used to scan through any program or sound library discs, searching for a sample that matches the given parameters.

The voice parameter has already been explained. Address refers to the location address of the sound sample, which is normally inside an AMOS Professional memory bank, but can be anywhere. The length parameter confirms the length in bytes of the sample to be played. Finally, frequency dictates the playback speed of the original sample, given in Hertz.

A typical raw sample command looks like this:

E> Reserve as work 10,21480
   R$="AMOSPro_Examples:Samples/Mixture.Abk"
   Bload R$,Start(10)
   Sam Raw 15,Start(10),length(10),3000
Back    Next
08.02.03