SAM LOOP ON
SAM LOOP OFF
instructions: toggle repetition of a sample
Sam Loop On
Sam Loop Off
There are many instances where a single sample needs to be repeated over and over again. SAM LOOP ON ensures that all sound samples which follow this instruction will be looped continuously. To turn off the looping facility, simply call the SAM LOOP OFF command. Add a SAM LOOP ON instruction to the last example, before the SAM RAW command, and hear the result.
Double buffered sampling
Samples are ideal for generating realistic sound effects directly from AMOS Professional
programs. However, as the samples get longer, their memory requirements become prohibitive!
If sound samples are used sparingly, several seconds of perfect audio effects can be conjured up
by an unexpanded Amiga. Unfortunately, continuous soundtracks would seem like an
impossibility, with one minute of digital sound consuming almost a megabyte of data!
Owners of the basic Amiga machine will be forced to use most memory for routines and screens, but AMOS Professional can offer hard drive users an alternative sampling technique, allowing the entire disc to be treated as "virtual" memory. This means that instead of loading an entire sound sample as a single block, it can be played a section at a time directly from disc. The only limitation to the size of such samples is the amount of free space in the storage facility.
The principle of Double Buffered Sampling is very similar to the display system employed by the screen Double Buffer. It works by storing two sample banks in memory, the physical and the logical sample banks.
The physical bank holds the sample which is currently being played through your loudspeakers, and the logical bank contains the sample that is being loaded from disc.
At the beginning of a program, the physical and logical banks are loaded with the first two blocks of sample data. The physical sample can then be played with a SAM RAW command, and whenever the physical bank runs out of information, the banks are swapped over to create a seamless audio signal. The logical bank now becomes the physical bank, and vice versa.
AMOS Professional provides three powerful commands used to control this process directly. SAM SWAP activates double buffered sampling, SLOAD loads a specific section of the sample file in memory, and the SAM SWAPPED function checks for the need to load a new block of sample data.
Here is the procedure for using double buffered sampling: