OpenMusic

Visual Programming | Computer-Assisted Composition

OpenMusic Reference

Prev| | Next


arithm-ser

arithm-ser

(series module) -- generates an arithmetic series

Syntax

arithm-ser begin end step &optional nummax

Inputs

name data type(s) comments
begin a number the starting point of the series
end a number the upper limit of the series
step a number the increment of the series
nummax a non-zero integer optional; the maximum number of terms produced. Defaults to 536870911

Output

output data type(s) comments
first a list  

Description

Returns an arithmetic series. An arithmetic series is a series in which the next term is produced by adding or subtracting a fixed number to or from the previous term in the series.

arithm-ser produces a list of terms starting at begin and produces new terms by adding step until the series reaches end or would exceed end in its next term.

The optional input nummax allows you to limit the number of terms in the series. When it is set, the series will have a maximum of nummax terms. It will still end on or before end , however.

Examples

Counting to 12

Here we see arithm-ser set to produce the numbers 0 through 12. The output will be

? OM->(0 1 2 3 4 5 6 7 8 9 10 11 12)


Prev Home Next
approx-m Up atom