Other Functions

The following functions are available globally.

  • Declaration

    Swift

    @inlinable
    public func * (subdivision: Int, proportions: [Int]) -> DurationTree

    Return Value

    A DurationTree with the given subdivision applied to each node.

  • If an empty array is given, a single child is created with the same Duration value as the root.

    Declaration

    Swift

    @inlinable
    public func * (duration: Duration, proportions: [Int]) -> DurationTree

    Return Value

    A single-depth DurationTree with the given duration as the value of the root node, and the given proportions mapped accordingly as the children.

  • Declaration

    Swift

    @inlinable
    public func lengths<S, T>(of rhythms: S) -> [Duration] where S : Sequence, S.Element == Rhythm<T>

    Return Value

    The Duration values of the leaves of the given rhythms, by merging tied leaves to their predecesors.

  • Declaration

    Swift

    public func * <Element>(lhs: DurationTree, rhs: [Rhythm<Element>.Context]) -> Rhythm<Element>

    Return Value

    Rhythm with the given DurationTree and Rhythm.Context.Kind values.