voices = SetValue(st->voices, 1, MAX_VOICES);
voices = SetValue(st->voices, 1, DEFAULT_VOICES);
ApplySettingTiMidity(SETTING_TIMIDITY *st){    int i;    char buffer[INI_MAXLEN];    /* Player must be stopped.     * DANGER to apply settings while playing.     */    amplification = SetValue(st->amplification, 0, MAX_AMPLIFICATION);    antialiasing_allowed = SetFlag(st->antialiasing_allowed);    if(st->buffer_fragments == -1)	opt_buffer_fragments = -1;    else	opt_buffer_fragments = SetValue(st->buffer_fragments, 3, 1000);    default_drumchannels = st->default_drumchannels;    default_drumchannel_mask = st->default_drumchannel_mask;    opt_modulation_wheel = SetFlag(st->opt_modulation_wheel);    opt_portamento = SetFlag(st->opt_portamento);    opt_nrpn_vibrato = SetFlag(st->opt_nrpn_vibrato);    opt_channel_pressure = SetFlag(st->opt_channel_pressure);    opt_trace_text_meta_event = SetFlag(st->opt_trace_text_meta_event);    opt_overlap_voice_allow = SetFlag(st->opt_overlap_voice_allow);    opt_default_mid = st->opt_default_mid;    default_tonebank = st->default_tonebank;    special_tonebank = st->special_tonebank;    effect_lr_mode = st->effect_lr_mode;    effect_lr_delay_msec = st->effect_lr_delay_msec;    opt_reverb_control = st->opt_reverb_control;    opt_chorus_control = st->opt_chorus_control;	opt_surround_chorus = st->opt_surround_chorus;    noise_sharp_type = st->noise_sharp_type;	opt_effect_quality = st->opt_effect_quality;    opt_evil_mode = st->opt_evil_mode;	opt_tva_attack = st->opt_tva_attack;	opt_tva_decay = st->opt_tva_decay;	opt_tva_release = st->opt_tva_release;	opt_delay_control = st->opt_delay_control;	opt_lpf_def = st->opt_lpf_def;	opt_drum_effect = st->opt_drum_effect;	opt_modulation_envelope = st->opt_modulation_envelope;	opt_eq_control = st->opt_eq_control;	opt_insertion_effect = st->opt_insertion_effect;    adjust_panning_immediately = SetFlag(st->adjust_panning_immediately);    fast_decay = SetFlag(st->fast_decay);#ifdef SUPPORT_SOUNDSPEC    view_soundspec_flag = SetFlag(st->view_soundspec_flag);    spectrigram_update_sec = st->spectrigram_update_sec;#endif    for(i = 0; i < MAX_CHANNELS; i++)	default_program[i] = st->default_program[i];    set_ctl(st->opt_ctl);    opt_realtime_playing = SetFlag(st->opt_realtime_playing);    reduce_voice_threshold = st->reduce_voice_threshold;    set_play_mode(st->opt_playmode);    strncpy(OutputName,st->OutputName,MAXPATH);#if 0    if(OutputName[0] && !is_device_output_ID(play_mode->id_character))		play_mode->name = strdup(OutputName);		// [N邩ȁH ͂Ƃ߂B#else    if(OutputName[0] && !is_device_output_ID(play_mode->id_character))		play_mode->name = OutputName;#endif    strncpy(w32g_output_dir,st->OutputDirName,MAXPATH);	w32g_output_dir[MAXPATH-1] = '\0';	w32g_auto_output_mode = st->auto_output_mode;    opt_output_rate = st->output_rate;    if(st->output_rate)	play_mode->rate = SetValue(st->output_rate,				   MIN_OUTPUT_RATE, MAX_OUTPUT_RATE);    else if(play_mode->rate == 0)	play_mode->rate = DEFAULT_RATE;    voices = SetValue(st->voices, 1, MAX_VOICES);	auto_reduce_polyphony = st->auto_reduce_polyphony;    quietchannels = st->quietchannels;    temper_type_mute = st->temper_type_mute;    if(opt_aq_max_buff)	free(opt_aq_max_buff);    if(opt_aq_fill_buff)	free(opt_aq_fill_buff);    strcpy(buffer, st->opt_qsize);    opt_aq_max_buff = buffer;    opt_aq_fill_buff = strchr(opt_aq_max_buff, '/');    *opt_aq_fill_buff++ = '\0';    opt_aq_max_buff = safe_strdup(opt_aq_max_buff);    opt_aq_fill_buff = safe_strdup(opt_aq_fill_buff);    modify_release = SetValue(st->modify_release, 0, MAX_MREL);    allocate_cache_size = st->allocate_cache_size;	key_adjust = st->key_adjust;	opt_force_keysig = st->opt_force_keysig;	opt_pure_intonation = st->opt_pure_intonation;	opt_init_keysig = st->opt_init_keysig;    if(output_text_code)	free(output_text_code);    output_text_code = safe_strdup(st->output_text_code);    free_instruments_afterwards = st->free_instruments_afterwards;    set_wrd(st->opt_wrd);#if defined(__W32__) && defined(SMFCONV)    opt_rcpcv_dll = st->opt_rcpcv_dll;#endif /* SMFCONV */    opt_control_ratio = st->control_ratio;    if(opt_control_ratio)	control_ratio = SetValue(opt_control_ratio, 1, MAX_CONTROL_RATIO);    else    {	control_ratio = play_mode->rate / CONTROLS_PER_SECOND;	control_ratio = SetValue(control_ratio, 1, MAX_CONTROL_RATIO);    }	opt_drum_power = SetValue(st->opt_drum_power, 0, MAX_AMPLIFICATION);	opt_amp_compensation = st->opt_amp_compensation;    data_block_bits = st->data_block_bits;    data_block_num = st->data_block_num;#ifdef IA_W32G_SYN	for ( i = 0; i < MAX_PORT; i ++ ) {		w32g_syn_id_port[i] = st->SynIDPort[i];	}	syn_ThreadPriority = st->syn_ThreadPriority;	w32g_syn_port_num = st->SynPortNum;	stream_max_compute = st->SynShTime;#endif}