public function getAllPitches($heightless=false) {
        $pitches = array();

        foreach ($this->notes as $note) {
            $pitch = $note->properties['pitch'];
            if ($heightless) {
                $pitch->setProperty('octave', null);
            }

            $pitchStringKey = $pitch->toString();
            if (!is_array($pitches[$pitchStringKey])) {
                $pitches[$pitchStringKey] = array();
            }

            $pitches[$pitchStringKey][] = $pitch;
        }

        // dedupe + count
        return $pitches;

    }
public function getAllPitches($heightless=false) {
        $pitches = array();

        foreach ($this->notes as $note) {
            $pitch = $note->properties['pitch'];
            if ($heightless) {
                $pitch->setProperty('octave', null);
            }

            $pitchStringKey = $pitch->toString();
            if (!is_array($pitches[$pitchStringKey])) {
                $pitches[$pitchStringKey] = array();
            }

            $pitches[$pitchStringKey][] = $pitch;
        }

        // dedupe + count
        return $pitches;

    }
public function getAllPitches ( $ heightless = false ) { $ pitches = array ( ) ; foreach ( $ this -> notes as $ note ) { $ pitch = $ note -> properties [ 'pitch' ] ; if ( $ heightless ) { $ pitch -> setProperty ( 'octave' , null ) ; } $ pitchStringKey = $ pitch -> toString ( ) ; if ( ! is_array ( $ pitches [ $ pitchStringKey ] ) ) { $ pitches [ $ pitchStringKey ] = array ( ) ; } $ pitches [ $ pitchStringKey ] [ ] = $ pitch ; } // dedupe + count return $ pitches ; }
returns an array of Pitch objects, for every pitch of every note in the chord.

@param  boolean $heightless if true, will return heightless pitches all mudulo to the same octave. Useful for analysis, determining mode etc. analysis, determining mode etc.
analysis, determining mode etc.
@return array                a key for every pitch represented in string form (like "C#4" or "A-7", and inside that an array
of Pitch objects.
returns an array of Pitch objects for every pitch of every note in the chord .