         try replaceNote(at: collectionIndex, with: [firstNote], inSet: setIndex)
     }
 
+    /**
+     Returns the `NoteCollectionIndex` for the note at the specified note set and index.
+     
+     - parameter index: The index of the note in the specified note set.
+     - parameter setIndex: The index of the note set holding the note.
+     - throws:
+        - `MeasureError.noteIndexOutOfRange`
+     */
     internal func noteCollectionIndex(fromNoteIndex index: Int, inSet setIndex: Int) throws -> NoteCollectionIndex {
         // Gets the index of the given element in the notes array by translating the index of the
         // single note within the NoteCollection array.

        self = newMeasure
    }

    public mutating func append(_ noteCollection: NoteCollection, inSet setIndex: Int = 0) {
        notes[setIndex].append(noteCollection)
    }

    public mutating func insert(_ noteCollection: NoteCollection, at index: Int, inSet setIndex: Int = 0) throws {
        try insert(noteCollection, at: index, inSet: setIndex, skipTies: false)
    }

    internal mutating func insert(_ noteCollections: [NoteCollection], at index: Int, inSet setIndex: Int = 0) throws {
        try insert(noteCollections, at: index, inSet: setIndex, skipTies: false)
    }

    public mutating func removeNote(at index: Int, inSet setIndex: Int = 0) throws {
        try removeNote(at: index, inSet: setIndex, skipTies: false)
    }

    public mutating func removeNotesInRange(_ indexRange: CountableClosedRange<Int>, inSet setIndex: Int = 0) throws {
        try removeNotesInRange(indexRange, inSet: setIndex, skipTies: false)
    }

    /// Create a `Tuplet` from a note range. See `Tuplet.init` for more details.
    /// This function also makes sure that the `noteRange` does not start or end
    /// across a `Tuplet` boundary.
    public mutating func createTuplet(_ count: Int, _ baseNoteDuration: NoteDuration, inSpaceOf baseCount: Int? = nil, fromNotesInRange noteRange: CountableClosedRange<Int>, inSet setIndex: Int = 0) throws {
        var newMeasure = self
        let startCollectionIndex = try newMeasure.noteCollectionIndex(fromNoteIndex: noteRange.lowerBound, inSet: setIndex)

            case .begin?:
                guard var lastNote = newCollections.last?.last else {
                    assertionFailure("last note was nil")
                    throw MeasureError.internalError
                }
                try lastNote.modifyTie(.begin)
                try modifyCollections(atFirst: false, with: lastNote)
            case .end?:
                guard var firstNote = newCollections.first?.first else {
                    assertionFailure("first note was nil")
                    throw MeasureError.internalError
                }
                try firstNote.modifyTie(.end)
                try modifyCollections(atFirst: true, with: firstNote)
