Programmer Guide/Command Reference/LOAD: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
The <code>LOAD</code> command is used to load macro code, spu code and sound files, making them available for use in the {{STX}} programming environment.
The <code>LOAD</code> command is used to load macro code, spu code, and sound files, making them available for use in the {{STX}} programming environment.


;Note: Macros, signal processing units and sound files must be loaded before they can be used!
;Note: Macros, signal processing units and sound files must be loaded before they can be used.


;See also: [[Programmer_Guide/Introduction#Application Environment|Application Environment]], commands [[../UNLOAD|UNLOAD]] and [[../LIST|LIST]], macros [[Programmer_Guide/Macro_Library/SOURCEFILE|SOURCEFILE]] and [[Programmer_Guide/Macro_Library/BSF|BSF]]
;See also: [[Programmer_Guide/Introduction#Application Environment|Application Environment]], commands [[../UNLOAD|UNLOAD]] and [[../LIST|LIST]], macros [[Programmer_Guide/Macro_Library/SOURCEFILE|SOURCEFILE]] and [[Programmer_Guide/Macro_Library/BSF|BSF]]
Line 50: Line 50:
;<var>srate</var>
;<var>srate</var>


:The sampling rate in Hertz (>= <code>1</code>).
:The sampling rate in Hertz (&ge; <code>1</code>).


;<var>channels</var>
;<var>channels</var>


:The number of channels (>= <code>1</code>).
:The number of channels (&ge; <code>1</code>).


;<var>code</var>
;<var>code</var>
Line 62: Line 62:
;<var>start</var>
;<var>start</var>


:The header size (>=0); This is the offset of first signal sample from the beginning of the file.
:The header size (&ge; 0); This is the offset of first signal sample from the beginning of the file.


;<var>/R|W</var>
;<var>/R|W</var>

Revision as of 13:59, 5 May 2011

The LOAD command is used to load macro code, spu code, and sound files, making them available for use in the STx programming environment.

Note
Macros, signal processing units and sound files must be loaded before they can be used.
See also
Application Environment, commands UNLOAD and LIST, macros SOURCEFILE and BSF

LOAD SOURCECODE

LOAD SOURCECODE file1 [ file2 ... ] [ /N /S /Z /C /D=ppvar ...]
Load all source code from the specified source files (file1 etc). The command loads all sections containing source code, preprocesses them and adds them to the shell environment.
Note: An argument can also be the name of a simple table item containing the source code.
/N (no log)
If specieifed, not output is written to the log window.
otherwise: error and warning messages are written to the log window.
/S or /? (silent)
If specified, errors will generate warning messages rather than error messages
/Z (no owner)
If specified, no owner is assigned to the source files
otherwise: the shell executing the command is the owner of the source files (see UNLOAD /U/O)
/C (conditional)
If specified, a sections of a source file are only loaded, if the source file is not already loaded
otherwise: the sections of a source are always loaded
/D=ppvar (define)
Define the prepecessor variable ppvar.


LOAD SOURCEFILE srcfile libfile /M [ /N /S /D=ppvar ...]
Add all code sections of the source file srcfile to the (new or existing) compressed STx library libfile. The sections of srcfile are not loaded! This command can be used to create a library file containing the source codes from multiple source files. STx library files can be loaded like normal source files.
/M (make library)
This option is mandatory.
/N, /S, /D
see descriptions above

LOAD SOUNDFILE

The LOAD SOUNDFILE command loads a sound file into the shell's sound file list and make it the current sound file. Once you have finished with a sound file, you can unload it with the UNLOAD command.

LOAD SOUNDFILE soundfilepath [ srate channels code start ] [/R|W] [ /S ]

Load a sound file or activate an already loaded sound file (make it the current sound file). The access-mode options (/R|W) are only processed if the sound file is not already loaded. If the parameters srate, channels, code and start are specified, this file is treated as a non-standard-format sound file.

soundfilepath
The name of the file to open (including a relative or absolute path).
srate
The sampling rate in Hertz (≥ 1).
channels
The number of channels (≥ 1).
code
The sample code. The following sample codes are supported: PCM8, PCM16, PCM24, PCM32 or FLOAT (32 bit).
start
The header size (≥ 0); This is the offset of first signal sample from the beginning of the file.
/R|W
Specify whether the sound file should be opened in read-only (/R) or read/write mode (/W). The default mode is read/write.

/S

If specified, errors will generate warning messages rather than error messages. See The Silent Flag for details.

LOAD SOUNDFILE index|name /Index|Select [ /L ]

Activate (make it the current sound file) a loaded sound file, identified by its (zero-based) index or name. This command can be used in macros to check if a sound file is already open/loaded.

/L
If specified, errors will generate warning messages rather than error messages. See The Silent Flag for details.

LOAD SOUNDFILE soundfilepath srate channels code type /Create [ /S ]

Create and load a new (empty) sound file (make it the current sound file). See LOAD SOUNDFILE above for a description of the parameters soundfilepath, srate, channels and code. Note that this command will fail if the sound file soundfilepath already exists.

type
The file format. The following formats are supported: WAVE (Windows WAVE format), ST5 (old S_TOOLS 5 file format) or BINARY (raw format, without header).
/Create
This option is mandatory.

/S

If specified, errors will generate warning messages rather than error messages. See The Silent Flag for details.

LOAD SOUNDFILE table /Directory [ /Load ] [ /S ]

Attach a directory table table to a sound file. Only one table can be attached to a sound file. The table must be created with the /Directory option (e.g. with: NEW TABLE * /Directory). The directory table of a sound file can be accessed by all shells! Use the option /Load if STx should try to load the directory stored in the sound file (only for files created by S_TOOLS 5).

/S
If specified, errors will generate warning messages rather than error messages. See The Silent Flag for details.

Information about the currently active sound file is stored in the variables CSF (= fullfilepath) and CSFH (= srate channels samples code type mode). If no sound file is active, the variable CSF is empty. See Shell Environment for more details.Sound files opened with write access (/Write) cannot be shared with other users or processes.The sound file management is normally performed by the application STx . All other applications should use the STx APPMSG interface to attach or select sound files.The script library BSF implements a set of functions for using sound files and segments in scripts.

Navigation menu

Personal tools