Digital Sound Representation & Introduction to Software Synthesis Electronic Music Studio TU Berlin Institute of Communications Research

Slides:



Advertisements
Similar presentations
Analog Representations of Sound Magnified phonograph grooves, viewed from above: When viewed from the side, channel 1 goes up and down, and channel 2 goes.
Advertisements

Sound Synthesis Part II: Oscillators, Additive Synthesis & Modulation.
The Sounds of Music.
Tamara Berg Advanced Multimedia
Digital Signal Processing
Sound can make multimedia presentations dynamic and interesting.
I Power Higher Computing Multimedia technology Audio.
SWE 423: Multimedia Systems Chapter 3: Audio Technology (2)
Speech Compression. Introduction Use of multimedia in personal computers Requirement of more disk space Also telephone system requires compression Topics.
What makes a musical sound? Pitch n Hz * 2 = n + an octave n Hz * ( …) = n + a semitone The 12-note equal-tempered chromatic scale is customary,
The Illinois Society of Electroneurodiagnostic Technologists (ISET) Fall Meeting: Electronics Crash Course for Technologists Saturday, November 9, 2013.
Motivation Application driven -- VoD, Information on Demand (WWW), education, telemedicine, videoconference, videophone Storage capacity Large capacity.
SIMS-201 Characteristics of Audio Signals Sampling of Audio Signals Introduction to Audio Information.
SWE 423: Multimedia Systems Chapter 3: Audio Technology (1)
IT-101 Section 001 Lecture #8 Introduction to Information Technology.
Digital Audio.
CHAPTER 5 Discrete Sampling and Analysis of Time-Varying Signals Analog recording systems, which can record signals continuously in time, digital data-acquisition.
Image and Sound Editing Raed S. Rasheed Sound What is sound? How is sound recorded? How is sound recorded digitally ? How does audio get digitized.
Digital Signal Processing (DSP) Fundamentals. Overview What is DSP? Converting Analog into Digital –Electronically –Computationally How Does It Work?
What is Csound? a programming language for sound generationa programming language for sound generation uses software synthesis to compile user-defined.
Chapter 2 Fundamentals of Data and Signals
Module 3.0: Data Transmission
Music Processing Roger B. Dannenberg. Overview  Music Representation  MIDI and Synthesizers  Synthesis Techniques  Music Understanding.
EE2F2 - Music Technology 8. Subtractive Synthesis.
1 Chapter 2 Fundamentals of Data and Signals Data Communications and Computer Networks: A Business User’s Approach.
Fundamentals of Digital Audio. The Central Problem n Waves in nature, including sound waves, are continuous: Between any two points on the curve, no matter.
Digital Audio Multimedia Systems (Module 1 Lesson 1)
 Principles of Digital Audio. Analog Audio  3 Characteristics of analog audio signals: 1. Continuous signal – single repetitive waveform 2. Infinite.
infinity-project.org Engineering education for today’s classroom 53 Design Problem - Digital Band Build a digital system that can create music of any.
A Brief Exploration of Electronic Music and its Theory By: Zac Changnon.
Digital audio. In digital audio, the purpose of binary numbers is to express the values of samples that represent analog sound. (contrasted to MIDI binary.
Thursday 27 th September. Periods Music Technology A2.
School of Informatics CG087 Time-based Multimedia Assets Sampling & SequencingDr Paul Vickers1 Sampling & Sequencing Combining MIDI and audio.
Digital Sound and Video Chapter 10, Exploring the Digital Domain.
Introduction to Interactive Media 10: Audio in Interactive Digital Media.
Radio production worktext.  Analog to Digital  Analog signal – continuously variable electrical signal whose shape is determined by the shape of the.
Lecture 1 Signals in the Time and Frequency Domains
Data Communications & Computer Networks, Second Edition1 Chapter 2 Fundamentals of Data and Signals.
Multimedia Technology Digital Sound Krich Sintanakul Multimedia and Hypermedia Department of Computer Education KMITNB.
ACOUSTICS AND THE ELEMENTS OF MUSIC Is your name and today’s date at the top of the worksheet now?
COMP Representing Sound in a ComputerSound Course book - pages
Lecture 5: Signal Processing II EEN 112: Introduction to Electrical and Computer Engineering Professor Eric Rozier, 2/20/13.
Synthesis advanced techniques. Other modules Synthesis would be fairly dull if we were limited to mixing together and filtering a few standard waveforms.
Art 321 Sound, Audio, Acoustics Dr. J. Parker. Sound What we hear as sound is caused by rapid changes in air pressure! It is thought of as a wave, but.
CSC361/661 Digital Media Spring 2002
Computer Some basic concepts. Binary number Why binary? Look at a decimal number: 3511 Look at a binary number: 1011 counting decimal binary
Media Representations - Audio
Digital Recording Theory Using Peak. Listening James Tenney, Collage #1 (“Blue Suede”),  Available in Bracken Library, on James Tenney Selected.
Physics 1251 The Science and Technology of Musical Sound Unit 4 Session 37 MWF Synthesizers Unit 4 Session 37 MWF Synthesizers.
Basics of Digital Audio Outline  Introduction  Digitization of Sound  MIDI: Musical Instrument Digital Interface.
Sound and audio. Table of Content 1.Introduction 2.Properties of sound 3.Characteristics of digital sound 4.Calculate audio data size 5.Benefits of using.
Introduction to SOUND.
Csound. a language for describing sound. General History. Developed by Barry Vercoe at MIT. Extended by too many people to mention. Based initially on.
ECE 4710: Lecture #6 1 Bandlimited Signals  Bandlimited waveforms have non-zero spectral components only within a finite frequency range  Waveform is.
The Physical Layer Lowest layer in Network Hierarchy. Physical transmission of data. –Various flavors Copper wire, fiber optic, etc... –Physical limits.
Subtractive Sound Synthesis. Subtractive Synthesis Involves subtracting frequency components from a complex tone to produce a desired sound Why is it.
1 Introduction to Information Technology LECTURE 6 AUDIO AS INFORMATION IT 101 – Section 3 Spring, 2005.
Sound Representation Digitizing Sound Sound waves through Air Different Voltages Voltage converted to numbers.
Analogue & Digital. Analogue Sound Storage Devices.
Chapter 12 The Principles of Computer Music Contents Digital Audio Processing Noise Reduction Audio Compression Digital Rights Management (DRM)
1 Manipulating Audio. 2 Why Digital Audio  Analogue electronics are always prone to noise time amplitude.
Analog/Digital Conversion
Multimedia Sound. What is Sound? Sound, sound wave, acoustics Sound is a continuous wave that travels through a medium Sound wave: energy causes disturbance.
1 What is Multimedia? Multimedia can have a many definitions Multimedia means that computer information can be represented through media types: – Text.
Digital Audio I. Acknowledgement Some part of this lecture note has been taken from multimedia course made by Asst.Prof.Dr. William Bares and from Paul.
Lifecycle from Sound to Digital to Sound. Characteristics of Sound Amplitude Wavelength (w) Frequency ( ) Timbre Hearing: [20Hz – 20KHz] Speech: [200Hz.
FUNCTION GENERATOR.
Multimedia Systems and Applications
Analogue & Digital.
Introduction to Csound 5.
Presentation transcript:

Digital Sound Representation & Introduction to Software Synthesis Electronic Music Studio TU Berlin Institute of Communications Research Prof Eduardo R Miranda Varèse-Gastprofessor

Topics: Digital representation of sound Software sound synthesis fundamentals Sound synthesis programming with Csound: Introduction to Csound

Digital Representation of Sound What is a sound? From a physical point of view, it is the result of a mechanical disturbance of some object in a physical medium, such as air. This mechanical disturbance generates vibrations that can be represented as electrical signals by means of a device (for example, a microphone), that converts these vibrations into a time-varying voltage.

Analog vs. Digital An analog sound signal is the result of measuring the voltage that represents the sound. These kinds of signals are continuous in the sense that they consist of a continuum of constantly changing values. A digital sound is the result of counting all these values many times per second for a certain defined length/time. Each measurement value is called a sample, and this kind of process is called sampling. In order to process sounds on the computer, the analog sound must be converted into a digital format understandable by computer; that is, binary numbers.

The process of converting a sound (e.g., coming from an instrument such as the violin) into a digital representation: a) a microphone or a line-level source converts sound into voltage b) an analog-to-digital converter then converts voltage into binary numbers c) a computer stores the resulting sound Analog sound into a digital sound

16-bit conversion suffices for home- quality recording Professional quality recording often uses 32-bit and 64-bit words Analog-to-digital converter (ADC) are devices used to convert the waveform into a succession of binary numbers, each representing the voltage level at a given instant. Digital-to-analog converter (DAC), converts binary numbers (i.e., digital sound representation) into analog signals in order to play the sound.

Computers are normally configured to function based upon strings of bits (binary numbers) of fixed size, called words. For example, a computer configured for processing 4-bit words would represent the decimal numbers 0,1,2 and 3 as the binary numbers 0000 = = = = = = 6 etc.

Sampling theorem The analog-to-digital conversion process is called sampling. The frequency of a sound is equal to the number of cycles which occur every second ("cycles per second", abbreviated "cps" or "Hz"). In order to convert an analog sound signal into digital representation one needs to sample the signal many times per second. The frequency of this sampling process is called sampling frequency or sampling rate, and it is measured in Hertz (Hz).

The sampling theorem states that in order to accurately represent a sound digitally, the sampling rate must be higher than at least twice the value of the highest frequency contained in the signal. The average upper limit of human hearing is approximately 18 kHz (18000 Hz), which implies a minimum sampling rate of 36 kHz (36000 Hz). The sampling rate frequently used in computer sound design systems is 44.1 kHz (44100 Hz).

Aliaising distortion Nyquist frequency is the name of the highest frequency that can theoretically be represented in a digital audio system. It is calculated as half of the value of the sampling rate. Passing this level causes aliasing distortion, or foldover.

A word, for instance, could be 4-bits long or 16-bits long etc. Unsatisfactory lower resolutions are prone to cause a damaging loss of sound quality, referred to as quantization noise. Sampling quality The level of resolution, or quantization of a sampler: depends upon the size of the word used to represent the amplitude of a sampling sound and is determined by the resolution of the ADC and DAC.

Sound examples The following four sound examples were sampled from a mono sound, 4027 milliseconds long, sampled at Hz, Hz, 2756 Hz and 2000 Hz, respectively. The last file uses only 17 kB to store the sound, but it is considerably distorted when compared to the first example, which uses 367 kB. a) [Example 1] samples per second results in a sound file of 367 kBExample 1 b) [Example 2] samples per second results is a sound file of 93 kBExample 2 c) [Example 3] 2756 samples per second results in a sound file of 23 kBExample 3 d) [Example 4] 2000 samples per second results in a sound file of 17 kBExample 4

The ability to adjust the sample rate affects the length of a sample for a given number of samples. This will affect the size of the digital sound file in a storage system. There is a penalty to be paid for the lower rate: a narrower band of frequencies will be recorded. The problem is that acoustic sounds are in fact composed of many sound components called partials. I In the majority of cases, most of these partials are of very high frequencies. If the sampling frequency is too low, the computer will not capture these high frequency components and this causes distortion. Comments

Software Sound Synthesis

Unit generators Synthesis programming languages provide a number of synthesis subroutines, usually referred to as unit generators. (Inspired by the modules of an analog synthesiser). Synthesis instruments are designed and programmed by connecting a number of unit generators. Most basic unit generator of a synthesis programming language or systems is the oscillator.

Digital oscillator

The speed at which the lookup table is scanned defines the frequency of the sound. The lookup table contains a list of samples for one cycle of the waveform, which does nor necessarily need to be a sinusoid. The specification of an oscillator on a computer typically involves: - Frequency - Amplitude - Waveform

Other synthesis units Function generators: create lookup tables for the oscillators and for sound transformation and control (“GEN routines” in Csound). GEN routines fill data tables with values produced with specified procedures or mathematical formulae such as trigonometric functions and polynomials (the length is usually specified as a power of two (2 9 = 512, 2 10 = 1024, etc.) Signal modifiers: filters, envelopes, etc. Envelops add time-varying control to synthesis instruments.

Introduction to Csound Has its origins in the early 1960’s at Bell Telephone Research Lab (New Jersey, USA) by Max Matthews – first computer music language called Music 3. Early 1970’s Barry Vercoe created a version called Music 11 (for PDP 11 computer) at MIT. Later Berry Vercoe re-made Music 11 in the C language, thereby creating Csound.

Separate control rate and audio rate processing. Audio rate is the same as the sampling rate. Control rate is a slower rate used to shape certain features of the sound. It is widely portable under C and UNIX. It is structured in a way that allows for further developments; e.g., in 1992 real-time control under MIDI was introduced. User can add their own functions. Main features

The structure of the language The composer needs to specify two types of files: orchestra and score files The orchestra file has 2 sections: headers and instrument definition Header: specifies global issues of the synthesis algorithm: sampling rate, number of channels, etc. (Note: anything after “;” is regarded as a comment and is not considered when the program runs). sr = 22050; the sampling rate is set to samples per second kr = 1470; there will be 1470 control point per second ksmps = 15; there will be a control point every 15 sound samples sr/kr nchnls = 1 ; mono sound eg1

Instrument definition: defines the synthesis algorithm. The following example shows a simple instrument composed of a single sinewave oscillator instr 1; start the definition of instrument 1 a1 oscil 10000, 440, 1; make an audio rate oscillator with an ; amplitude of 10000, at a frequency of 440 Hz, ; using wavetable number 1 out a1; output audio signal endin ; end of instrument eg1

The complete orchestra file looks like this: ; sr = kr = 1470 ksmps = 15 nchnls = 1 ; instr 1 a1 oscil 10000, 440, 1 out a1 endin ; Hz GEN 1 eg1

Score: defines what the instrument is going to do. The score comprises: 1.Definition of the wavetable(s) used in the instrument 2.Timed event triggers; e.g., note sequences Wavetable definition: function table (hence the use of an “f”) at the beginning of the line. Example: wavetable 1, comes to take effect from time 0, with 4096 elements, using GEN no. 10 (GEN = generator function), with only one harmonic (which in this case defines a sinewave) ;name start size GEN relative strength f

The second part of the score defines a note event for the instrument, starting at time 0 and lasting for 4 secs ;instr start duration i1 0 4 e In this case, frequency (pitch) and amplitude are state in the orc file

The complete orchestra and score files look like this: ; sr = kr = 1470 ksamps = 15 nchanls = 1 ; instr 1 a1 oscil 10000, 440, 1 out a1 endin ; f ; i1 0 4 e Hz GEN 1 eg1

pfields (p = score parameters): ; sr = kr = 1470 ksmps = 15 nchnls = 1 ; instr 1 a1 oscil p4, p5, 1 out a1 endin ; f ; ;p1 p2 p3 p4 p5 ; i e p4 p5 GEN 1 p1 = instrument p2 = start time p3 = duration p4 = amplitude p5 = frequency eg2

Examples of scores for the simple oscil instrument: (by Andy Hunt, Uni of York, from CDP tutorial) ; ; 3 note melody ; f ; ;p1 p2 p3 p4 p5 ; i i i e ; sr = kr = 1470 ksmps = 15 nchnls = 1 ; instr 1 a1 oscil p4, p5, 1 out a1 endin ; eg3

Examples of scores for the simple oscil instrument: (by Andy Hunt, Uni of York, from CDP tutorial) ; ; Overlapping notes ; f ; ;p1 p2 p3 p4 p5 ; i i i i i i e ; sr = kr = 1470 ksmps = 15 nchnls = 1 ; instr 1 a1 oscil p4, p5, 1 out a1 endin ; eg4

Examples of scores for the simple oscil instrument: (by Andy Hunt, Uni of York, from CDP tutorial) ; ; Overlapping with different amplitudes ; f ; ;p1 p2 p3 p4 p5 ; i i i i i i e ; sr = kr = 1470 ksmps = 15 nchnls = 1 ; instr 1 a1 oscil p4, p5, 1 out a1 endin ; eg5

Examples of scores for the simple oscil instrument: (by Andy Hunt, Uni of York, from CDP tutorial) ; ; Simultaneous starts ; f ; ;p1 p2 p3 p4 p5 ; i i i i i i e ; sr = kr = 1470 ksmps = 15 nchnls = 1 ; instr 1 a1 oscil p4, p5, 1 out a1 endin ; eg6

Amplitude envelopes (or envelops) May synthesisers feature enveloping functions called ADSR: Attack = time from the start to the peak of the sound Decay = loss of volume from the initial peak Sustain = the continuation level of the sound until release Release = speed at which the sound dies away

linen A Csound unit commonly used for making an envelope. Specified with the following parameters: Amplitude = peak amplitude of the sound Rise = attack time Duration = total duration of the sound Decay = period at which the sound dies away

Example ;ORC sr = kr = 1470 ksmps = 15 nchnls = 1 ; instr 1 k1 linen p4, p6, p3, p7 a1 oscil k1, p5, 1 out a1 endin ; ;OSC f ; i i i i i e p1 = instrument p2 = start time p3 = duration p4 = amplitude p5 = frequency p6 = rise p7 = decay eg7

Perceptual role of attack As the attack gets shorter and shorter the whole character of the sound alters ;OSC f ; i i i i i i i i i i i i i i i i e eg8

Pitch notation N.00, ‘N’ = the octave and ’00’ the pitch middle C is octave N=8.00 = varies from 00 = C to 11 = B Examples Csound Note MIDI Frequency 8.00 C Hz 8.01 C4# Hz 8.02 D Hz 8.03 D4# Hz 8.04 E Hz 8.05 F Hz 8.06 F4# Hz 8.07 G Hz 8.08 G4# Hz 8.09 A Hz 8.10 A4# Hz 8.11 B Hz

Example ;ORC sr = kr = 1470 ksmps = 15 nchnls = 1 ; instr 1 inote=cpspch(p5) k1 linen p4, p6, p3, p7 a1 oscil k1, inote, 1 out a1 endin ; ;OSC f ; i i i i i e p1 = instrument p2 = start time p3 = duration p4 = amplitude p5 = octave.pitch notation p6 = rise p7 = decay eg9

Example ;ORC sr = kr = 1470 ksmps = 15 nchnls = 1 ; instr 1 inote=cpspch(p5) iamp=ampdb(p4) k1 linen iamp, p6, p3, p7 a1 oscil k1, inote, 1 out a1 endin ; ;OSC f ; i i e p1 = instrument p2 = start time p3 = duration p4 = amplitude in dB p5 = octave.pitch notation p6 = rise p7 = decay eg10

Chorusing effect Technique to enrich or make the sound fuller. Done by creating beat frequencies; that is by playing copies of the note at slightly different frequencies.

;ORC CHORUS sr = kr = 1470 ksmps = 15 nchnls = 1 ; instr 1 inote=cpspch(p5) iamp=ampdb(p4) k1 linen iamp, p6, p3, p7 a1 oscil k1, inote, 1 a2 oscil k1, inote*0.99, 1 a3 oscil k1, inote*1.01,1 aout=(a1+a2+a3)/3 out aout endin ; ;OSC CHORUS f ; i i e eg11

Timbre-migrating instrument ;ORC MIGRATING sr = kr = 1470 ksmps = 15 nchnls = 1 ; instr 1 inote=cpspch(p5) ;amplitude envelope k1 linen p4, p6, p3, p7 ;transition control k2 linseg 1, p3*0.2, 1, p3*0.6, 0, p3*0.2, 0 a1 oscil k1, inote, 1 a2 oscil k1, inote, 2 out (a1*k2)+(a2*(1-k2)) endin ;SCO MIGRATING f f ; i i i i i i eg12

Defined pitch-space filled with glissando texture (from CDP Csound Tutorial Instrument Library) eg13

Defined pitch-space filled with glissando texture

Further reading: Getting Started with Csound, by Andy Hunt (PDF file tutorial1.pdf) CDP’s Csound Tutorial Instrument Library (PDF file tutorial2.pdf)