difference between type "1" and type "0" midi files

Discuss all things music related! Need help with that chord? Song progression sound a little flat? Pitch bends a mindbender? Just wondering what else there is to learn? This board is for you!

Moderators: nZero, Willow

difference between type "1" and type "0" midi files

Postby moltres_rider » Thu Aug 30, 2012 4:12 pm

what are the difference between type 0 and type 1 midis??? I see both these options in many midi programs I use!!!
User avatar
moltres_rider
Member
 
Posts: 103
Joined: Thu Sep 29, 2005 5:29 pm
Location: Paw Paw Michigan USA

Re: difference between type "1" and type "0" midi files

Postby cosmodos » Fri Aug 31, 2012 11:57 pm

Type 0 consolidates all channels into a single track, but splits it back up into single tracks per channel when you open it back up in your sequencer. Type 1 retains all tracks as is, regardless of channel assigned (i.e., you can have more than one track assigned to the same channel). There's also a MIDI type 2, but I've yet to find any definition on it.

And it's mostly just for compatibility purposes.

EDIT: Apparently, MIDI type 2 is a pattern system, where each channel is essentially a "song" in and of itself.
Gæ'þ á Wyrd swá héo scel!
cosmodos
Member
 
Posts: 117
Joined: Fri Aug 05, 2005 11:35 pm

Re: difference between type "1" and type "0" midi files

Postby Bregalad » Tue Sep 04, 2012 7:06 am

Midi type 0 file contains a single track, which contains data for ALL channels in chronological order.

For example if 3 channels are used and all 3 plays a single note but at the same time, it will be stored like this :
Channel 1 Key On key, velocity
Channel 2 key on, key, velocity
Channel 3 key on, key velocity,
delta time
channel 1 key off, key, velocity
channel 2 key off, key, velocity
channel 3 key off, key, velocity

A midi type 1 file contains multiple tracks and it would typically be stored like this :
==== Track 1 ===
channel 1 key on, key, velocity
delta time
channel 1 key off, key, velocity
==== Track 2 ===
channel 2 key on, key, velocity
delta time
channel 2 key off, key, velocity
==== Track 3 ===
channel 3 key on, key velocity
delta time
channel 3 key off, key, velocity
Bregalad
Member
 
Posts: 270
Joined: Wed Sep 01, 2010 2:47 pm
Location: Switzerland

Re: difference between type "1" and type "0" midi files

Postby Bavi_H » Fri Oct 26, 2012 10:16 pm

Summary: You normally want to use a type 1 MIDI file because it gives you more options for organizing tracks. Some hardware MIDI players only support type 0 MIDI files because they are easier to play with limited memory*. In case you need to use a device like that, you could save a copy of your MIDI sequence as type 0, but you probably want to keep the master version in a type 1 MIDI file.

More information

Type 1 MIDI file

In a type 1 MIDI file you can:
- Give each track a name.
- Assign a channel to multiple tracks. (For example, you might split right and left hand piano parts into separate tracks that use the same channel.)
- Make empty tracks or text-only tracks.

Type 0 MIDI file

Internally, a type 0 MIDI file contains only one track with events from all channels. In most sequencer software, when you open a type 0 MIDI file, it automatically creates 16 tracks for you, one for each MIDI channel. If you save as a type 0 MIDI file, the tracks are mixed back into one track in the file. If you rearrange the order of the tracks, insert blank tracks, or change the tracks' channels, then save as type 0 and re-open the file, your sequencer will make tracks in order from channel 1 to 16 again. Also, text events and other meta events have no channel number associated with them, so saving as type 0 and then reopening the MIDI file will typically cause these events to reappear in the first track.

* Why is it easier to play a type 0 MIDI file?

Inside a MIDI file, the tracks are stored one after another. And in a single track, the events are stored in their playback order. To play a type 1 file, you have to load all the tracks into memory and sort all the events into their playback order. When you use a type 0 file, there's only one track, so all the events in the file are already in the same order they need to be played in. You can read a small part of the file at a time, just enough to fill a small buffer. When the playback is near the end of the buffer you can read another segment of the file, and so on.
Bavi_H
Member
 
Posts: 19
Joined: Fri Oct 05, 2012 6:14 pm
Location: Texas, USA

Re: difference between type "1" and type "0" midi files

Postby Pizzaking271 » Sun Feb 10, 2013 6:14 am

Type 0 = all tracks in a single uneditable one.
Type 1 = all tracks seperately.
Type 2 = one track per song... in a single MIDI file.
I have taken over the Internet! :P
User avatar
Pizzaking271
Member
 
Posts: 58
Joined: Sun Jul 15, 2012 5:22 am
Location: Britain


Return to Music Discussion and Q&A

Who is online

Users browsing this forum: No registered users and 1 guest