Hi,
static void headerprocess()
/* called after the K: field has been reached, signifying the end of */
/* the header and the start of the tune */
{
int t_num, t_denom;
struct voicecontext *p;
if (headerpartlabel == 1) {
part_start[(int) part.st[0] - (int) 'A'] = notes;
addfeature (PART, part.st[0], 0, 0);
};
/* addfeature(DOUBLE_BAR, 0, 0, 0); [SS] 2014-10-29 */
pastheader = 1;
gracenotes = 0; /* not in a grace notes section */
if (!timesigset) {
event_warning ("No M: in header, using default");
};
/* calculate time for a default length note */
if (global.default_length == -1) {
if (((float) time_num)/time_denom < 0.75) {
global.default_length = 16;
} else {
global.default_length = 8;
};
};
/* ensure default_length is defined for all voices */
p = head;
while ((p != NULL)) {
if (p->default_length == -1) p->default_length=global.default_length;
p = p->next;
};
bar_num = 0;
bar_denom = 1;
set_meter(time_num, time_denom);
if (hornpipe) {
if ((time_denom != 4) || ((time_num != 2) && (time_num != 4))) {
event_error("Hornpipe must be in 2/4 or 4/4 time");
hornpipe = 0;
};
};
tempounits(&t_num, &t_denom);
/* make tempo in terms of 1/4 notes */
tempo = (long) 60*1000000*t_denom/(Qtempo*4*t_num);
div_factor = division;
voicesused = 0;
}