Presentation is loading. Please wait.

Presentation is loading. Please wait.

Audio 1 Subject:T0934 / Multimedia Programming Foundation Session:8 Tahun:2009 Versi:1/0.

Similar presentations

Presentation on theme: "Audio 1 Subject:T0934 / Multimedia Programming Foundation Session:8 Tahun:2009 Versi:1/0."— Presentation transcript:

1 Audio 1 Subject:T0934 / Multimedia Programming Foundation Session:8 Tahun:2009 Versi:1/0

2 Bina Nusantara Learning Outcomes In the end of this session, students must be able to: –Understand the basic principal of audio digitization and enhancement –Identify Java Sound API syntax to manipulate basic audio properties

3 Outline Audio Digitization MIDI Audio Quantization and Transmission Java Sound API Bina Nusantara

4 A Typical Audio Architecture Bina Nusantara

5 Sound Sound are rapid vibrations that are transmitted as variations in air pressure To use sound digitally, we must digitize (converse to a stream of numbers) the analog sound first Bina Nusantara Time Amplitude Analog signal of sound

6 Sound Digitization To fully digitize the sound, we have to sample in Time (Sampling) and in Amplitude (Quantization) Bina Nusantara Sampling Quantization

7 Sampling –Measuring at evenly spaced intervals Sampling Rate –Known as sampling frequency, measured in Hertz (Hz) Nyquist Rate –To have a correct sampling, sampling rate should equal to at least twice the maximum frequency –If sampling rate is lower than Nyquist rate, it will result in false (alias) frequency Bina Nusantara

8 Quantization Sampling in the amplitude dimension, represented in fixed numbers of bits (8, 12, or 16 bits) Bina Nusantara Results in a loss of precision which is called distortion (or called quantization noise) Dithering (adding random noise to quantized audio) can be used to remove some of the distortion Original audio wave Quantization error wave Quantized audio wave

9 Common Rates QualitySample Rate (kHz) QuantizationMono/StereoFrequency Range Telephone88Mono200-3400 AM Radio11,0258Mono100-5500 FM Radio22,0516Stereo20-11000 CD44,116Stereo5-20000 DAT4816Stereo5-20000 DVD audio192 (max)24 (max)Up to 6 channels 96000 (max) Bina Nusantara

10 Sampled Audio Format Bina Nusantara File Type Acronym For Originally Created By Type of CompressionPlatforms.aiff Audio Interchange File Format Apple, adopted later by Silicon Graphics usually not compressed, but has a compressed version Apple Macintosh and Silicon Graphics computers, and now also on Windows.wav IBM and Microsoft supports a number of different compression formats primarily for Windows, but can be run on in other and.snd Also called mu-law or Sun mu-law format Sun and NeXT mu-law encoding compresses the file at a ratio of 2:1; slow decompression Sun, NeXT, Unix or Linux operating system.mp3MPEG audio layer 3 Moving Pictures Experts Group good compression rate with high quality sound cross-platform

11 Synthesizing Sounds Frequency Modulation (FM) –Producing new audio signal using a source waveform’s frequency is changed by a modulating frequency –Based on the same principles used for FM radio trasmission –Used in low-end versions of Creative Sound Blaster PC sound card Wave-Table –More accurate way reproducing sound –Using actual samples of real instruments –More expensive than FM synthesis (partly because of larger data storage) Bina Nusantara

12 MIDI Musical Instrument Digital Interface A scripting language that codes events (MIDI messages + timings) Enable computers, synthesizers, keyboards, and other musical devices to communicate with each others. Bina Nusantara

13 A Possible MIDI Configuration Bina Nusantara

14 Synthesizers A sound generator that can vary pitch, loudness, and tone color. Now included on PC sound cards. The units that generate sound are called tone/sound modules. Bina Nusantara

15 Sequencers In the beginning, a special hardware device for storing and editing a sequence of musical events (MIDI data) Now, a software music editor on the computer Bina Nusantara

16 MIDI keyboards A keyboard that produces MIDI messages, not sound Bina Nusantara

17 MIDI Messages Sequences of MIDI instructions Bina Nusantara MIDI messages Channel messages Voice messages Mode messages System messages Common messages Real-time messages Exclusive messages

18 Channel Messages Voice Messages –Sends information of which note to play –Used to control sustain, vibrato, tremolo, and pitch Mode Messages –Determines how an instrument processes MIDI voice messages (to respond all messages, respond just to correct channel, don’t respond at all, etc) Bina Nusantara

19 System Messages For commands that are not channel- specific Common messages –Relates to timing or positioning Real-time messages –Relates to synchronization Exclusive messages –Included so manufacturers can extend the MIDI standard Bina Nusantara

20 MIDI standard General MIDI (GM1) –Standard for assigning instruments to patch numbers so MIDI music can sound more or less the same on every machine –Ex : patch no.1 = piano General MIDI level 2 (GM2) –Extended General Midi, with SMF (Standard MIDI File) format defined. –Includes extra character of information such as karaoke lyrics –Increases the number of available sounds –Increases the amount of control available for sound editing and musical performance General MIDI Lite (GML) –For mobile applications Bina Nusantara

21 Standard MIDI Files a digital file that contains MIDI events was developed in 1990 for file exchange between MIDI sequencers The information in a standard MIDI file is referred to as a sequence contains one or more tracks which each typically contains the notes of a single instrument Bina Nusantara

22 Java Sound API Supports both sampled audio and MIDI data javax.sound.sampled –This package specifies interfaces for capture, mixing, and playback of digital (sampled) audio. javax.sound.midi –This package provides interfaces for MIDI synthesis, sequencing, and event transport. Bina Nusantara

23 Playing Sound Bina Nusantara Full code downloadable in Additional Materi.

24 Playing MP3 Bina Nusantara Create mp3 player Open MP3 file and start player

25 Playing MP3 Bina Nusantara Getting controller component Result Note : This program use JMF to play MP3 file. Full code is downloadable in Additional Materi

26 Playing WAV Bina Nusantara Create player from file Open WAV file Getting music length

27 Playing WAV Bina Nusantara Setting control for control the music

28 Playing MIDI Bina Nusantara Full code downloadable in Additional Materi.

29 References Basics of Digital Audio. 2001. Developing a Strategy for Creating and Assessing Digital Media Curriculum Material. 2004. Midi. 2008. Trail: Sound. 2008. The Java Sound API. 2009. Sound. 2009. Bina Nusantara

Download ppt "Audio 1 Subject:T0934 / Multimedia Programming Foundation Session:8 Tahun:2009 Versi:1/0."

Similar presentations

Ads by Google