CGMA UNIT 6 part 3

MIDI File Formats
MIDI stands for musical instrument digital interface. It is industry standard to represent musical information. it the widely used protocol to connect electronic musical instruments such as synthesizers, in computers for the purpose of recording, editing and programming, and electronic music music euipment in the electronic home studio. Unlike other audio files(.wav and .mp3), a MIDI file does not contain audio, but it contains instructions to produce it. It is basically a digital score.
It specifies the hardware interface and data format of electronic instruments and audio systems. MIDI is intended to connect to musical instruments, computers and related audio devices. The MIDI file size is small and it contains large range of instruments. It is easy to modify.
Advantages:-
  • file sizes are much smaller than audio files.
  • multiple devices can be linked together.
  • MIDI sequences can be edited in ways that audio files cannot, such as changing pitch of a section. 
Disadvantages:- 
  • MIDI specification only describes how MIDI devices communicate.
  • Quality of sound is limited by playback device.
  • Can not store vocals. It is still an audio files. 
MIDI actually consists of three distinctly diferent parts. These are-

  1. Physical connector: it connects and transports data between devices.
  2. Message format: controls the storage data and the connected devices. 
  3. Storage format: it stores all the data and information. 
MIDI file is simply a series of 8-bit bytes. MIDI files are made up of chunks. Each chunk has a 4-character type and a 32-bit length, which is the number of bytes in the chunk.  Each chunk begins with a 4-character ASCII type. It is followed by a 32-bit length, most significant byte first. This length refers to the number of bytes of data which follow: the eight bytes of type and length are not included. Therefore, a chunk with a length of 6 would actually occupy 14 bytes in the disk file.

MIDI files contain two types of chunks: header chunks and track chunks. A header chunk provides a minmal amount of information pertaining to the entire MIDI file. A track chunk contains a squential stream of MIDI data which may contain information for up to 16 MIDI channels. The concepts of multiple tracks, multiple MIDI outputs, patterns, sequences and songs may all be implemented using several track chunks.  A MIDI file always starts with a header chunk and it followed by one or more track chunks.

MThd <length of header data>
<header data>
MTrk <length of track data>
<track data>
MTrk <length of track data>
<track data
.....

Header Chunks:-The header chunk at the beginning of the files specifies some basic information about the data in the file. Syntax of the complete chunk is:





 <Header Chunk>=<chunk type><length><format><ntrks><division>
<chunk type> is the four ASCII characters 
'MThd'; is a 32-bit representation of the number 6 (high byte first)
The data section contains three 16-bit words, stored most-significant byte first. 
<format> specifies the overall organisation of the file. 
Only three values of are specified: 
0-the file contains a single multi-channel track 
1-the file contains one or more simultaneous tracks (or MIDI outputs) of a sequence 
2-the file contains one or more sequentially independent single-track patterns 
More information about these formats is provided below. 
The next word <ntrk> is the number of track chunks in the file. It will always be 1 for a format 0 file. The third word <division> specifies the meaning of the delta-times.

MIDI File Formats 0,1 and 2

A Format 0 file has a header chunk followed by one track chunk. It is the most interchangeable representation of data. It is very useful for a simple single-track player in a program which needs to make synthesisers make sounds, but which is primarily concerned with something else such as mixers or sound effect boxes. It is very desirable to be able to produce such a format, even if your program is track-based, in order to work with these simple programs. 

A Format 1 or 2 file has a header chunk followed by one or more track chunks. programs which support several simultaneous tracks should be able to save and read data in format 1, a vertically one dimensional form, that is, as a collection of tracks. Programs which support several independent patterns should be able to save and read data in format 2, a horizontally one dimensional form. Providing these minimum capabilities will ensure maximum interchangeability.

Track Chunks
The track chunks (type MTrk) are where actual song data is stored. Each track chunk is simply a stream of MIDI events (and non-MIDI events), preceded by delta-time values. The format for Track Chunks (described below) is exactly the same for all three formats (0, 1, and 2)) of MIDI Files. 
Here is the syntax of an MTrk chunk (the + means "one or more": at least one MTrk event must be present):
<Track Chunk>=<chunk type><length><Mtrk event> 
The syntax of an MTrk event is ve:
<MTrk event>=<delta-time><event>
<delta-time> is stored as a variable-length quantity. It represents the amount of time before the following event. If the first event in a track occurs at the very beginning of a track, or if two events occur simultaneously, a delta-time of zero is used. Delta-times are always present. Delta-time is in some fraction of a beat , as specified in the header chunk. 
<event>=<MIDI event> | <sysex event>| <meta-event>

MIDI Hardware and Software


Connectors



MIDI devices are typically connected to each other using MIDI cables. All MIDI cables use the same wiring and have the same type of 5-pin-DIN-type connector on each end. Some instruments offer MIDI communication with a computer using a standard USB cable instead of a MIDI cable. 

Megnatic devices

Interfaces



Its main function is to match clock speeds between the MIDI device and the computer. Some computer sound cards include a standard MIDI connector, whereas others connect by USB, firewire, ethernet or game ports. With the increasing use of USB connectors , MIDI- to- USB interface is also available 


Controllers



There are two types of MIDI controllers: performance controllers that generate notes and are used to perform music, and controllers that may not send notes but transmit other types of real-time events. 
Many devices are some combination of two types. 
examples are keyboard , drum and wind controllers. 


Instruments

A MIDI instrument contains ports to send and receive MIDI signals, a CPU to process those signals, an interface that allows user programming, audio circuitry to genertae sound, and controllers. 

A MIDI instrument can also be a stand-alone module consisting of a general MIDI soundboard, onboard editing, including transposing/pitch changes. It includes a large screen so the user can view information for the currently selected function. It can scroll lyrics, embadedd in a MIDI or karaoke MIDI. Some MIDI modules include a Harmonizer and the ability to playback and transpose MP3 audio files. 

Synthsizers

It is a sound generation techniques. It may include an integrated keyboards, or may exist as sound modules or expanders that generate sounds when triggered by an external controller, such as MIDI keyboard. Sound modules can be designed to be mounted in a 19-inch rack. So it can be in stanalone, rack-mounted or keyboard versions.

Samplers 

It can record and digitize audio, store it in RAM and play it back. It allow a user to edit a sample and save it to a hard disk, apply effects to it and shape it with the same tool that sythesizers use. They also avilable in either keyboard or rack- mounted form. 

Drum machines

Drum machines are simple playback devices that specifies in drum anm and percussion sounds. they contain a sequencer that allows the creation of drum patterns, and allows them to be arranged into a song. In multiple audio aoutputs each sound or group of sounds can be routed to a separate output. The individual drum voices may be playable from another MIDI instrument, or from a sequencer. 

Workstations and hardware sequencers

MIDI sequencers typically are operated by transport features modeled after those of tape decks. They are capable of recording MIDI performances, and arranging them into individual tracks along a multitrack recording concept.  
Music Workstations combine controller keyboards with an internal sound generator and a sequencer. These can be used to build complete arrangements and play them back using their own internal sounds, and functions as self-contained music production studios. They include file storage and transfer capabilities. 

Softwares 

Sequencers

Sequencing software provides a number of benefits to a composer or arranger. It allows recorded MIDI to be manipulated using standard computer editing features such as cut, copy, paste, drag and drop. It allows each channel to be set to play a different sound, and gives a graphical overview of the arrangement. 


Notation/scoring software

Sheet music is automatically transcribed by notes played on a keyboard with MIDI. Scorewiting software typically lacks advanced sequencing tools, and is optimized for the creation of a neat, professional printout designed for live instrumentalists. These programs provide support for dynamics and expression makings, chord and lyric display, and complex score styles. SmartScore software can provide MIDI files form scanned sheet music.

Editor/librarians 

Patch editors allow users to program their equipment through the computer interface. These are essential with complex synthesizers, which contained several thousnds programmable parameters. Digital instruments dont support user experiments but patch editor gives owners of hardware instruments. Some editors are designed for a specific instrument or effects device, while other universal editors support a variety of equipment, and can control parameters of every device in a setup. 
Patch libraians have the specified function of organizing the sound in a collection of equipment, and allow transmission of entire banks of sound between an instrument and a computer. 

Auto-accomplainment programs

Programs taht can dynamically generate accompaniment tracks are called "auto-accompaniment". These creates a full band arrangement in a style that the user selects, and send the reult to a MIDI sound generating device for playback. The generated tracks can be educational or practice tools, as accompaniment for live performances, or as a songwriting aid. 

Synthesis and sampling

Computers can use softwarev to generate sounds, which are vthen passed through a digital-to-analog converter (DAC) to a power amplifier and loudspeaker system. the number of sounds played simultaneously is dependent on the power of the computer's CPU, as are the sample rate and bit depth of playback, which directly affect the quality of the sound. 
Synthesizers implemented in software are subject to timing issues. Timing issues are not present with harware instruments. These issues can cause synchronization problems. It also exhibit a noticable dealy known as latency in their sound generation. 







No comments

Powered by Blogger.