Harvestworks Part 1: ChucK basics Rebecca Fiebrink Princeton University 1.

Slides:



Advertisements
Similar presentations
Sound Synthesis Part II: Oscillators, Additive Synthesis & Modulation.
Advertisements

David Meredith Minim David Meredith
IntroductionIntroduction Most musical sounds are periodic, and are composed of a collection of harmonic sine waves.Most musical sounds are periodic, and.
Musical Instruments and Sound Simple Harmonic Motion Envelope of sound NIHL report AUD202 Audio and Acoustics Theory.
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.
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,
0 - 1 © 2010 Texas Instruments Inc Practical Audio Experiments using the TMS320C5505 USB Stick “Sine Waves” Texas Instruments University Programme Teaching.
EE2F2 - Music Technology 9. Additive Synthesis & Digital Techniques.
Implementation of an Audio Reverberation Algorithm
Analog Synthesizers Yohahn Jo Systems Engineering Class of 2011.
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.
1 Synchronization TTM4142, 2007 Harald Øverby/Leif Arne Rønningen.
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.
Copyright © 2011 by Denny Lin1 Simple Synthesizer Part 2 Based on Floss Manuals (Pure Data) “Building a Simple Synthesizer” By Derek Holzer Slides by Denny.
ChucK => A Concurrent, On-the-fly Audio Programming Language Ge Wang *Perry R. Cook Department of Computer Science (*Also Music) Princeton University ICMC.
Digital audio and computer music COS 116: 2/26/2008.
Analog-to-Digital Converters Prepared by: Mohammed Al-Ghamdi, Mohammed Al-Alawi,
Behavioral Design Outline –Design Specification –Behavioral Design –Behavioral Specification –Hardware Description Languages –Behavioral Simulation –Behavioral.
Spring 2002EECS150 - Lec13-proj Page 1 EECS150 - Digital Design Lecture 13 - Final Project Description March 7, 2002 John Wawrzynek.
Customizable Audio Kaleidoscope Agustya Mehta, Dennis Ramdass, Tony Hwang Final Project Spring 2007.
Methods for Tone and Signal Synthesis R.C. Maher ECEN4002/5002 DSP Laboratory Spring 2002.
Music Processing Roger B. Dannenberg. Overview  Music Representation  MIDI and Synthesizers  Synthesis Techniques  Music Understanding.
Harmonics and Overtones Waveforms / Wave Interaction Phase Concepts / Comb Filtering Beat Frequencies / Noise AUD202 Audio and Acoustics Theory.
EE2F2 - Music Technology 8. Subtractive Synthesis.
1 My Beats Final Presentation Mike Smith, Karen Tipping, Dylan Barrett.
Digital audio and computer music COS 116, Spring 2012 Guest lecture: Rebecca Fiebrink.
2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.
CS190/295 Programming in Python for Life Sciences: Lecture 1 Instructor: Xiaohui Xie University of California, Irvine.
1 Chelmsford Amateur Radio Society Advanced Licence Course Murray Niman G6JYB Slide Set 6: v1.01, 1-Oct-2004 (4) Transmitters - Principles & Synthesisers.
Digital Sound and Video Chapter 10, Exploring the Digital Domain.
CS 0004 –Lecture 1 Wednesday, Jan 5 th, 2011 Roxana Gheorghiu.
RM2D Let’s write our FIRST basic SPIN program!. The Labs that follow in this Module are designed to teach the following; Turn an LED on – assigning I/O.
CS 363 Comparative Programming Languages
CS 179: GPU Computing Lecture 3 / Homework 1. Recap Adding two arrays… a close look – Memory: Separate memory space, cudaMalloc(), cudaMemcpy(), … – Processing:
Physics 1251 The Science and Technology of Musical Sound Unit 4 Session 37 MWF Synthesizers Unit 4 Session 37 MWF Synthesizers.
Harvestworks Part 3 : Audio analysis & machine learning Rebecca Fiebrink Princeton University 1.
Reason Devices Subtractor. Oscillators Select Waveform The Subtractor has two oscillators that can be used as sound sources for your patches Tuning Mix:
Csound. a language for describing sound. General History. Developed by Barry Vercoe at MIT. Extended by too many people to mention. Based initially on.
Computer Programming For Musical Applications II Tutorial 05 SuperCollider Sound Fundamentals 07 November, 2008.
ORDER OF CONTENT AND INSTRUCTIONS A program in its simplest form usually contains three kinds of activity:  INPUT : The program asks the user for some.
Subtractive Sound Synthesis. Subtractive Synthesis Involves subtracting frequency components from a complex tone to produce a desired sound Why is it.
Understanding the TigerSHARC ALU pipeline Determining the speed of one stage of IIR filter – Part 2 Understanding the pipeline.
Digital audio and computer music COS 116, Spring 2010 Adam Finkelstein Slides and demo thanks to Rebecca Fiebrink.
EE 113D Fall 2008 Patrick Lundquist Ryan Wong
Lonce Wyse Arts and Creativity Lab National University of Singapore Net-Music 2013: The Internet as Creative Resource in Music.
It sure is smart but can it swing? (Digital audio and computer music)
Copyright © 2011 by Denny Lin1 Computer Music Synthesis Chapter 5 Based on “Excerpt from Designing Sound” by Andy Farnell Slides by Denny Lin.
Overview of Previous Lesson(s) Over View  A program must be translated into a form in which it can be executed by a computer.  The software systems.
Compilers: Overview/1 1 Compiler Structures Objective – –what are the main features (structures) in a compiler? , Semester 1,
Theory of Programming Languages Introduction. What is a Programming Language? John von Neumann (1940’s) –Stored program concept –CPU actions determined.
Quiz 1 Review. Analog Synthesis Overview Sound is created by controlling electrical current within synthesizer, and amplifying result. Basic components:
Sampling BTEC Level 3 Extended Diploma in Music Technology Year 1 Sound Creation & Manipulation Modulation – LFOs & Envelopes.
Intro to Programming Web Design ½ Shade Adetoro. Programming Slangs IDE - Integrated Development Environment – the software in which you develop an application.
Subtractive Synthesis
ISE-575 Presentation 1 Designing Smule’s iPhone Ocarina By Ge Wang Huihui Cheng 3/20/2011.
0 The old computing is about what computers can do… the new computing is about what people can do. - Ben Shneiderman.
Copyright © 2011 by Denny Lin1 Simple Synthesizer Part 3 Based on Floss Manuals (Pure Data) “Building a Simple Synthesizer” By Derek Holzer Slides by Denny.
Automatic Equalization for Live Venue Sound Systems Damien Dooley, Final Year ECE Progress To Date, Monday 21 st January 2008.
TJHSST Computer Systems Lab Senior Research Project Designing a Music Scripting Language Casey Mihaloew Abstract: The problem addressed in this.
Digital Control CSE 421.
Feedback Filters n A feedback filter processes past output samples, as well as current input samples: n Feedback filters create peaks (poles or resonances)
Prof. Nizamettin AYDIN Advanced Digital Signal Processing 1.
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.
1. COMPUTERS AND PROGRAMS Rocky K. C. Chang September 6, 2015 (Adapted from John Zelle’s slides)
Part 2: Interactivity. In this section Using the laptop’s inputs Adding game controllers and MIDI controllers Interacting with controllers, other software,
CS 591 S1 – Computational Audio
CS190/295 Programming in Python for Life Sciences: Lecture 1
Wavetable Synthesis.
Transmitters Advanced Course requires a detailed knowledge of Transmitters and Receivers This session covers Transmitter Block Diagrams, Oscillators and.
Presentation transcript:

Harvestworks Part 1: ChucK basics Rebecca Fiebrink Princeton University 1

Introductions, etc. 2

ChucK in a nutshell Created by Ge Wang (Princeton => CCRMA) Textual programming language for audio synthesis & analysis Sample-level control (no audio vs control rate distinction) For both low-level synthesis and higher-level composition Easy, sample-synchronous concurrency Promotes readability, understandability at expense of speed Used for teaching, laptop performance 4

Workshop topics ChucK basics, making sound (1.5 hours?) Syntax, built-in UGens, concurrency Interactive performance (.5 hours?) Events, controllers, OSC New language directions & current research (.5 hours?) Real-time audio analysis, machine learning for controller mappings 5

Let’s ChucK! miniAudicle: Workshop examples: harvestworks2009/ Feel free to steal code liberally! 6

Unit generators Building blocks of sound generation Square wave Low-pass filter DAC Cut-off frequency=500, Q Freq = 100 7

A very simple UGen network 8 Sine wave DAC Freq = 440 See: instantiate.ck

The ChucK Operator 1.Virtual “patch cord” SinOsc s => dac; Noise n => LPF filter => dac; 2.Assignment operator 5.0 => float f; 9 See: time.ck

Time in ChucK Two jobs of the virtual machine: 1. Interpret ChucK code line by line, following instructions of the code 2. Output a stream of audio samples to the system DAC buffer ChucK ONLY outputs audio samples when time is “advanced”!! 10 See: while-loop.ck

Advancing Time – E.g., 1::second => now; or 1::samp => now; – ChucK ensures that exactly the number of audio samples are produced – All the other work of ChucK happens in between outputting samples, as if in a single instant in time 11 See: while-loop.ck; note loop construct and Std.rand2f function call

Playing back stored audio with SndBuf 12 SndBuf DAC Parameters: pos, rate, loop, other See: sndbuf.ck; note Std.rand2f for random number generation

ChucK Syntax Basics 13 See: while-loop.ck

Physical Modeling with ChucK STK – Ready to use physical models – All have noteOn(), noteOff(), freq() methods 14 See: mandolin.ck, clarinet.ck, mandolin2.ck

Additive synthesis + arrays Examples: additive_noarrays.ck, additive_sines_array.ck, additive_with_vibrato.ck Note array syntax, for-loop syntax 15

Analysis - resynthesis 16 Singing bowl strike: Peaks at 528, 1413, 2630, 4127, and 5877 Hz (add_bowl.ck)

Envelopes Can apply an envelope function of arbitrary time granularity by hand in ChucK – Singing bowl in time domain: exponential decay Ex: add_bowl_exp_envelope.ck 17

Built-in ChucK Envelopes Example: ADSR: attack, decay, sustain, release 18 Oscillator (e.g. SinOsc) Envelope Parameters DAC See: sine_ADSR.ck, add_bowl_with _ADSR

Other built-in UGens Filters Built-in, or create your own from filter equation lpf.ck, lpf_mouse.ck, resonance.ck, resonance_mouse.ck, run_clix.sh Reverb, echo, delay lines JCRev – the ketchup of PLOrk Noise, Impulse, [band-limited] saw/square/etc. Look-up tables 19

Getting audio input and using it adc object for audio in – Audio example: Plork beat science flute processing: – Example: echo.ck Live sampling: trueman_munger.ck, adc_munger.ck 20

Using sample granularity for FM 21 See: FM_byhand, FM_mouse, FM_stk

Concurrency 1 “Add shred” in miniAudicle See: Moe/Larry/Curly, OTF ChucK – Also note: OTF synchronization method 22  Time Shred 0 Shred 1

Shreds A shred is a running piece of code that’s getting executed line-by-line by the virtual machine. Multiple shreds can be running at once, in parallel; their timings are guaranteed to be sample-synchronous 23

Concurrency 1: Manually adding shreds “Add shred” in miniAudicle See: Moe/Larry/Curly, OTF ChucK – Also note: OTF synchronization method 24  Time Shred 0 Shred 1

Concurrency 2: Sporking shreds Sporking functions – See shred1.ck through shred4.ck; also functions handout 25 Shred 0 Shred 1 spork ~ fun1(); (parent shred) (child shred)

Why use ChucK? (Language reasons) Sample-level control – E.g. see FM_byhand.ck, while-loop.ck Concurrency for free – Spork or add as many shreds as you want; they’ll remain in synch with each other – E.g., see OTF examples, shred4.ck Event-driven interactivity (e.g., SMELT: coming up next) Integrated audio analysis (UAnae) – Leads to support for real-time AI / machine learning and music information retrieval 26

Why not use ChucK? Not optimized Not multicore No garbage collection 27

Coming up in Part 2 Making ChucK interactive! 28