Slow Motion Midi File

Posted on
Slow Motion Midi File 3,6/5 5117 reviews

I have background music for some songs available in both.MID and.KAR formats, but in each case it's being played somewhat faster than I'd like. What's the simplest way to create either.MID or.KAR files with the same content but at a slower tempo - say, one slowed down by 20% or so, another by 15%, a third by 25%, and so on?Ideally, I'd prefer a cross-platform Python script (since that would allow me to easily experimentally tweak the source to converge to the exact effect I want;-), but I'll take any free solution that runs in Linux (Ubuntu 8.04 if it matters) and Mac (Mac OS X 10.5, but 10.6 compatibility preferred). You could edit the file, as perAlthough there probably is a MIDI reading/writing library already. In fact, it was a matter of seeing the related questions:Set TempoThis meta event sets thesequence tempo in terms ofmicroseconds per quarter-note which isencoded in three bytes.

  1. Slow Motion Midi File
  2. Midi Converter
Slow motion video

Slow Motion Midi File

It usually isfound in the first track chunk,time-aligned to occur at the same timeas a MIDI clock message to promotemore accurate synchronization. If noset tempo event is present, 120 beatsper minute is assumed. The followingformula's can be used to translate thetempo from microseconds perquarter-note to beats per minute andback.MICROSECONDSPERMINUTE = 60000000BPM = MICROSECONDSPERMINUTE / MPQNMPQN = MICROSECONDSPERMINUTE / BPMMeta Event Type Length Microseconds/Quarter-Note255 (0xFF) 81 (0x51) 3 0-8355711. As Vinko says, you can edit the midifile, but since it's a binary format, squeezed into the least number of bits possible, it helps to have help.This is a midi-to-text converter (and vice-versa):I've been using it quite a bit lately.

It's pretty trivial to do text processing (e.g. Searching for line with 'Tempo') for simple operations once you have the midifile as text. Haven't tried on mac (compiled with no problem on ubuntu 8.04).Regarding midifile tempo specifically, it's really easy to slow down or speed up playback since the timing of events is specified in terms of 'ticks', whose real duration in seconds is determined by the tempo parameter described in Vinko's quote. I believe time signature is not so relevant, and is mainly for displaying bars/beats correctly when opened in a midi sequencer.Also, aside from pyPortMidi, there are a couple of other python midi modules around.hmmm. It seems i can only post on link per post, being a new user. I'll try posting the links to the python modules in a couple comments or another couple answers.

Motion

Midi Converter

You can use to do this, though I have only tested it on OSX 10.10.1. Import music21fctr = 1.25 # scale (in this case stretch) the overall tempo by this factorscore = music21.converter.parse('song.mid')newscore = score.scaleOffsets(fctr).scaleDurations(fctr)newscore.write('midi','songslow.mid')Offsets are like the timestamps of each note, and durations is how long the note is sounded, I believe applying the same scale factor to each is kind of like adjusting the tempo.If you are like me then you are listening to the same songs 7 years later and can give this a try! Otherwise, I hope this helps someone else who woke up today like me and was scratching my head trying to solve this problem easily.