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:
parent
2d11667ce3
commit
9a93583ef7
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user