-def timeline_from_midi(midi_file, video_font_path):
- timeline = vidi.Timeline()
+def timeline_from_midi(midi_file, canvas_size, video_font_path):
+ timeline = vidi.Timeline(canvas_size)
+
+ if ADD_TITLE:
+ title = TITLE_TEXT
+ if not title:
+ title = os.path.splitext(os.path.basename(midi_file.filename))[0]
+ title += "\n\n"
+ title += TITLE_CREDITS
+
+ timeline.add_title_clip(title, 0, TITLE_DURATION)
+
+ elapsed_time = start_time = TITLE_DURATION
+ else:
+ elapsed_time = start_time = 0