public MultiNote [ ] normalize ( ) { Hashtable splitter = new Hashtable ( ) ; for ( int i = 0 ; i < m_notes . size ( ) ; i ++ ) { Note note = ( Note ) m_notes . elementAt ( i ) ; Short key = note . getStrictDuration ( ) ; if ( splitter . containsKey ( key ) ) ( ( Vector ) splitter . get ( key ) ) . addElement ( note ) ; else { Vector v = new Vector ( ) ; v . addElement ( note ) ; splitter . put ( key , v ) ; } } short [ ] strictDurations = getStrictDurations ( ) ; MultiNote [ ] normalizedChords = new MultiNote [ strictDurations . length ] ; for ( int i = 0 ; i < strictDurations . length ; i ++ ) { normalizedChords [ i ] = new MultiNote ( ( Vector ) splitter . get ( new Short ( strictDurations [ i ] ) ) ) ; } return normalizedChords ; }
Normalizes this multi note by decomposing it into multinotes with same strict duration .