more robust consensus

Getting better consensus by:
- mapping output to a single octave (new function mapToInterval)
- modification to detectPitch to avoid noise