fully initialize SMF tempo information to default (4/4, 120bpm)

Leaving CPC and 32nd-per-quarter at -1 causes arithmetic errors later if the SMF
file doesn't contain an explicit time signature meta-event
This commit is contained in:
Paul Davis 2020-04-21 21:16:39 -06:00
parent 2d11667ce3
commit 9a93583ef7

View File

@ -73,12 +73,13 @@ new_tempo(smf_t *smf, size_t pulses)
tempo->denominator = previous_tempo->denominator;
tempo->clocks_per_click = previous_tempo->clocks_per_click;
tempo->notes_per_note = previous_tempo->notes_per_note;
printf ("added actual tempo, cpc = %d\n", tempo->clocks_per_click);
} else {
tempo->microseconds_per_quarter_note = 500000; /* Initial tempo is 120 BPM. */
tempo->numerator = 4;
tempo->denominator = 4;
tempo->clocks_per_click = -1;
tempo->notes_per_note = -1;
tempo->clocks_per_click = 24;
tempo->notes_per_note = 8;
}
g_ptr_array_add(smf->tempo_array, tempo);