Chuck Basics Chunity - Workshop Vitor Guerra Rolla Postdoctoral Fellow vitorgr@impa.br
Chuck Intro ● Ge Wang ● Designed around time => now ● Parallel logic ● Simple-text => easy to read ● Real-time sound synthesis ● MIDI compatible
Download and Installation chuck.stanford.edu OSX / Windows / Linux MiniAudicle – Text editor – Virtual machine monitor – Console Monitor
Summary Hello World Alarm MIDI keys Panning Arrays Hi-hat
Hello Sine Print to console gain Hello Sine! time SinOsc cycles Digital Audio Converter => dac => some duration to now
Hello Sine Waveforms SinOsc SqrOsc TriOsc SawOsc
Data Types and Variables
Time in Chuck time and dur are native types time: a point in time dur: a length of time Only by manipulating now => advance time
Time in Chuck Special properties of now when read: gives us the current chuck time when modified: moves time along in Chuck Chucking a duration to now advances time while automatically suspending your code and letting sound generate Until you advance time, you are working at a single point in time
Time in Chuck Alarm example
MIDI Introduction Std.mtof() and Std.ftom()
MIDI Introduction
Std Library - Unit Conversion
Math Library – Random Numbers Math.random() int Math.random2(int min, int max) in between int Math.randomf() float in the range [0,1] Math.random2f(float min, float max) in between float Math.srandom(int)
Math Library
Math Library
Audio Panning dac.left & dac.right & dac.chan(int) Pan2 [-1.0, 1.0] Math.sin(float x)
Arrays Block of memory stringed together used to make a “list” or “group” of data.
Array Loop <<< A.cap() >>>; for(0 => int i; i < A.cap(); i++){ ...
ADSR Envelope
hi-hat noise ADSR envelope volume max high pass filter 0,002 0,01 0,1 time (seconds) random();
Thank you
Recommend
More recommend