Tempo from events...

Official support for: mutools.com
Post Reply New Topic
RELATED
PRODUCTS

Post

I'm not sure if I'm missing something obvious...

I've a MIDI sequence recorded on disk, tracked "live" to click. Now, I thought I'd had the click at 120bpm but when I import it, that's clearly not the case...

Is there any way to work out from the imported events (e.g. logical select a note that happens once per bar or beat) what the correct tempo is?

I have a mental image of locking the events in place, adjusting the tempo until the grid lines up, then unlocking the events (so they move with the tempo grid).

Is anything like that possible?

Post

As far as i know this is not possible, at least in Mulab.

Midi event position in a sequence is based on bars, beats and ticks and is therefore independent of tempo (i mean the position of notes in the grid).
What would be needed is to convert the midi into a min/sec/msec domain, change tempo, which moves the notes in the grid, and bring them back into the bar/beat/tick domain.

To find the real tempo, you could record some of the notes (let them play a rim/snare) and get the tempo from the resulting audio (change tempo and see when the audio hits meet the bar/beat), but that would not help in changing the midi notes.

You can experiment with the Function/Change Times/percentage in the piano roll editor. That appears to be tricky as well.

Post

AndreasD wrote:Midi event position in a sequence is based on bars, beats and ticks
This is only true once in the DAW itself. In the MIDI file, the events have a simple timestamp. There may be tempo information stored in the file but I don't think MULAB reads this. I'll have a poke around and see if I've any of my old MIDI tools that might be able to help.

--edit
Well, unfortunately the SMF doesn't contain the info either.

Code: Select all

MFile 0 1 960
MTrk
9518 On ch=10 n=38 v=65
9528 On ch=10 n=38 v=0

Post

OK, in fact I think I'm seeing a bug - or at least a design flaw.

The file has no Tempo information. The "960" above just says there are 960 ticks per beat, it gives no information about how fast the ticks are coming.

Under the circumstances, I would expect MULAB to use the composition tempo. However, that's not what's happening. It seems to be assuming a default tempo for the MIDI file. What that means is that there is no way to get MULAB to import the file correctly.

Post

If the midi file says one beat contains 960 ticks, and you have events that are 960 ticks apart than they should be one beat apart in Mulab.

OK, you are deeper in this subject than me.
What tool are you using to analyse the SMF? Looks interesting.

Mulab does read and store tempo information. Sometimes annoying when i import a midi file as a sequence.

Post

That's MIDI2MTX from the MIDIOX site, under MIDI tools.

Further checking reveals MULAB is correctly assuming 120bpm if no tempo is specified (which is a pain! ;)).

I'm now thinking the file may have been exported strangely (I've not used Reaper's MIDI export before, so I don't know if it's reliable).

Post

When you import a MIDI file into an existing composition, the composition's tempo should be preserved. Not?

Post

Yes. But the tempo information in the incoming MIDI file tells you when (in real time) the events occur.

There are several possibilities. If I import a 130bpm file, into a 120bpm composition, it could slow down (to align the 130bpm beats to the 120bpm beats). That isn't happening. The tempo is simply ignored.

I just tested by inserting Tempo events into a test file. Regardless of whether I set 110bpm, 130bpm or no tempo, the MIDI file is imported identically. That doesn't seem at all right.

Post

Why not?

I mean: If a MIDI fie contains 4 bars, these 4 bars are imported into a composition, so far so good. Then then tempo defines how fast these bars are played. If the MIDI file says 130 bpm and you import it in a 120 bpm comp then it will be 120 bpm. If you import it as a new comp it will be 130 bpm. Don't see what's wrong (maybe i didn't sleep enough).

Post

MIDI files do not contain bars, generally. They contain timed events. There are several ways of encoding the timing information. The most common is ticks. The Tempo event tells you how many milliseconds there are per beat. Then the tick position tells you when the event happens. (Alternatives include using SMTPE subframes in place of "ticks".) So in a MIDI file the events are in REAL TIME.

The "960" says 960 ticks per beat. That doesn't tell you about beats per bar (there's a TimeSig event that could do that but that's also not present in my files.)

The Tempo says how many seconds a beat lasts. That differs depending on the BPM. So you need to take it into account.

Unfortunately,

Code: Select all

MFile 0 1 960
MTrk
0 Tempo 461538
9518 On ch=10 n=38 v=65
9528 On ch=10 n=38 v=0
and

Code: Select all

MFile 0 1 960
MTrk
0 Tempo 545454
9518 On ch=10 n=38 v=65
9528 On ch=10 n=38 v=0
are treated identically by MULAB. The events end up in the same place.

Post

I tend to disagree, just from experience with Cubase, Reason, Mulab.

The tempo just tells the DAW how fast to run the ticks.
The events should be placed at the same beat regardless of tempo. At least i haven't seen it otherwise. If your events are e.g. 1000 ticks apart they will not be on the beat. Unless you play at, say 120bpm, into a DAW and record there at 130bpm. Then i would agree that position changes. But not when loading the midi file.

Thanks for the link!

Post

OK, maybe I'm asking this upside down, actually.

The data in the MIDI files is tied to a tick and MULAB is lining up the beats in the file to the beats in the composition against the 960 tick per beat fine.

What I think I actually want is for a six minute MIDI track to be imported lasting the expected six minutes, rather than fitted to the BPM.

Now I think about it, what I think happened is that I was probably recording to an external click, with the project BPM set to a different rate. I'm surprised there's no BPM info in the MIDI file, though, making it harder to see what's happening.

One other thing I'll try is setting a tempo marker and moving the data around...

Post

Aha!

So I change the ticks per quarter note and MULAB imports based on that. Right, I have something to work with :D.

Post Reply

Return to “MUTOOLS”