public void playNotesOnChannel(int index, 
                                 int [] notes, 
                                 int [] durations,
                                 int [] intensities) 
  {
    // set the channel based on the index
    channel = channels[index];
    
    // loop through the array of notes
    for ( int i = 0; i < notes.length; i++ ) {
      channel.noteOn( notes[ i ], intensities[ i ] );
      try { Thread.sleep( durations[ i ] ); } catch
        ( InterruptedException e ) { }
    } 
    
    // turn off the notes
    for ( int i = 0; i < notes.length; i++ ) 
      channel.noteOff( notes[ i ] );
  }