      - parameter measureIndex: The index of the measure to replace.
      - parameter newMeasure: The new measure to replace the old one.
      - throws:
-     - `StaffError.repeatedMeasureCannotBeModified` if the measure is a repeated measure.
-     - `StaffError.internalError` if index translation doesn't work properly.
+         - `StaffError.repeatedMeasureCannotBeModified` if the measure is a repeated measure.
+         - `StaffError.internalError` if index translation doesn't work properly.
      */
     public mutating func replaceMeasure(at measureIndex: Int, with newMeasure: Measure) throws {
         let (notesHolderIndex, repeatMeasureIndex) = try notesHolderIndexFromMeasureIndex(measureIndex)

     the beginning of a repeat. True if you want the measure to be inserted before the repeat. False
     when you want the measure to be inserted into the repeat at the given index.
     - throws:
     - `StaffError.measureIndexOutOfRange`
     - `StaffError.noRepeatToInsertInto`
     - `StaffError.hasToInsertIntoRepeatIfIndexIsNotFirstMeasureOfRepeat`
     - `StaffError.internalError`
     - `MeasureRepeatError.indexOutOfRange`
     - `MeasureRepeatError.cannotModifyRepeatedMeasures`
     */
    public mutating func insertMeasure(_ measure: Measure, at index: Int, beforeRepeat: Bool = true) throws {
        let notesHolderIndex = try notesHolderIndexFromMeasureIndex(index)

     - parameter setIndex: The index of the set of notes you want to modify. There can be multiple sets of notes
     that make up a full measure on their own. i.e. bass drum notes and hi-hat notes. See `Measure` for more info.
     - throws:
         - `StaffError.noteIndexoutOfRange`
         - `StaffError.noNextNoteToTie` if the note specified is the last note in the staff.
         - `StaffError.measureIndexOutOfRange`
         - `StaffError.repeatedMeasureCannotHaveTie` if the index for the measure specified refers to a measure that is
         a repeat of another measure.
         - `MeasureError.noteIndexOutOfRange`
         - `StaffError.internalError`, `MeasureError.internalError` if the function has an internal implementation error.
     */
    public mutating func removeTieFromNote(at noteIndex: Int, inMeasureAt measureIndex: Int, inSet setIndex: Int = 0) throws {
        try modifyTieForNote(at: noteIndex, inMeasureAt: measureIndex, removeTie: true, inSet: setIndex)
