OpenMusic

Visual Programming | Computer-Assisted Composition

OpenMusic Reference

Prev| | Next


fibo-ser

fibo-ser

(series module) -- generates a fibonacci series

Syntax

geometric-ser seed1 seed2 limit &optional begin end

Inputs

name data type(s) comments
seed1 a number the first element from which to calculate the series. Defaults to 0
seed2 a number the second element from which to calculate the series. Defaults to 1
limit a number the upper limit of the series. Defaults to 10
begin a non-negative integer optional; the ordinal of the first term to take. Defaults to 0
end a non-negative integer optional; the ordinal of the last term to take. Defaults 536870911

Output

output data type(s) comments
first a list  

Description

Returns a fibonacci series series.

fibo-ser produces a list of terms starting with seed1 and seed2 and produces new terms by adding the previous two, until the series reaches limit or would exceed limit in its next term.

Additionally, you can specify two optional inputs begin and end , which will cause fibo-ser to return only the range of elements of the series between the two inputs (just like geometric-ser

Examples

Calculating a fibonacci sequence

Here we see fibo-ser set to produce a fibonacci series stopping at or before reaching 250. It returns

? OM->(0 1 1 2 3 5 8 13 21 34 55 89 144 233)


Prev Home Next
famille Up finale-export