SLIDE 1
Vitor Guerra Rolla
Postdoctoral Fellow vitorgr@impa.br
Chuck Basics Chunity - Workshop
SLIDE 2 Chuck Intro
- Ge Wang
- Designed around time => now
- Parallel logic
- Simple-text => easy to read
- Real-time sound synthesis
- MIDI compatible
SLIDE 3 Download and Installation
chuck.stanford.edu OSX / Windows / Linux MiniAudicle
– Text editor – Virtual machine monitor – Console Monitor
SLIDE 4
Summary
Hello World Alarm MIDI keys Panning Arrays Hi-hat
SLIDE 5 Hello Sine
Print to console Hello Sine! SinOsc Digital Audio Converter => dac => some duration to now
cycles gain time
SLIDE 6
Hello Sine
Waveforms
SinOsc SqrOsc TriOsc SawOsc
SLIDE 7
Data Types and Variables
SLIDE 8
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
SLIDE 9
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
SLIDE 10
Time in Chuck
Alarm example
SLIDE 11
MIDI Introduction
Std.mtof() and Std.ftom()
SLIDE 12
MIDI Introduction
SLIDE 13
Std Library - Unit Conversion
SLIDE 14
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)
SLIDE 15
Math Library
SLIDE 16
Math Library
SLIDE 17
Audio Panning
dac.left & dac.right & dac.chan(int) Pan2 [-1.0, 1.0] Math.sin(float x)
SLIDE 18
Arrays
Block of memory stringed together used to make a “list” or “group” of data.
SLIDE 19
Array Loop
<<< A.cap() >>>; for(0 => int i; i < A.cap(); i++){ ...
SLIDE 20
ADSR Envelope
SLIDE 21 hi-hat
noise ADSR envelope high pass filter
time (seconds) volume 0,002 0,01 max 0,1 random();
SLIDE 22
Thank you