introduction to midi & music synthesisgutierre/ctlect08.pdf · introduction to midi & music...

of 21/21
Introduction to MIDI & Music Synthesis Lecture

Post on 27-Aug-2018




0 download

Embed Size (px)


  • Introduction to MIDI & Music Synthesis


  • Topics today

    Synthetic sounds

    MIDI Basics

    Wavetable synthesis

    Few Techniques for Wavetable synthesis

    Multimedia Computing (CSIT 410) 2

  • Synthetic Sounds

    1. FM (Frequency Modulation): one approach to generating synthetic sound:

    x(t)= A(t)cos[ct + I(t)cos(mt+m)+c]

    Multimedia Computing (CSIT 410) 3

  • Frequency Modulation

    Multimedia Computing (CSIT 410)

    (a): A single frequency. (b): Twice the frequency. (c): Usually, FM is carried out usinga sinusoid argument to a sinusoid. (d): A more complex form arises from a carrierfrequency, 2t and a modulating frequency 4t cosine inside the sinusoid.


  • Wave Table synthesisA more accurate way of generatingsounds from digital signals. Also known,simply, as sampling.In this technique, the actual digitalsamples of sounds from real instrumentsare stored. Since wave tables are storedin memory on the sound card, they canbe manipulated by software so thatsounds can be combined, edited, andenhanced.

    Multimedia Computing (CSIT 410) 5

  • MIDI

    Efficient method for representing musicalperformance informationOne minute music commonly requires 5Mbytes, whereas MIDI for 1 min requires 1Kbytes.

    MIDI does not contain sampled audio data,instead the instructions (MIDI Messages) that thesynthesizer can use to generate soundEasy to edit the music, change the playback speedand the pitch or key of the sounds independently.

    Multimedia Computing (CSIT 410) 6

  • MIDI Basics

    Provide the means for conveying themusical performances efficiently10 bits transmitted per byte (including 1start & 1 stop bits, as zeros)MIDI interface on a MIDI device containsconnectors


    Multimedia Computing (CSIT 410) 7

  • MIDI Basics [2]MIDI data stream originates fromMIDI controller such as MIDISequencer, KeyboardThe recipient of the MIDI stream isthe MIDI Sound generator or soundmodule16 logical channels, identified byincluding 4 bit channel number withthe MIDI messages

    Multimedia Computing (CSIT 410) 8

  • MIDI Basics [3]

    Multimedia Computing (CSIT 410)

    MIDI System


  • MIDI Messages

    A message is composed of a status byte, followed by one or two bytes of dataClassified as

    Channel messages (First bit 1)Channel voice messages Channel Mode messages

    System Messages (First 4 bits 1)System Common messagesSystem Real-time MessagesSystem Exclusive Messages

    MIDI messages tables

    Multimedia Computing (CSIT 410) 10

  • MIDI Sequencers & synthesizers

    SequencersAdds time-stamping to the MIDI messages

    SynthesizerPolyphonicHelps sending MIDI messages to MIDI synthesizer

    Ability to play more than one note at a timeMultitimbral Mode

    Capable of producing two or more different instrumentsounds simultaneouslyIf a synthesizer can play five notes simultaneously, and itcan produce a piano sound and an acoustic bass sound atthe same time, then it is multitimbral and polyphonic.

    Multimedia Computing (CSIT 410) 11

  • Standard MIDI Files

    MIDI messages are stored in disks as MIDIfilesMIDI file is the major source of music incomputer games, CD Entertainment titlesThe file format is SMF (Standard MIDIFormat)SMF file stores standard MIDI messagesalong with the appropriate timing informationSMF files organizes data in chunks, precededby ID and size

    Multimedia Computing (CSIT 410) 12

  • Standard MIDI Files [2]

    A chunk is a group of related data itemsEach chunk begins with 4 characters ID, saying thetype of the chunk, next 4 bytes forms the size of thechunk. ID & size forms the chunk headerMIDI Chunks are of following types


    What does the header following header mean?4D 54 68 64 00 00 00 06

    More on MIDI file format

    Multimedia Computing (CSIT 410) 13

  • Wavetable Synthesis

    Stores high quality sound samplesdigitally & plays it on demandTable of sound waveforms which may belooked up and utilized when needed,hence the name Wavetable.Amount of memory required to storethese samples can be reduced bytechniques collectively called asWavetable Synthesis Techniques

    Multimedia Computing (CSIT 410) 14

  • Technique-1Looping and Envelope Generation

    Attack & Sustain portions of a waveform

    Looping of a Sample Segment

    Multimedia Computing (CSIT 410) 15

  • Technique-1Looping and Envelope Generation [2]

    The fairly constant sustain section can be represented by looping the wave samples, multiplied by the gain-factor (governed by ADSR envelope)

    A waveform is stored with

    A sample of Attack sectionA sample for the loop in sustain section

    ADSR Amplitude Envelope

    Multimedia Computing (CSIT 410) 16

  • Technique-1Looping and Envelope Generation [3]

    Loop length is measured as the number ofsamplesSample whose sound cannot beadequately modeled as ADSR, such asshort sounds or sounds of dynamicbehavior, cannot be looped. These soundsare called one-shot sounds

    Multimedia Computing (CSIT 410) 17

  • Technique-2 Pitch Shifting

    Technique to generate number ofdifferent notes from single sound sampleof a given instrumentPitch shifting can be accomplished byreading the stored sample at differentratesAllowing the sample pointer to have onlyinteger increments restricts the pitchshifts to a limited setIn general, sample pointer consists ofintegers, as well as fractional pointers

    Multimedia Computing (CSIT 410) 18

  • Technique-2 Mathematical Interpolation

    Sample memory addressing and Interpolation

    For More on Wavetable synthesis, refer reference number 1 quoted at the end of this presentationMultimedia Computing

    (CSIT 410) 19

  • MIDI to WAV Conversion

    Some programs, such as early versions ofPremiere, cannot include .mid files -- instead,they insist on .wav format files.

    a) Various shareware programs exist for approximatinga reasonable conversion between MIDI and WAVformats.

    b) These programs essentially consist of large lookupfiles that try to substitute pre-defined or shifted WAVoutput for MIDI messages, with inconsistent success.

    Multimedia Computing (CSIT 410) 20

  • Reference

    1. Tutorial on MIDI and Music Synthesis,

    2. Several Tutorials on MIDI:

    3. Chapter 6

    Multimedia Computing (CSIT 410) 21