Easy way to sync video and MIDI output

Post fully complete "how to" guides and tutorials here. This is a great place to get feedback on stuff you might put in the wiki.

Moderators: MattKingUSA, khz

Post Reply
amc252
Established Member
Posts: 132
Joined: Fri May 05, 2023 12:24 am
Has thanked: 90 times
Been thanked: 20 times

Easy way to sync video and MIDI output

Post by amc252 »

Hello everybody,

I don't know if this has been solved more elegantly somewhere else, but I'm quite happy with my solution, so here it goes.

Since the onboard sound of my Roland digital piano is not on par with VSTs, I usually record the audio in my videos using sfizz + some SFZ library.
The nuisance is that I have to choose which piano sound to use beforehand and, if I nail an especially good interpretation (or improvisation) playing Library A, I wish I had used library B instead (or C or D).
Unfortunately, video recording and MIDI are like water and oil and don't go along.

Hence I tried this workaround:

A) I recorded video and the onboard audio output from the piano (with OBS studio) AND, at the same time, the MIDI output. In my case,
I used the F107 MIDI recording function, but it can be done with arecordmidi or Musescore, etc.
B) I replayed the MIDI with sfizz + an SFZ library of my choosing + aplaymidi and recorded it (with arecord). One of the advantages
is that I can not only record as many versions I want but also recording MIDI output without video requires a lot less resources.
C) I uploaded the video on Shotcut and dropped it in the timeline.
D) right clicked on the left end of the track and selected 'add audio track', which creates a track below the video.
E) I uploaded the good audio recording and dropped it there.
F) right clicked on the audio and selected 'align to reference track' and then 'process'.
G) muted the video sound and played both together to see if everything was okay.
H) right clicked on the video track and selected 'detach audio', which drops the audio below the good audio, where I then can delete it.
I) exported the file and voilà.

The editing process took barely a few minutes, and I love the freedom to choose any piano sound I want 'after the fact'.

Post Reply