Tracks vs Channels

Discussion in 'General Sequencing' started by gobi, Mar 17, 2005.

  1. gobi

    gobi New Member

    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    0
    Hello

    I don't understand the link between tracks on a midi file and channels on a midi device. I know you save information of 1 instrument on a track, but this information can also be played on multiple channels. If I want to write a midi parser for mobile phones, do I need to keep this in mind when I combine different midi files?

    I know you can play multiple tracks on 1 channel, but is there a limit on the number of tracks?
    What if you have a lot of drum tracks, are they all played on channel 10?
    Is there a limit or does it depend on the midi device itself?

    Thanks
  2. ZelRiptha

    ZelRiptha Thnow White but I drifted Staff Member Super Mod

    Messages:
    7,535
    Likes Received:
    0
    Trophy Points:
    36
    The MIDI file specification provides 2 bytes in the header for the number of tracks in a file. Thus a type one MIDI file could have (theoretically) as many as 64k tracks. The tracks can each contain a very large number of MIDI events. Most events contain a channel nibble which must correspond to one of the 16 MIDI channels. So tracks have no real forced correlation to channels. All that being said, tracks are often "assigned" a channel by commonly used sequencing software so that each track will only transmit on the specified channel. The specifics on whether drum tracks will play on channel 10 or similar things are hardware dependent. The General MIDI specification (not supported by all devices) does assign channel 10 as the default channel for drums, but differences are not prohibited.

    I think the general answer to your questions is yes, you need to account for these possibilities in your software. It's not that difficult to account for the possibilities, however uncommon they might be.
  3. gobi

    gobi New Member

    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    0
    Thank you for your info

    But why would you play events of 1 midi track on different channels, like I read somewhere?

    And is there a limit for the amount of tracks on a channel or does it depend on the midi device itself?
  4. mine

    mine New Member

    Messages:
    52
    Likes Received:
    0
    Trophy Points:
    0
    remember it's not just note information that can be controlled by channels. Outboard effects and instruments can also be controlled this way so if you have just 1 track it may be nececary to swith effects during playback. The possibilities are endless.
  5. ZelRiptha

    ZelRiptha Thnow White but I drifted Staff Member Super Mod

    Messages:
    7,535
    Likes Received:
    0
    Trophy Points:
    36
    While it's not something you might encounter in mobile phone MIDI files, it is possible that a type 0 MIDI file could be used to control multiple devices in a MIDI chain (type 0 files are inherently single-tracked). This would necessitate using a MIDI track with events being sent to multiple channels. Remember, the MIDI specification needs to be very flexible to handle the practically infinite gear setups that people can come up with. If it were designed solely for music playback on a PC or mobile device, it could be much simpler. But it is what it is. (Which makes it harder to write software for...) :)
  6. ZelRiptha

    ZelRiptha Thnow White but I drifted Staff Member Super Mod

    Messages:
    7,535
    Likes Received:
    0
    Trophy Points:
    36
    Oops, I forgot about your tracks-per-channel question. There is no limit to the number of tracks that can be transmitting on a channel, other than the hard 64k track limit of the file format and the reality of data bandwidth (MIDI streams at about 31kbps serially).

    Also, my answer above could have been even simpler now that I think about it. Any type 0 MIDI file with more than one patch playing at any one time of neccesity must transmit to multiple channels from one track, by definition. So most polyphonic type 0 MIDI files transmit to multiple channels from one track.
  7. gobi

    gobi New Member

    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    0
    thanks

    this explanation makes it more clear for me

Share This Page