public function noteNumberToPitch($noteNumber, $preferredAlteration = 1) {
        $chroma = $this->_truemod($noteNumber, 12); // chroma is the note pitch independent of octave, eg C = 0, Eb/D# = 3, E = 4
        $octave = (($noteNumber - $chroma) / 12) + 4;
        $this->octave = $octave;

        if (is_array(self::$chromas[$chroma])) {
            if ($preferredAlteration == 1) {
                $this->step = self::$chromas[$chroma][1]['step'];
                $this->alter = self::$chromas[$chroma][1]['alter'];
            } else {
                $this->step = self::$chromas[$chroma][-1]['step'];
                $this->alter = self::$chromas[$chroma][-1]['alter'];
            }
        } else {
            $this->step = self::$chromas[$chroma];
            $this->alter = 0;
        }
    }