function write_config (input,output,comment,title,fmax,fmin,
        segment_size,advance, ticks_quarter,tempo,channel,
        time_signature,instrument,percen_silen,percen_autocorr,cclip,method,p)
        
        a="<?xml version=\"1.0\"?>\n\n";
        a=[a "<FILE_INPUT>" input "</FILE_INPUT>\n"];
        a=[a "<FILE_OUTPUT>" output "</FILE_OUTPUT>\n"];
        a=[a "<COMMENT>" comment "</COMMENT>\n"];
        a=[a "<TRACK_TITLE>" title "</TRACK_TITLE>\n"];
        a=[a "<FREQ_MAX>" sprintf("%d",fmax) "</FREQ_MAX>\n"];
        a=[a "<FREQ_MIN>" sprintf("%d",fmin) "</FREQ_MIN>\n"];
        a=[a "<SEGMENT_SIZE>" sprintf("%d",segment_size) "</SEGMENT_SIZE>\n"];
        a=[a "<ADVANCE>" sprintf("%d",advance) "</ADVANCE>\n"];
        a=[a "<TICKS_NEGRA>" sprintf("%d",ticks_quarter) "</TICKS_NEGRA>\n"];
        a=[a "<TEMPO>" sprintf("%d",tempo) "</TEMPO>\n"];
        a=[a "<CHANNEL>" sprintf("%d",channel) "</CHANNEL>\n"];
        a=[a "<TIME_SIGNATURE>" sprintf("%d",time_signature) "</TIME_SIGNATURE>\n"];
        a=[a "<INSTRUMENT>" sprintf("%d",instrument) "</INSTRUMENT>\n"];
        a=[a "<PERCENT_SILEN>" sprintf("%d",percen_silen) "</PERCENT_SILEN>\n"];
        a=[a "<PERCEN_AUTOCOR>" sprintf("%d",percen_autocorr) "</PERCEN_AUTOCOR>\n"];
        a=[a "<CENTER_CLIP_PERCEN>" sprintf("%d",cclip) "</CENTER_CLIP_PERCEN>\n"];
        a=[a "<ANALYSIS_METHOD>" sprintf("%d",method) "</ANALYSIS_METHOD>\n"];
        a=[a "<NUM_LPC>" sprintf("%d",p) "</NUM_LPC>\n"];
        
        fid=fopen('config.pbg','w');
        fwrite(fid,a);
        fclose(fid);
endfunction