patternSet: Abstract decodePitch and encodePitch into separate methods