private static int calculate_num_channels( byte[] module_header ) {
		int num_channels;
		switch( ( module_header[ 1082 ] << 8 ) | module_header[ 1083 ] ) {
			case 0x4b2e: /* M.K. */
			case 0x4b21: /* M!K! */
			case 0x542e: /* N.T. */
			case 0x5434: /* FLT4 */
				num_channels = 4;
				break;
			case 0x484e: /* xCHN */
				num_channels = module_header[ 1080 ] - 48;
				break;
			case 0x4348: /* xxCH */
				num_channels = ( ( module_header[ 1080 ] - 48 ) * 10 ) + ( module_header[ 1081 ] - 48 );
				break;
			default:
				/* Not recognised. */
				num_channels = 0;
				break;
		}
		return num_channels;
	}