Programmer Guide/Macro Library/Kernal/BSignal: Difference between revisions

From STX Wiki
Jump to navigationJump to search
 
(No difference)

Latest revision as of 09:22, 7 March 2018

BSignal

BSignal Class Members

The BSignal class implements the following member functions.

CONSTRUCT mode ; process ; profile

Usage:
mode processing mode (NORMAL or BATCH)
type type of process or name of signal processing object
profile name of signal processing settings profile
result:

0 for success or non-zero error code

description:

Initialize the type and mode processing. If mode is set to NORMAL, errors occurring during configuration or processing are displayed in a dialog box, which must be closed by the user before the function returns. If mode is set to BATCH, only the processing progress is displayed. The processing type must select an internal signal processing method (see table below) or it must be the name of an instance which should be used to perform the signal processing.


Internal signal processing methods

type description
DELETE delete signals; only possible if source signal is stored in a soundfile
COPY copy signals
MOVE move signals; copy to target and delete from source; only possible if source signal is stored in a soundfile
AMPLIFY amplify signals
NORMALIZE normalize amplitude of signals
AGC automatic gain control
BANDPASS lowpass, highpass, bandpass or bandstop filter
SPECTRUM filter signal with a spectrum
DENOISE noise reduction filter
IRRELEVANCE masking filter

If the processing type is the name of an instance defined by the user, the user is responsible to creating (before BSignal) and to deleting (after BSignal) the instance. The instance must implement the following members:

usage: type PREPARE srate
srate samplingrate in Hz
result:

'rc tf'

description:

This function is called before the first signal is processed. It can be used to initialize the instance. The returns rc must be 0 for successful initialization and any non-zero number to indicate an error. The time factor tf must be set to 1 if the signal length is not changed during processing and to the ratio 'target-length / source-length' if the processing changes the signal length.


usage: type RUNSPU inwave outwave bsignal barpos barsize'
inwave input wave item (mono)
outwave output wave item (mono)
bsignal the name of the BSignal-instance calling the function
barpos starting position of progress-bar
barsize size of progress bar
result:

rc

description:

This function is called for each mono source-signal. The applied signal processing method can be any process taking one mono input signal and creating on mono output signal. To display the progress the following function call can be used inside this function: 'bsignal SETBAR barpos+barsize*done'. Where done is a number between 0 and 1. The return value must be set to 0 if the signal processing was finished successful and to any non-zero number to indicate an error.


usage: type UNPREPARE
result:

none

description:

This function is called after the processing of the last signal. It can be used for cleanup of items used during signal processing.

DESTRUCT

result:

none

description:

Remove all internal created shell items

RUN

result:

0 for success or non-zero error code

description:

Perform the signal processing. Before run can be called, all configurations must be performed.

SETBAR pos

usage:
pos relative bar position (0 .. 1)
result:

none

description:

This function is used by the internal functions to update to progress bar. It can also be called by the RUNSPU member of the signal processing instance.

SetSource

Assign the wave item to the source signal.

Usage:

inst SetSource wave

Parameters:
wave
The name of a wave item to use as the source.
Result:

0 for success or non-zero error code.

Assign the specified audio set segment to the source signal.

Usage:

inst SetSource aset aseg channel

Parameters:
aset
An audio set reference.
aseg
A segment id, segment reference or segment expression.
channel
The channel index (e.g. 1) or 0 or * for all channels.
Result:

0 for success or non-zero error code.

Assign the all segments stored in the table asegtab to the source signal. Each segment must be a part of the audio set aset.

Usage:

inst SetSource aset asegtab channel

Parameters:
aset
An audio set reference.
asegtab
A simple table containing segment ids, segment references or segment expressions (one per entry).
channel
The channel index (e.g. 1) or 0 or * for all channels.
Result:

0 for success or non-zero error code.

SetTarget

Assign the target signal and configure output signal generation and output segment creation.

Usage:

inst SetTarget aset ; aseg ; channel ; mode ; seg1 ; seg2

Parameters:
aset
The audio set reference.
aseg
The id, reference or expression of the target segment or * if output should be appended to audio set. Note that the end of any segment expression or segment name is used as the target, not the beginning.
channel
The channel index (1, 2, ..); 0 or * for all channels. The channel count must be the same as for the source signal.
mode
The output mode. The following keywords are supported: REPLACE, MIX or INSERT.
seg1
Copy source segment info to target(s). The following keywords are supported: NONE, NAME or ALL.
seg2
The segment name for the whole output signal.
Result:

0 for success or non-zero error code

SETTEXT text

usage:
text text to be displayed in the progress dialog
result:

none

description:

This function is used by the internal functions to display status, progress and errors. It can also be called by the RUNSPU member of the signal processing instance.

Navigation menu

Personal tools