Tree

  • Create a DurationTree with the beat values of the given proportionTree with the given subdivision.

    Note

    Ensure the given proportionTree has been normalized.

    Declaration

    Swift

    @inlinable
    public init(_ subdivision: Int, _ proportionTree: ProportionTree)
  • Create a DurationTree with the given duration as the value of the root node, and the given proportions scaled appropriately.

    Declaration

    Swift

    @inlinable
    public init(_ duration: Duration, _ proportionTree: ProportionTree)
  • Duration value of this DurationTree node.

    Declaration

    Swift

    @inlinable
    public var duration: Duration { get }
  • Declaration

    Swift

    @inlinable
    public var scaling: Tree<Fraction, Fraction> { get }

    Return Value

    Tree containing the inherited scale of each node contained herein.

  • Declaration

    Swift

    @inlinable
    public var scaled: Tree<Fraction, Fraction> { get }

    Return Value

    DurationTree with the durations scaled by context.

  • Todo

    Change to concrete offsets.

    Todo

    Refactor to concreteOffsets(startingAt: Duration, in structure: Meter.Structure)

    Declaration

    Swift

    @inlinable
    public var offsets: [Fraction] { get }

    Return Value

    Array of tuples containing the scaled offset from the start of this DurationTree.

  • Declaration

    Swift

    @inlinable
    public var normalized: ProportionTree { get }

    Return Value

    A new ProportionTree in which the value of each node can be represented with the same subdivision-level (denominator).

  • Create a single-depth ProportionTree with the given root duration and child durations.

    Declaration

    Swift

    @inlinable
    public init(_ duration: Int, _ durations: [Int])