home *** CD-ROM | disk | FTP | other *** search
-
- PLAY590 VERSION 1.0 RELEASE DOCUMENTATION
-
- Written November 13th 1990 by Mark Everingham
-
-
- INTRODUCTION
-
- The quality of sound obtainable from the Amiga using a sound-sampler
- is truly amazing, often being completely indistinguishable from the real
- thing. However, the main problem with sound sampling is that it does
- require huge amounts of memory. At a reasonable sample speed, say 16Khz,
- the maximum length sample on an unexpanded A500, is about half a minute,
- and even with 3Mb of ram, two minutes is about the limit. I recently (and
- so it would seem from letters in Format did many readers) bought an A590
- hard-disk, and imagined just what could be done with all that disk-space.
- Imagine, with a 20Mb hard-disk, you could have a continuous sample over
- twenty minutes long, and with a 40Mb drive you could digitize a whole
- album in one go! With these thoughts in mind, I wrote Play590, which
- allows you to play mono or stereo samples at speeds up to 32KHz from any
- AmigaDOS file. Although the program works best with a hard-disk, as
- reflected by the name, Play590 will also work with floppy-disks at speeds
- up to about 12KHz, and can be used to play samples from fast ram by using
- any standard ram-disk driver, for example RAM, RAD or VD0. There are no
- limits imposed on the length of the samples to be played other than the
- capacity of the storage device they are kept on. By sampling chunks of
- sound using a standard sampler package, then saving to disk and linking
- together using the AmigaDOS JOIN command, samples of theoretically
- infinite length can be created. I currently have two 6Mb samples on my
- hard-drive!
-
- Amazingly, Play590 is also very friendly from a multi-tasking point
- of view. Playing from an A590 hard-disk at 16Khz the program only uses
- about 2% processor time although floppy-disk access requires considerably
- more processor time. If you boost Play590's priority to above zero, you
- can fiddle with workbench, generate a few mandelbrots and even load
- programs off the same hard-disk Play590 is using while enjoying
- continuous uninterrupted music. Doing a bit of DTP with PageSetter II
- while Handel's water-music plays away in the background, or drawing a
- mandelbrot set to the tune of J.M Jarre's "Oxygene" is a a pretty wild
- experience (even if I do say so myself)...
-
-
- GENERAL INFORMATION
-
- (i) Sample File Formats
-
- Play590 will work correctly with samples created using any
- sound-sampler package saved in the RAW (non IFF) format. If your sampler
- cannot generate RAW files, you can still use IFF 8SVX files, as you
- probably won't be able to hear the IFF header information as it is so
- short. You can in fact play any file, for example the CLI commands,
- although the results are not guaranteed to be very musical!
-
- (ii) Mono and Stereo Samples
-
- Play590 will play samples in either mono or stereo at any speed up
- to 32767Hz. On a hard-disk it is quite possible to play stereo samples,
- at full speed, but on floppies, the maximum I've achieved successfully is
- 12Khz in mono. Use of a good disk-optimiser such as B.A.D may enable
- higher speeds to be achieved. To play samples in stereo, you must have
- the left channel stored in one file, for example "Music.L" and the right
- channel stored in another, for example "Music.R". Both samples in stereo
- are played at the same speed. If you want to play more than two samples
- at a time, for example if you have a four-track recorder, then you can
- just run two copies of Play590, one for each pair of samples.
-
- (iii) Playing Samples from Memory
-
- Play590 can be used in the same way as a conventional sample-player
- such as BMP by copying the sample files you want to play into a ram disk.
- This also allows you to play samples which will not fit in chip ram.
-
- (iv) Memory Requirements
-
- Because Play590 only stores a small amount of a sample in chip ram
- at one time, it is quite economical on memory, working fine on an a 512k
- Amiga. You can specify the size of the chip ram buffer which Play590 uses
- for its samples, and the total chip ram used can be calculated as
- follows:
-
- Chip ram used = buffersize * 2 * (2 if stereo)
-
- In order to keep the sample playing perfectly smooth, Play590 uses
- double-buffering techniques, so the buffersize must be multiplied by two
- to find the total memory used. If you are playing stereo samples, the
- memory needed is doubled.
-
- Play590 defaults to a buffersize of 32Kb, thus using 64Kb to play
- mono samples, or 128Kb for stereo samples. You can specify a buffersize
- between 0 and 64Kb, but bear in mind that the smaller the buffersize, the
- more processor time the program uses. I have found through practice that
- 32Kb is a good compromise between processor and memory usage.
-
- (v) Audio Channel Allocation
-
- When playing a mono sample, Play590 uses the first audio channel it
- can find, which may be either left or right. When playing stereo samples,
- or mono samples in the pseudo-stereo mode, Play590 uses a left & right
- channel pair. If it cannot allocate the correct channels, an error will
- be generated.
-
-
- RUNNING PLAY590
-
- Play590 may be run either from the CLI, Workbench, or in a
- script-file. If you like, Play590 can open a title window so that you can
- abort the playing of a sample, or you can choose to have no window,
- making Play590 suitable for use in a demo of your own making. Play590 can
- also be run as a background task allowing the CLI or Shell window to be
- closed after running it.
-
-
- CLI AND SCRIPT-FILE USAGE
-
- Play590 has a number of special options which can be specified from
- the CLI or in a script-file using options of the form "-<option>[value]".
- You can specify most of these options anywhere in your command-line, in
- any order, before or after the filenames of your samples and options may
- be in either upper or lower-case. The only restriction imposed is that
- the file-name of your samples must not begin with a hyphen ("-")
- character. The recommended format of the command-line is as follows:-
-
- Play590 <samplename1> [samplename2] [option 1] .. [option n]
- or
- Play590 [option 1] .. [option n] <samplename1> [samplename2]
-
- If the file-names of your samples include spaces, you can enclose
- the names in quotes ('"'). As I have mentioned, Play590 can also be run
- in the background so that you can close down your CLI/Shell or terminate
- your script-file. You can either use the Workbench 1.3 (not 1.2) RUN
- command or the RUNBACK command to run Play590 in the background. This is
- shown below.
-
- Standard RUN command: RUN >NIL: Play590 <samplename1> etc..
- or: RUNBACK command: RUNBACK Play590 <samplename1> etc..
-
- I would personally recommend using the RUN >NIL: command, since it
- is a standard AmigaDOS command, which nobody ever seems to use!
-
- (i) CLI Command Line Options
-
- -S<speed> (1-32767) The -S (SPEED) option is the most important of
- the options, being used to specify the speed at
- which your samples will be played back. The
- speed is specified in Hertz - If your sample was
- recorder at say 20KHz, use 20000, or if at
- 1.23Khz, use 12300. If you do not specify a
- speed option in your command-line, the default
- speed of 16Khz will be used.
-
- -W The -W (WINDOW) option is used to specify that
- you DO want Play590 to open a title window. This
- window just shows that Play590 is running, and
- can be used to stop a sample playing by clicking
- on the close gadget. By default, Play590 does
- not open a window when run from the CLI since
- this is more suitable be script-file usage. Be
- warned though that if you don't open a window,
- there is no way of aborting a sample.
-
- -R<repeats> (0-32767) The -R (REPEATS) option is used to specify how
- many times Play590 will play your samples. If
- you specify a value between 1 and 32767, Play590
- will play the samples that number of times and
- then stop. If you specify a value of zero,
- Play590 will repeat the samples forever, or
- until the close gadget on its window is
- activated. By default, Play590 plays the samples
- once then stops.
-
- -V<volume> <0-64> The -V (VOLUME) option is used to specify how
- loud Play590 plays your samples. Zero (0) is
- inaudible, and 64 is maximum loudness. The
- default volume is 64.
-
- -F The -F (FILTER) option enables you to switch the
- low-pass filter (power light) off on a post
- A1000 Amiga, improving the sound quality on
- certain types of sounds. If you do not specify
- this option, the filter will be left on.
-
- -B<buffer> <1-65535> The -B (BUFFER) option specifies how much chip
- ram Play590 will use for each of its sample
- buffers, as discussed earlier. You specify the
- value in bytes, with 1 being 1 byte (not
- recommended!) and 65535 being 64Kb. The default
- value is 32Kb (32768 bytes).
-
- -P<priority> (-128..127) The -P (PRIORITY) option specifies the priority
- at which the Play590 program runs, between -128
- and +127. This option is equivalent to running
- Play590 and then using the CHANGETASKPRI
- command. The default priority is that of the
- current CLI, which is usually zero. If you want
- to make sure that Play590 is never interrupted,
- you can set the priority above zero (10 is a
- good value). It is unadvisable to use values
- above +10 or below -10, as this is seriously
- unfriendly to the operating system.
-
- -2 The -2 (STEREO) option lets you play a single
- sample as if it were a stereo sample, like
- playing a mono cassette on a stereo cassette-
- player. This option makes Play590 use two audio
- channels - a left and right pair, and play the
- same sample on both channels. It does however
- use more processor time than playing in true
- mono.
-
- <samplename1/2> The only other command-line arguments are the
- names of the sample files themselves. Usual
- AmigaDOS file-name restrictions apply.
-
- (ii) Example Command Lines
-
- Play590 "DF0:MySample" -S28000
- - Play the mono sample "DF0:MySample" once at 28KHz.
-
- RUN Play590 "DH1:Sample.L" "DH1:Sample.R" -s18000 -r0 -w -p10
- - Open the Play590 window and play the two samples specified as a
- stereo pair at the speed of 18KHz. Keep repeating the samples until
- the user closes the Play590 window (or the world ends...). Boost
- Play590's priority to +10 to make sure the samples are never
- interrupted.
-
- RUN Play590 "RAM:MonoSample" -S12000 -2 -F -V32
- - Play the mono sample as if it were a stereo sample, on a pair of
- left and right channels. Turn the low pass filter off to improve the
- sound quality, and play the sample at half volume.
-
- Play590 "Sample"
- - Play the (imaginatively titled) sample "Sample" using all the
- default settings.
-
-
- WORKBENCH USAGE
-
- For those who go weak at the thought of entering the untold horrors
- of a CLI or Shell window, Play590 can also be run from the Workbench. You
- can use of the CLI command-line options by using the Workbench INFO tool,
- and can choose the samples you want to play either by specifying their
- names using the INFO tool again, or by shift-clicking with the Play590
- icon.
-
- (i) Specifying Sample File-Names
-
- In order for Play590 to run, you must specify one or two samples for
- it to play. There are three ways of doing this.
-
- (a) Using the Workbench INFO tool
-
- Using the Workbench INFO tool, add a tooltype entry (select the ADD
- tool) as shown below:-
-
- SAMPLE1=<samplename1>
- or: SAMPLE2=<samplename2>
-
-
- You replace <samplename> with the filename of a sample. Note that
- you cannot use quote characters to enclose the name, but can use spaces
- in the name without them. As with all other tooltype options, you must
- use UPPER CASE, so "SAMPLE1" will work, but "sample1" will not.
-
- If you are playing only a mono sample, you can use either SAMPLE1 or
- SAMPLE2, it does not make any difference which. When playing two samples
- in stereo, SAMPLE1 is the left sample and SAMPLE2 the right sample.
-
- (b) Shift-Clicking with Sample Icons
-
- The second way to specify samples to be played by Play590 is to
- shift-click on an icon representing a sample. This method only works if
- (a) your samples have an icon, and (b) the icon is of the type PROJECT.
-
- To play a mono sample, just click on the sample icon, then double-
- click on the Play590 icon while holding down the <SHIFT> key.
-
- To play two stereo samples, click on the left sample icon, then
- click on the right sample icon while holding down <SHIFT>, then double-
- click on the Play590 icon while still holding down <SHIFT>. Note that for
- the samples to play on the correct channels, you must click on the left
- sample first.
-
- (c) Setting a Sample Icon's Default Tool
-
- The third way to play a sample with Play590 is to set the default
- tool of a sample, although this method may only be used for playing mono
- samples. Again, you must have an icon for a sample, and the icon must be
- of type PROJECT.
-
- Using the Workbench INFO tool, change the "Default Tool" setting of
- the sample icon to "DF0:Play590/Play590" or whatever name you have given
- to the Play590 program on your floppy or hard-disk. Select SAVE, then to
- play your sample, just double-click on the sample's icon.
-
- (ii) Workbench Tool-Type Options
-
- When running Play590 from the Workbench you can use all the options
- which are available from the CLI command-line. This is done using the
- Workbench INFO tool. To specify an option, you just ADD a tooltype entry
- to an icon. You can specify these tooltype options either in the Play590
- icon itself, or in the icon of a sample to be played. Tooltypes entered
- in the Play590 icon may be regarded as default selections, and will be
- overridden by tooltypes specified in a sample icon. Here is an example,
- of setting the default speed of the Play590 tool, and the specific speed
- of an individual sample.
-
- Click on the Play590 icon, and select the INFO option from the
- Workbench menu. Click on the ADD gadget, and type in "SPEED=20000".
- Select the SAVE gadget to finalize your choice. This specifies that when
- Play590 is run from its icon, by default it will use a speed of 20000Hz
- or 20KHz.
-
- Now click on a sample icon, and repeat the process, adding a
- tooltype entry "SPEED=25000". SAVE this, and try playing this sample. You
- will notice that the sample plays back at 25KHz not 20KHz, since the
- tooltype in the sample overrides the tooltype in the Play590 icon. If you
- now delete the tooltype from the sample icon, it will then play at 20KHz
- again.
-
- Note that if you don't specify any tooltypes, the global Play590
- default values are used, and these values are included below. Remember
- that you must use UPPERCASE for each option.
-
- SPEED=<speed> (1-32767) Set the sample playback speed: See "-S"
- option. Default value: 16000.
-
- WINDOW=<ON|OFF> Switch the Play590 window on or off: See
- "-W" option. Default value: ON.
-
- REPEATS=<repeats> (0-32767) Set the number of repeats: See "-R" option.
- Default value: 1.
-
- VOLUME=<volume> (0-64) Set the playback volume: See "-V" option.
- Default value: 64.
-
- FILTER=<ON|OFF> Switch the low-pass filter on or odd.
- Default value: ON.
-
- BUFFER=<buffer> (1-65535) Sets the sample buffer size. See "-B"
- option. Default value: 32768.
-
- PRIORITY=<-128..+127> Sets priority at which Play590 runs. See
- "-P" option. Default value: 0.
-
- MODE=<STEREO|MONO> Chooses either (pseudo-)stereo or mono
- playback for single samples. See "-2"
- option. Default value: MONO.
-
- SAMPLE<1|2>=<samplename> These options specify the files to be
- played by Play590 when the tool is double-
- clicked by itself. You must delete these
- entries if you want to play other samples
- by shift-clicking. There are no default
- settings.
-
-
- PLAY590 ERROR MESSAGES
-
- When something goes wrong while Play590 is trying to run (as it
- inevitably will at some point), the program will generate an error
- message. If you run the program from the CLI, the error message will be
- printed and the program will terminate. When run from Workbench, Play590
- will display the error message in the title-bar of the Workbench screen.
- If you have run Play590 in the background, which means that no print-out
- is possible, the program will just terminate with a returncode of 20
- indicating an error serious enough to stop a script-file executing. These
- error messages and their meanings are listed here.
-
- "Bad arguments" When run from a CLI, you have
- specified an illegal number of
- arguments, or an option which Play590
- does not recognize. When run from the
- Workbench, this error indicates an
- error in a tooltype entry.
-
- "Illegal argument value" You have specified a value for an
- option in your command-line or
- tooltypes which is outside the valid
- range.
-
- "No sample files specified" You did not specify any sample files
- to be played. For example, 'Play590',
- or running from Workbench with no
- icons selected.
-
- "Unable to open intuition library" Play590 could not open the ROM
- intuition library. This either
- indicates a lack of memory, or serious
- problems with your Amiga!
-
- "Unable to open window" Play590 could not open its title
- window. This usually indicates a lack
- of free chip memory.
-
- "Unable to open sample file" A sample file which you specified in
- your command-line or tooltypes could
- not be opened. This is probably a
- typing error or incorrect pathname.
-
- "Unable to open audio device" Play590 could not open the audio
- device or allocate enough audio
- channels to play your samples. Either
- another program is already using too
- many of the Amiga's four audio
- channels, or a crashed program has not
- released its channels for re-use.
-
- "Unable to open icon library" This error should only occur when
- Play590 is run from the Workbench. It
- indicates that the disk-based icon
- library could not be opened. For
- Play590 to work from Workbench, the
- file "icon.library" must be in the
- current "LIBS:" directory. However,
- since Workbench itself needs the icon
- library in order to run Play590, I
- would be surprised if you ever come
- across this error!
-
- "Out of memory" Anyone care to hazard a guess at what
- this one means? If you don't see this
- error once in a while, I'll eat your
- hat.
-
-
- And that's it! I hope you find Play590 fun, or useful, or whatever.
- If you find any bugs, can suggest any improvements, or are just feeling
- generally well-disposed (note, not to people Douglas), write to me, and a
- PD disk will guarantee 0% a reply.
-
- Mark Everingham
- 17 Collingwood Road
- Redland
- Bristol
- BS6 6PD
-