session 1: basics: sound, waves, and chuck programming vitor...
TRANSCRIPT
![Page 1: Session 1: Basics: Sound, Waves, and ChucK Programming Vitor …w3.impa.br/~vitorgr/livecode/minicourse/Slides-D1.pdf · Session 7: Classes and Object-Oriented Programming Today 10/01/2019](https://reader034.vdocuments.net/reader034/viewer/2022051811/601fec227e0732714d26561a/html5/thumbnails/1.jpg)
Session 1: Basics: Sound, Waves, and ChucK Programming
Vitor Guerra RollaPostdoctoral Fellow
Audio Programming with Chuck
![Page 2: Session 1: Basics: Sound, Waves, and ChucK Programming Vitor …w3.impa.br/~vitorgr/livecode/minicourse/Slides-D1.pdf · Session 7: Classes and Object-Oriented Programming Today 10/01/2019](https://reader034.vdocuments.net/reader034/viewer/2022051811/601fec227e0732714d26561a/html5/thumbnails/2.jpg)
Mini-course Schedule
Session 1: Basics: Sound, Waves, and ChucK initiation
Session 2: ChucK Libraries and Arrays
Session 3: Sound File Manipulation
Session 4: Functions
Session 5: Unit Generators and Physical Models
Session 6: Multi-Threading and Concurrency
Session 7: Classes and Object-Oriented Programming
Today
10/01/2019
15/01/2019
17/01/2019
22/01/2019
24/01/2019
29/01/2019
![Page 3: Session 1: Basics: Sound, Waves, and ChucK Programming Vitor …w3.impa.br/~vitorgr/livecode/minicourse/Slides-D1.pdf · Session 7: Classes and Object-Oriented Programming Today 10/01/2019](https://reader034.vdocuments.net/reader034/viewer/2022051811/601fec227e0732714d26561a/html5/thumbnails/3.jpg)
Session 1: Basics: Sound, Waves, and ChucK initiation
Chuck introduction
Download and Installtion
Hello sine
Data types and variables
Time in Chuck
Control Structures: If and Else
Control Structures: For and While
![Page 4: Session 1: Basics: Sound, Waves, and ChucK Programming Vitor …w3.impa.br/~vitorgr/livecode/minicourse/Slides-D1.pdf · Session 7: Classes and Object-Oriented Programming Today 10/01/2019](https://reader034.vdocuments.net/reader034/viewer/2022051811/601fec227e0732714d26561a/html5/thumbnails/4.jpg)
Chuck Intro● Ge Wang
● Designed around time => now
● Parallel logic
● Simple-text => easy to read
● Real-time sound synthesis
● MIDI compatible
![Page 5: Session 1: Basics: Sound, Waves, and ChucK Programming Vitor …w3.impa.br/~vitorgr/livecode/minicourse/Slides-D1.pdf · Session 7: Classes and Object-Oriented Programming Today 10/01/2019](https://reader034.vdocuments.net/reader034/viewer/2022051811/601fec227e0732714d26561a/html5/thumbnails/5.jpg)
Download and Installation
chuck.stanford.edu
OSX / Windows / Linux
MiniAudicle– Text editor– Virtual machine monitor– Console Monitor
![Page 6: Session 1: Basics: Sound, Waves, and ChucK Programming Vitor …w3.impa.br/~vitorgr/livecode/minicourse/Slides-D1.pdf · Session 7: Classes and Object-Oriented Programming Today 10/01/2019](https://reader034.vdocuments.net/reader034/viewer/2022051811/601fec227e0732714d26561a/html5/thumbnails/6.jpg)
MiniAudicle (Windows & Mac)
![Page 7: Session 1: Basics: Sound, Waves, and ChucK Programming Vitor …w3.impa.br/~vitorgr/livecode/minicourse/Slides-D1.pdf · Session 7: Classes and Object-Oriented Programming Today 10/01/2019](https://reader034.vdocuments.net/reader034/viewer/2022051811/601fec227e0732714d26561a/html5/thumbnails/7.jpg)
Hello Sine
Print to console
Hello Sine!
SinOsc
Digital Audio Converter => dac
=> some duration to now
cycles
gain
time
![Page 8: Session 1: Basics: Sound, Waves, and ChucK Programming Vitor …w3.impa.br/~vitorgr/livecode/minicourse/Slides-D1.pdf · Session 7: Classes and Object-Oriented Programming Today 10/01/2019](https://reader034.vdocuments.net/reader034/viewer/2022051811/601fec227e0732714d26561a/html5/thumbnails/8.jpg)
Hello Sine
Waveforms
SinOsc
SqrOsc
TriOsc
SawOsc
/*Comments*/
or //
![Page 9: Session 1: Basics: Sound, Waves, and ChucK Programming Vitor …w3.impa.br/~vitorgr/livecode/minicourse/Slides-D1.pdf · Session 7: Classes and Object-Oriented Programming Today 10/01/2019](https://reader034.vdocuments.net/reader034/viewer/2022051811/601fec227e0732714d26561a/html5/thumbnails/9.jpg)
Data Types and Variables
Print integers int and floating points float
Shortcuts
Importance of variables
![Page 10: Session 1: Basics: Sound, Waves, and ChucK Programming Vitor …w3.impa.br/~vitorgr/livecode/minicourse/Slides-D1.pdf · Session 7: Classes and Object-Oriented Programming Today 10/01/2019](https://reader034.vdocuments.net/reader034/viewer/2022051811/601fec227e0732714d26561a/html5/thumbnails/10.jpg)
Time in Chucktime and dur are native types
time: a point in time
dur: a length of time
Only by manipulating now => advance time
![Page 11: Session 1: Basics: Sound, Waves, and ChucK Programming Vitor …w3.impa.br/~vitorgr/livecode/minicourse/Slides-D1.pdf · Session 7: Classes and Object-Oriented Programming Today 10/01/2019](https://reader034.vdocuments.net/reader034/viewer/2022051811/601fec227e0732714d26561a/html5/thumbnails/11.jpg)
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
![Page 12: Session 1: Basics: Sound, Waves, and ChucK Programming Vitor …w3.impa.br/~vitorgr/livecode/minicourse/Slides-D1.pdf · Session 7: Classes and Object-Oriented Programming Today 10/01/2019](https://reader034.vdocuments.net/reader034/viewer/2022051811/601fec227e0732714d26561a/html5/thumbnails/12.jpg)
Time in Chuck
Alarm example
![Page 13: Session 1: Basics: Sound, Waves, and ChucK Programming Vitor …w3.impa.br/~vitorgr/livecode/minicourse/Slides-D1.pdf · Session 7: Classes and Object-Oriented Programming Today 10/01/2019](https://reader034.vdocuments.net/reader034/viewer/2022051811/601fec227e0732714d26561a/html5/thumbnails/13.jpg)
Control Structures
If statement
operators
== , && , ||
!= , < , >=
![Page 14: Session 1: Basics: Sound, Waves, and ChucK Programming Vitor …w3.impa.br/~vitorgr/livecode/minicourse/Slides-D1.pdf · Session 7: Classes and Object-Oriented Programming Today 10/01/2019](https://reader034.vdocuments.net/reader034/viewer/2022051811/601fec227e0732714d26561a/html5/thumbnails/14.jpg)
Control Structures
else statement
![Page 15: Session 1: Basics: Sound, Waves, and ChucK Programming Vitor …w3.impa.br/~vitorgr/livecode/minicourse/Slides-D1.pdf · Session 7: Classes and Object-Oriented Programming Today 10/01/2019](https://reader034.vdocuments.net/reader034/viewer/2022051811/601fec227e0732714d26561a/html5/thumbnails/15.jpg)
Control Structures
for loop
![Page 16: Session 1: Basics: Sound, Waves, and ChucK Programming Vitor …w3.impa.br/~vitorgr/livecode/minicourse/Slides-D1.pdf · Session 7: Classes and Object-Oriented Programming Today 10/01/2019](https://reader034.vdocuments.net/reader034/viewer/2022051811/601fec227e0732714d26561a/html5/thumbnails/16.jpg)
Control Structures
while loop