The old computing is about what computers can
The old computing is about what computers can do… the new computing is about what people can do. - Ben Shneiderman 0
The old computing is about what computers can do… the new computing is about what people can do. - Ben Shneiderman 1
Motivation • programming the passage of time – specifying / controlling – reasoning about time in code – flexible granularity • concurrency – parallel – easy to program – precise + granular • gain insight about audio programs • make audio programming more accessible • further enable rapid experimentation 2
Code == Musical instrument 3
4
Chuc. K Facts • text-based, general-purpose programming • tailored for real-time audio synthesis and analysis • open-source, cross-platform • designed from the “ground-up” • high-level syntax, low-level control 5
Chistory-1 6
Chistory-2 7
Chistory-3 8
Flexibility, readability trumps performance 9
Core Language Features 10
=> 11
Controlling Time Impulse i => dac; // infinite time loop while( true ) { // set the next sample 1. 0 => i. next; // advance time 100: : ms +=> now; } demo 12
Advancing Time • time stands still until you “advance” it • two semantics for advancing time – chuck to now 1: : second +=> now; – wait on event => now; • you are responsible for keeping up with time • time == sound 13
Concurrency • implemented using “shreds” – resemble non-preemptive threads • automatically synchronized by time! • can work at low and high level 14
“Strongly-timed” • what it means: – programs have precise control over their own timing – sample-synchronous control may be asserted at any time for any unit generator • transfer primary control over time… – from implicit scheduling to the language – program flow == time flow • staying “in the language” – express more from within the language • provide natural modularity for on-the-fly programs 15
Chuc. K Virtual Machine 16
Chuc. K Virtual Machine Code (“foo. ck”, (“foo. ck”) “bar. ck”) Process shred On-the-fly compiler Chuc. K Virtual Machine shred Shreduler Execution Unit Audio Engine I/O Manager 17
On-the-fly Programming (running with sonic scissors) 18
on-the-fly programming: (n. ) the act of modifying the logic and structure of a program during runtime, for the purpose of rapid experimentation, and exerting expressive control. (also live coding) 19
The League of Automatic Composers (1974) 20
demo 21
The Audicle 22
Editor Hmm-1 Develop Debugger Compiler Run-time VM 23
Editor Hmm-2 Develop Debugger Compiler Run-time VM 24
demo 25
Language Design Solutions • make time itself computable – time and duration native types – allow a program to be “self-aware” in time – allow code to schedule itself • synchronize concurrency by time or by events – automatically (by time) – manually (using events, also sample-synchronous) • hide the mundane, expose true control. • do it on-the-fly! 26
http: //chuck. cs. princeton. edu/ 27
=^ 28
- Slides: 29