Csound. a language for describing sound. General History. Developed by Barry Vercoe at MIT. Extended by too many people to mention. Based initially on.

Slides:



Advertisements
Similar presentations
CSE 105 Structured Programming Language (C)
Advertisements

Agenda Definitions Evolution of Programming Languages and Personal Computers The C Language.
Digital Sound Representation & Introduction to Software Synthesis Electronic Music Studio TU Berlin Institute of Communications Research
Remote Procedure Call Design issues Implementation RPC programming
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
SWE 423: Multimedia Systems Chapter 3: Audio Technology (2)
MC697 Object-Oriented Programming Using Java. In this class, we will cover: How the class will be structured Difference between object-oriented programming.
The Csound Orchestra semi-colon begins a commentsemi-colon begins a comment Csound ignoresCsound ignores everything on the line after the semi-coloneverything.
What is Csound? a programming language for sound generationa programming language for sound generation uses software synthesis to compile user-defined.
Generic Haskell Where to start from. Issues Touched Language Ideas Tools Pitfalls.
Parameter (p) Variables contain the score parameter values for each notecontain the score parameter values for each note allow score to control orchestraallow.
Chapter 2: Impact of Machine Architectures What is the Relationship Between Programs, Programming Languages, and Computers.
Introduction to a Programming Environment
Music Processing Roger B. Dannenberg. Overview  Music Representation  MIDI and Synthesizers  Synthesis Techniques  Music Understanding.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Language Issues Misunderstimated? Sublimable? Hopefuller? "I know how hard it is for you to put food on your family.” "I know the human being and fish.
Name: Md. Iqbal Hossain Roll : Computer programming  Programming is a lot of fun and extraordinarily useful. While you learn to program,
Welcome In The World Of ‘C’.  TEXT BOOK: Programming in ANCI ‘C By: E Balagurusamy. TMH  Reference Books: 1) The ‘C Programming Language By: Kernighan.
Introduction to Java Appendix A. Appendix A: Introduction to Java2 Chapter Objectives To understand the essentials of object-oriented programming in Java.
Language Systems Chapter FourModern Programming Languages 1.
By: Felegh Solomon ITEC SPRING 2013 CHAPTER 4: KEY CONSTRUCTION DECISIONS.
Table-Driven Acceptance Testing Mario Aquino Principal Software Engineer Object Computing, Inc.
Block-Structured Procedural Languages Lecture 11: Dolores Zage.
Design-Making Projects Work (Chapter7) n Large Projects u Design often distinct from analysis or coding u Project takes weeks, months or years to create.
Introduction to Subroutines. All the combinations in which a subroutine can be written 1. The subroutine may be: a. Internal or b. External 2. The type.
CS 403: Programming Languages Lecture 2 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
Implement High-level Program Language on JVM CSCE 531 ZHONGHAO LIU ZHONGHAO LIU XIAO LIN.
C Programming language
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Chapter 06 (Part I) Functions and an Introduction to Recursion.
Python – Part 1 Python Programming Language 1. What is Python? High-level language Interpreted – easy to test and use interactively Object-oriented Open-source.
Sharda University P. K. Mishra (Asst.Prof) Department of Computer Science & Technology Subject Name: Programming Using C Sub Code: CSE-106 Programming.
Problem Solving Techniques. Compiler n Is a computer program whose purpose is to take a description of a desired program coded in a programming language.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
FIRST JAVA PROGRAM. JAVA PROGRAMS Every program may consist of 1 or more classes. Syntax of a class: Each class can contain 1 or more methods. public.
Programming Logic and Design Using Methods. 2 Objectives Review how to use a simple method with local variables and constants Create a method that requires.
COP4020 Programming Languages Names, Scopes, and Bindings Prof. Xin Yuan.
240-Current Research Easily Extensible Systems, Octave, Input Formats, SOA.
Introducing Python CS 4320, SPRING Lexical Structure Two aspects of Python syntax may be challenging to Java programmers Indenting ◦Indenting is.
ICMC 2004 – Nov. 5 1 Andante: Composition and Performance with Mobile Musical Agents Leo Kazuhiro Ueda Fabio Kon
“Education is a Treasure that follows you everywhere.” – Chines Proverb Methods and Functions.
SIMULINK-Tutorial 1 Class ECES-304 Presented by : Shubham Bhat.
Software Engineering and Object-Oriented Design Topics: Solutions Modules Key Programming Issues Development Methods Object-Oriented Principles.
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
Today… “Hello World” ritual. Brief History of Java & How Java Works. Introduction to Java class structure. But first, next slide shows Java is No. 1 programming.
Lecture1 Instructor: Amal Hussain ALshardy. Introduce students to the basics of writing software programs including variables, types, arrays, control.
Embedding Assembly Code in C Programs תרגול 7 שילוב קוד אסמבלי בקוד C.
Chapter – 8 Software Tools.
1.1: Objects and Classes msklug.weebly.com. Agenda: Attendance Let’s get started What is Java? Work Time.
Programming Logic and Design Fifth Edition, Comprehensive Chapter 7 Using Methods.
Understanding Midi Audio Processing Describe the Midi Audio Processing.
LECTURE 19 Subroutines and Parameter Passing. ABSTRACTION Recall: Abstraction is the process by which we can hide larger or more complex code fragments.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Java Programming Fifth Edition Chapter 1 Creating Your First Java Classes.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
Introduction to Algorithm. What is Algorithm? an algorithm is any well-defined computational procedure that takes some value, or set of values, as input.
Introduction to Computers
C Programming Hardik H. Maheta.
Topic: Functions – Part 2
CS 153: Concepts of Compiler Design November 30 Class Meeting
Welcome In The World Of ‘C’.  TEXT BOOK: Programming in ANSI ‘C By: E Balagurusamy. TMH  Reference Books: 1) The ‘C Programming Language By: Kernighan.
Introduction to Computers
High Level Programming Languages
Introduction to Csound 5.
Let’s Talk about… Smalltalk.
Introduction to Csound 2.
The Lua Chunk Vault, an enhancement to epics base
Introduction to Csound 4.
SPL – PS1 Introduction to C++.
Presentation transcript:

Csound. a language for describing sound

General History. Developed by Barry Vercoe at MIT. Extended by too many people to mention. Based initially on work done by Vercoe and Max Matthews for creating music on IBM 7094 and 360 machines. –These first programs were written in assembler, and CSound has retained the overall flavor of assembler code in its style. The name CSound comes from the ‘rendterpreter’ being implemented in the C programming language.

Rendterpreter? CSound source files are interpreted, then rendered. –The language utilizes variables and function definitions that can only be evaluated at runtime, and also allows real-time interaction through MIDI; thus it is interpreted. –However, the output of CSound source files is always sound; after variables and functions are bound, the source is carried to an intermediate form, from which it is written into pulse code modulation audio data (either directly to a file or into system- specific audio API)

General Structure Every CSound program can be broken down into the orchestra file and the score file. –by convention, these use.orc and.sco extensions –the orchestra file contains all the instruments; the score file contains how and when to play them. Each file type has a fairly well-defined structure using opcode-type primitives and methods. –For example, the orchestra header ALWAYS begins with something of the form: sr = kr = 4410 ksmps = 10 nchnls = 2 sr => sampling rate for audio kr => control rate ksmps => sr / kr nchlns => number of audio channels

Opcodes. CSound modules, or opcodes, are just like assembler opcodes: a base function with white-space delimited arguments. e.g. foscil CSound also uses ‘GEN functions’ to create datatables for opcodes; these routines generate everything from simple sines/cosines to Blackman-Harris windows, used in spectrum analysis e.g. f generates a Hanning window of with max value 1.

Binding, Scoping, Parameters, Oh my... Binding is really irrelevant in Csound; there are no procedures Scoping: variables can be scoped either: – within a single instrument An instrument has a block structure: instr 107 a1 oscil p4, p5, p6 out a1 endin –within a score/orchestra file combination (referred to as ‘global’) All parameters are passed by value; the mechanism is by simply placing a numeric value or variable name in the appropriate ‘p- field’ (analogous to a register argument in assembler), e.g. p4 through p6 above. All variables in CSound must begin with one of the letters a, d, k, i, w, x, or z. (making them feel even more like registers....)

So why the hell would anyone want to go to all that trouble? It’s free. It’s limitless in terms of the noises one can make. It’s available for almost every platform. Many, many development environments are available (e.g., integration into MAX/MSP) Online documentation is exhaustive (think: the Java API on the Sun site) The language has had excellent longevity and keeps getting better, with a richer set of built-in features and opcodes. Highly efficient; speed is directly related to complexity.

However... Code is not very readable / maintainable compared to most ‘real’ programming languages (it’s a lot less like spoken English) The learning curve is pretty steep Its control flow is fairly limited; conditionals have to be implemented in a manner somewhat akin to gates on a circuit Aside from blatant syntax errors, debugging messages occur entirely between ears and brain.

A small example. ; me999.orc ; simple buzz instrument— sr = kr = 4410 ksmps = 10 nchnls = 1 instr 109 a1 buzz p4, p5, p6, p7 out a1 endin

A small example, cont. ; me999.sco – score for buzz instrument ;FUNCTION 1 USES THE GEN10 SUBROUTINE TO COMPUTE A SINE WAVE ;FUNCTION 2 USES THE GEN10 SUBROUTINE BUT SPECIFIES AMPLITUDES ;OF THE FIRST 12 PARTIALS f f ;bass i i i i ;alto i i i i i i i i i i

Demos and Resources me999.orcand me999.sco render to: me999.wav A much bigger example: –shortyorc.txt and shortyscore.txt render to: shorty.wavshortyorc.txt shortyscore.txt shorty.wav using a MIDI keyboard and controller: ambientsong.mp3 The Csound website: The Online Csound Manual: –