Quote Originally Posted by a.mlw.walker
temp is a member variable of ChordBuilder
What does "temp" mean? It is a common abbreviation for "temporary", but that would be an unusual choice of name for a member variable, which usually is more long lived.

Quote Originally Posted by a.mlw.walker
I would rather do this without new/delete but I cant figure out how?
Here is a rather direct translation of doInversion to use a vector:
Code:
std::vector<uint8_t> ChordBuilder::doInversion(uint8_t* pattern, uint8_t size) {
 
    std::vector<uint8_t> temp(size);
    temp[0] = pattern[1];
    for (int i = 1; i < size - 1; i++) {
        temp[i] = pattern[i + 1];
    }
    temp[size - 1] = pattern[0] + 12;
    return temp;
}
Obviously, you cannot directly substitute this because then the return type won't match what is expected.

Related to this: what does chord.getPattern() return? It presumably returns a pointer to uint8_t, but why? Why not return a vector? Why not return an object of class type? If you must return a pointer, then who owns what the pointer points to?