processPitch function simplified (removed variables)