MIDI Timing/Tempo Accuracy

   1810   4   2
User Avatar
Member
20 posts
Joined: May 2017
Offline
I'm trying to trigger events using a MIDI file, but the tempo seems much slower when I export a Flipbook and the animation from Houdini doesn't line with the sound file of the same midi. Everything is 24 as far as I can tell.

/obj/Keyboard1/MIDI_IN_CHOP_EXAMPLE/chopnet1/midiin1 > Chan > Sample Rate: 24
FPS: 24

Any ideas what I might be doing wrong?
User Avatar
Member
806 posts
Joined: Oct. 2016
Offline
Hi,

without a sample scene and sample data it's hard to tell what you are doing and what might be a problem.

Zerost, MIDI doesn't contain sound, only control data. There is no “direct” way to “sync” MIDI “Audio” to movie/picture data, you have to use the MIDI trigger data (Note On) to “start” something creating sound.

First, MIDI isn't a “set in stone” synced system, it usually is getting its heartbeat from a sync device. Without a sync device (which would have to be implemented in Houdini for proper syncing). Since (classic) MIDI hardware is running on ~31kbps, which, depending on your “note resolution”, may not be enough for precise syncing. Speeding this up or down is feasible.

Second, if you are using a built-in MIDI-to-Audio conversion, lags from “Note On” events to actual sound can well go up to 300ms depending on how you create the sound (“rendering” MIDI makes more sense in this context).

And that's only from the outside … depending on how Houdini implements MIDI sync, there may be more issues at hand. My bet (I haven't read the source code to Houdini's MIDI implementation) is that you'd get “better” syncing by either outputting a new MIDI file that is synced to your movie data/SMPTE OR by implementing a sync clock for your MIDI playback inside Houdini.


Marc
---
Out of here. Being called a dick after having supported Houdini users for years is over my paygrade.
I will work for money, but NOT for "you have to provide people with free products" Indie-artists.
Good bye.
https://www.marc-albrecht.de [www.marc-albrecht.de]
User Avatar
Member
20 posts
Joined: May 2017
Offline
Hi Marc,

Thanks for your explanation. I'm not new to using MIDI (been making music for many years with Ableton and Max/MSP), but I am new to using MIDI files and Houdini together. Didn't realize MIDI files didn't contain tempo information. 
 
My test:
1. output a MIDI file from Ableton with some regularly spaced notes.
2. import that MIDI file into Houdini
3. Use the MIDI to trigger events in Houdini synced with the timing of a separate exported audio file of the same MIDI data

My issue is I'm not sure what tempo/speed Houdini is defaulting to for playback of the MIDI data. Any idea if there is there a way to modify that tempo of playback?

Thanks!
User Avatar
Member
20 posts
Joined: May 2017
Offline
Forgot to add the test file. Includes a .hip and the MIDI file. Tempo in Ableton was 100bpm.

Attachments:
midi_test.zip (26.5 KB)

User Avatar
Member
806 posts
Joined: Oct. 2016
Offline
Hi,

I am starting an extremely busy week tomorrow, so I won't have time to dive into your sample file any time soon - but I do remember having read about export issues with Ableton before. It *might* just be that Ableton isn't creating the MIDI file “correctly”. Have you tried creating a simple test “beat” in another DAW, just for comparison?

Otherwise what I wrote above may still be the correct approach: Resampling (using CHOPs) the MIDI file could solve the issue.

Marc
---
Out of here. Being called a dick after having supported Houdini users for years is over my paygrade.
I will work for money, but NOT for "you have to provide people with free products" Indie-artists.
Good bye.
https://www.marc-albrecht.de [www.marc-albrecht.de]
  • Quick Links