The Csound Orchestra semi-colon begins a commentsemi-colon begins a comment Csound ignoresCsound ignores everything on the line after the semi-coloneverything.

Slides:



Advertisements
Similar presentations
Basic Tools for Understanding Synthesis. Synthesizer A musical instrument that produces waveforms, typically in the audio range of about 20 to 20,000.
Advertisements

Sound Synthesis Part II: Oscillators, Additive Synthesis & Modulation.
Simple FM Instruments John Chowning's FM Designs as shown in Dodge, Computer MusicJohn Chowning's FM Designs as shown in Dodge, Computer Music brass-like.
The Csound Score a group of function tables and list of note statementsa group of function tables and list of note statements combining score with orchestra.
HasSound: Generating Musical Instrument Sounds in Haskell Paul Hudak Yale University Department of Computer Science Joint work with: Matt Zamec (Yale ‘00)
Digital Sound Representation & Introduction to Software Synthesis Electronic Music Studio TU Berlin Institute of Communications Research
David Meredith Minim David Meredith
Frequency Modulation related to musical vibratorelated to musical vibrato Vibrato - Periodic variation of frequencyVibrato - Periodic variation of frequency.
Modulation: CHORUS AND FLANGE  Just as a chorus is a group of singers, the chorus effect can make a single instrument sound like there are actually.
Unit Generators and V.I.s Patches are configurations of V.I.s Both Patches & Virtual Instruments can be broken down into separate components called Unit.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 16: Exception Handling.
Comb Filters Good model for exponentially decaying echoesGood model for exponentially decaying echoes impulse input: output: (scaling factor =.9)
Introduction to electronics lab ENGRI 1810 Using: Solderless prototype board (white board) Digital multimeter (DMM) Power Supply Signal Generator Oscilloscope.
ReverbReverb Reverberation is made up of many reflections.Reverberation is made up of many reflections. Reverb simulation is more complex than the filters.Reverb.
Oscillator Algorithm. L-1 SI PHS Sampling Increment (determines frequency) Phase Count (0 ≤ PHS < L) Waveform Table 0 Output.
SamplingSampling plays back samples of the original tone.plays back samples of the original tone. For simple decaying tones (e.g., piano, harp, marimba,
Copyright © 2011 by Denny Lin1 Simple Synthesizer Part 4 Based on Floss Manuals (Pure Data) “Building a Simple Synthesizer” By Derek Holzer Slides by Denny.
Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3.
What is Csound? a programming language for sound generationa programming language for sound generation uses software synthesis to compile user-defined.
Additive Synthesis Any periodic waveform can be expressed as the sum of one or more sine wavesAny periodic waveform can be expressed as the sum of one.
Comp342 Computer Music Course Objectives. 1. General Appreciation –1.1. Have a general appreciation of the use of music in computer applications 2. Music.
1 Lecture 2  Input-Process-Output  The Hello-world program  A Feet-to-inches program  Variables, expressions, assignments & initialization  printf()
Parameter (p) Variables contain the score parameter values for each notecontain the score parameter values for each note allow score to control orchestraallow.
1 Manipulating Digital Audio. 2 Digital Manipulation  Extremely powerful manipulation techniques  Cut and paste  Filtering  Frequency domain manipulation.
Methods for Tone and Signal Synthesis R.C. Maher ECEN4002/5002 DSP Laboratory Spring 2002.
Additional Notes on Wavetable Synthesis R.C. Maher ECEN4002/5002 DSP Laboratory Spring 2002.
Comp685B Computer Music. Recommended Books: Computer Music by Charles Dodge & T. Jerse, Schirmer Books, 2nd Edition, 1997.Computer Music by Charles Dodge.
Music Processing Roger B. Dannenberg. Overview  Music Representation  MIDI and Synthesizers  Synthesis Techniques  Music Understanding.
Guide To UNIX Using Linux Third Edition
EE2F2 - Music Technology 8. Subtractive Synthesis.
infinity-project.org Engineering education for today’s classroom 53 Design Problem - Digital Band Build a digital system that can create music of any.
PULSE MODULATION.
AC Waveform and AC Circuit Theory Md Shahabul Alam Dept: EEE.
Synthesis Basics (1) Analog Synthesis Intro to Digital Oscillators.
ELECTRICAL CIRCUIT ET 201 Define and explain characteristics of sinusoidal wave, phase relationships and phase shifting.
PHY 202 (Blum)1 Analog-to-Digital Converter and Multi-vibrators.
COSC 1P02 Introduction to Computer Science 4.1 Cosc 1P02 Week 4 Lecture slides “Programs are meant to be read by humans and only incidentally for computers.
PHY 202 (Blum)1 Analog-to-Digital Converter and Multi-vibrators.
Reason Devices Subtractor. Oscillators Select Waveform The Subtractor has two oscillators that can be used as sound sources for your patches Tuning Mix:
By Van Bucsko May 7, Intro – What is SAOL? SAOL is a standard programming language that specifies sound as a computer program that generates audio.
Copyright © 2011 by Denny Lin1 Computer Music Synthesis Chapter 6 Based on “Excerpt from Designing Sound” by Andy Farnell Slides by Denny Lin.
Csound. a language for describing sound. General History. Developed by Barry Vercoe at MIT. Extended by too many people to mention. Based initially on.
Chapter 14: Exception Handling. Objectives In this chapter, you will: – Learn what an exception is – Learn how to handle exceptions within a program –
Chapter 12 The Principles of Computer Music Contents Digital Audio Processing Noise Reduction Audio Compression Digital Rights Management (DRM)
Variables and Algebraic Expressions 1-3. Vocabulary Variable- a letter represents a number that can vary. Constant- a number that does not change. Algebraic.
Copyright 2004 Ken Greenebaum Introduction to Interactive Sound Synthesis Lecture 14: Envelopes Ken Greenebaum.
Velleman Oscilloscope: Windows 7 by Mr. David Fritz.
Microcomputer Systems Final Project “Speaker and Sound Modulation”
When a signal is transmitted over a channel, the frequency band and bandwidth of the channel must match the signal frequency characteristics. Usually,
Phasors and Kirchhoff’s Current Law
Digital Oscillators. Everything is a Table A table is an indexed list of elements (or values) A digital oscillator or soundfile is no different.
Digital Oscillators. Everything is a Table A table is an indexed list of elements (or values) A digital oscillator or soundfile is no different.
COSC 1P02 Introduction to Computer Science 5.1 Cosc 1P02 Week 5 Lecture slides Psychiatrist to patient "You have nothing to worry about - anyone who can.
MPEG-4 Structured Audio Mihir Anandpara EE 382C – Embedded Software Systems.
Introduction to Computer Programming using Fortran 77.
1 Types of Programming Language (1) Three types of programming languages 1.Machine languages Strings of numbers giving machine specific instructions Example:
1 An SDL Tutorial Two primary elements: –Structure –Identifies the various components of the system, and the communication paths among them. –Components:
Synthesizing a Clarinet Nicole Bennett. Overview  Frequency modulation  Using FM to model instrument signals  Generating envelopes  Producing a clarinet.
2-7 Variables and Algebraic Expressions Warm Up Problem of the Day
SystemView First Steps
Frequency Modulation 2.
Rhythm.
Introduction to Csound 5.
Chapter 4 –Requirements for coding in Assembly Language
All-Pass Filters.
Requirements for coding in Assembly Language
Frequency Modulation.
Sampling.
Introduction to Csound 2.
Introduction to Csound 4.
Presentation transcript:

The Csound Orchestra semi-colon begins a commentsemi-colon begins a comment Csound ignoresCsound ignores everything on the line after the semi-coloneverything on the line after the semi-colon blank linesblank lines instr 1 — gives instrument numberinstr 1 — gives instrument number first line of instrument designfirst line of instrument design

Assembly Language-Style Syntax each line of instrument — one operationeach line of instrument — one operation result variable — left columnresult variable — left column except with operations such as out which do not have a resultexcept with operations such as out which do not have a result the operation (an "opcode") — second columnthe operation (an "opcode") — second column tells Csound which unit generator to usetells Csound which unit generator to use one or more arguments — third columnone or more arguments — third column resultopcodeargument1, argument2,... outsignal

Initial Variables begin with the letter "i"begin with the letter "i" ifreq and iwtnum are initial variablesifreq and iwtnum are initial variables set their values at the beginning of each note — they are single numbersset their values at the beginning of each note — they are single numbers remain constant for the note duration — BUTremain constant for the note duration — BUT additional statements can revise themadditional statements can revise them example: multiplying iamp by.5 cuts the amplitude in halfexample: multiplying iamp by.5 cuts the amplitude in half iamp=p4 iamp=iamp *.5

Initial Variables iamp — constant representing the maximum amplitude of note (value from parameter field 4 in the score)iamp — constant representing the maximum amplitude of note (value from parameter field 4 in the score) ifreq — the frequency of the note (p5)ifreq — the frequency of the note (p5) iattack — the attack time in seconds (p6)iattack — the attack time in seconds (p6) idecay — the decay time (p7)idecay — the decay time (p7) isustain — sustain time — duration between attack and decayisustain — sustain time — duration between attack and decay isustain definition must come after iattack and idecayisustain definition must come after iattack and idecay

Amplitude Envelopes can fade the waveform incan fade the waveform in time-varying scalers that allow waveforms to fade in or out and vary in overall amplitudetime-varying scalers that allow waveforms to fade in or out and vary in overall amplitude amplitude envelope ampenvlinseg0,idur,iamp

Amplitude Envelopes Output signal in first.1 seconds:Output signal in first.1 seconds:

Amplitude Envelopes [i:80] Output signal over full note duration:[i:80] Output signal over full note duration:

Amplitude Envelopes [i:81] add decay to the envelope to control how the note fades out[i:81] add decay to the envelope to control how the note fades out ampenvlinseg0,iattack,iamp,idecay,0 0 iamp iattackidecay

Audio Rate Variables [i:82] ampenv — amplitude envelope controlling how the note fades in and out[i:82] ampenv — amplitude envelope controlling how the note fades in and out linseg arguments — line segment breakpointslinseg arguments — line segment breakpoints shaped by attack and decay time values in Csound scoreshaped by attack and decay time values in Csound score ampenvlinseg0,iattack,iamp,isustain,iamp,idecay,0 0 iamp iattackisustainidecay

The Csound Orchestra ; amplitude envelope and signal: ampenvlinseg0,iattack,1,isustain,1,idecay,0,1,0 asigosciliiamp, ifreq, iwave ; generate signal outasig * ampenv ; output signal endin; end of instrument oscili statement generates the output signal ( asig )oscili statement generates the output signal ( asig ) first argument — amplitude ( iamp )first argument — amplitude ( iamp ) second argument — frequency ( ifreq )second argument — frequency ( ifreq ) third argument — wavetable number (1)third argument — wavetable number (1) out writes asig to the soundfileout writes asig to the soundfile endin turns off the instrument designendin turns off the instrument design

oscilioscili a basic Csound unit generator which performs wavetable lookupa basic Csound unit generator which performs wavetable lookup arguments:arguments: xamp — the note's maximum amplitudexamp — the note's maximum amplitude xfreq — frequencyxfreq — frequency iwtnum — wavetable numberiwtnum — wavetable number example:example: asigosciliampenv, ifreq, iwtnum first letter of each result or argument namefirst letter of each result or argument name specifies whether the variable remains constant or varies over timespecifies whether the variable remains constant or varies over time

Audio Rate Variables change every sampling periodchange every sampling period always begin with the letter "a"always begin with the letter "a" made of many numbers — used for time- varying variables such as signals and envelopesmade of many numbers — used for time- varying variables such as signals and envelopes the result ampenv in the example is an audio rate variable:the result ampenv in the example is an audio rate variable: ampenv linseg 0, iattack, iamp, isustain, iamp, idecay, 0 0 iamp iattackisustainidecay

Control Rate Variables change once every control periodchange once every control period always begin with "k"always begin with "k" change more slowly than audio rate variableschange more slowly than audio rate variables control rate usually about 1/10 of audio ratecontrol rate usually about 1/10 of audio rate not as precise as audio rate variables, but can efficiently represent slowly varying functions such as some amplitude envelopesnot as precise as audio rate variables, but can efficiently represent slowly varying functions such as some amplitude envelopes Not as common in recent years with improved CPU speeds. Now many Csound user only use audio rate variables for time-varying variables.Not as common in recent years with improved CPU speeds. Now many Csound user only use audio rate variables for time-varying variables. kfreq =ifreq + kvib

The Csound Orchestra ;sinewave.orc; name of orchestra sr=22050; sampling rate kr=2205; control rate ksmps=10; samples/control per. nchnls=1; 1 channel playback ; instr 1; beginning of instr. idur=p3; duration iamp=p4; maximum amplitude ifreq=p5; frequency in Hertz iattack=p6; attack time dur. idecay=p7; decay time dur. isustain=idur - iattack - idecay ; remaining dur. iwave=1; use wavetable 1 continued on following slide...

The Csound Orchestra ; amplitude envelope and signal: ampenvlinseg0, iattack, 1, isustain, 1, idecay, 0 asigosciliiamp, ifreq, iwave ; generate signal outasig * ampenv ; output signal endin; end of instrument