Programmer Guide/General Descriptions/Segment Expressions: Difference between revisions
(initial import) |
m (1 revision: Initial import) |
(No difference)
|
Revision as of 17:31, 18 November 2010
Segment Expressions
S_TOOLS-STx uses a special syntax to address a segment of a sound file. The syntax allows for the mixed use of segment names and time values in a complex expression known as a "segment expression". Segment expressions can be used in all commands and dialogs where a signal segment (or position/duration) can be specified (exceptions are described in the Command Reference). In dialogs, the supported value formats/types are always described in the control/dialog caption.
Labels
A label expression is a position in a sound file (e.g. the begin/end of a segment) or the duration of a segment. A label expression may consist of a sign (+/-) and one or more values formatted as described below and combined with the operators + (add) or – (subtract). If a label expression contains blanks, it must be quoted when used as an argument.
label expression | explanation |
segmentname:B | start time of segment segmentname |
segmentname:E | end time of segment segmentname |
segmentname:L | duration (length) of segment segmentname |
numberS | time in seconds |
numberMS | time in milliseconds |
number | number of samples |
Segments
A segment expression addresses a part of a soundfile with a non-zero duration. It can consist of (1) a segment name or (2) two label expressions specifying the beginning and end or (3) two label expressions specifying a position and the duration.
segment expression | explanation |
labelexpression_labelexpression | (beginning and end) |
labelexpression_+labelexpression | (beginning and duration) |
labelexpression_-labelexpression | (end and duration) |
Examples
0_4s
addresses 0 samples to 4 seconds
SegmentA:B+100_+10s
addresses 100 samples after the beginning of SegmentB for a duration of 10 seconds
SegmentB
addresses SegmentB
SegmentA:B_SegmentB:E
addresses the beginning of SegmentA to the end of SegmentB
SegmentB:E_-100ms
addresses 100 milliseconds before the end of SegmentB to the end of SegmentB
Notes: For some expressions, the values number%
(percentage of the full duration) and number%%
(thousandths of the full duration) can be used, but only if the 'full signal' is available/defined (e.g. for envelopes of sequence signals).A segmentname
can only be used if a sound file or an audio-element of an XML-file is involved in the expression evaluation.Segment names are case sensitive!