length: string -> integer
length: list -> list
length: sequence -> sequence
length returns the length of a serial object (string, list, or sequence). Length is measured in characters for strings, in list-elements for lists, and in notes for sequences. The respective empty series have length zero; the index positions within serial objects are counted 1,2,...,length(s).
As a shorthand notation, #s is equivalent to length(s) for arbitrary serial expressions s. The unary length operator # binds stronger then all binary operators (such as *,/,etc.).
For note sequences, length should not be confused
with the functions duration and
> length([c1/4 f#/8 g/2])
> length("a. salieri")
See also: string (object type), list (object type), sequence (object type), duration, time, Operators and Expressions.