public Voice getVoice ( String voiceName ) { for ( Object m_voice : m_voices ) { Voice v = ( Voice ) m_voice ; if ( v . getVoiceName ( ) . equals ( voiceName ) ) return v ; } Voice v = new Voice ( voiceName , m_firstBarNumber ) ; v . setPartLabel ( m_partLabel ) ; m_voices . add ( v ) ; return v ; }
Returns the asked voice create it if needed .