ChucK | Examples
version: 1.4.x.x (numchucks)

Chuck Examples

The following are example programs that demonstrate basic language features, tools, and techniques. All of these examples files can be found in the distribution (download page) under the folder examples. Additionally, they can be accessed from within miniAudicle, under "File > Open Example..." Good luck and have fun!

Jump to Section



Various Basic Examples

A selection of examples that demonstrate basic sound generation, timing, and control in ChucK. As with all examples here, feel free to try and experiment!

Basic Demonstrations
time and duration
variable assignment and use
chucking & unchucking ugens
modulating ugen parameters
using command line arguments
mic input
ADSR method
a chuckian alarm clock (no warranties!)
digital delay
simple comb filter using Delay
echo effect
using Envelope
knuckleheads (time shifted phase locking)
knuckleheads++ (with glottal voicing)
function demo
po-tweet!
the uh, whole tone scale
sinosc + blit (bandlimited oscillators)
FM synthesis "by hand"
FM synthesis with two sinosc
FM (actual frequency modulation)
oscillators
mic input and simple comb filter
impulse generator
imp
low-frequency oscillator
lfo
recording (via WvOut)
clocks (useful when recording and other)
basic ring-mod (demonstrate ugen input)
sndbuf (file read/write/playback)
sndbuf.valueat() - random access samples
step ugen
unchuck
whirl
noise & filters
function test
math.isinf() also math.isnan()
input/output (including FileIO) examples
"Deep" Stuff
formant-based singing synthesis
audio dithering "by hand"
how phones dial
one pole envelope follower
karplus strong plucked string
plucked string with mandolin body excitation
tuned plucked string (a la jaffe/smith)
say "ChucK" through synthesis
Shepard Tone generator
THX Deep Note emulator (info)
Reich's Clapping Music using glottal pulses
More Fun Experiments
variations on towers of hanoi sonification
hanoi (no sound) | hanoi2 | hanoi3
on-the-fly synchronization (concurrent)


Language Features

These examples demonstrate features described in the ChucK Language Specification.

Types
Survey of chuck's primitive types
Object type (more later)
Analysis-related type
Vectors 3D + 4D
Using vec3 as a slewing interpolator
Arrays
store and retrieve values
array @=> assignment
instantiating multidimensional arrays
reassigning sub-arrays
array as function argument
multi-dimensional array instantiation
mixed associative and linear array
resizing arrays
Operators
operators for assignment
logical operators
pre/post increment
arithmetic operators
Time & Timing
time and duration
reasoning about time
Control Structures
for loop
until
do-until
break
break w/ nesting
continue w/ nested blocks
Philip's sequencer
Functions
function overloading
recursive function calls
objects as function arguments
Shreds & Concurrency
sporking shreds
sporking many shreds
machine.add() .remove() .replace()


Tools and Techniques

These examples demonstrate pratical tools ranging from unit generators, events, mouse / keyboard / joystick input, file I/O, MIDI, Open Sound Control, how to extend ChucK unit generators, and more.

Classes & Objects
learning about objects with .help()
(requires chuck-1.4.1.0 or later)
Dinky instrument implemented as class
a file that used the class Dinky
Extending ChucK Unit Generators
chugraph (rhymes with "subgraph")
chugen (rhymes with "ugen")
chugin (rhymes with "plugin")
Events
event broadcast method
event signal method
extending events (creating custom events)
Input/Ouput
chout ("shout") and cherr ("Cher")
file directory access
file input: reading ints
file input: reading lines
file input: reading strings
file output
HID Input (Joystick, Mouse, Keyboard)
Joystick demo
Mouse demo
Keyboard demo
"SMELT: Small Musically Expressive Laptop Toolkit"
KBHit (Terminal only; see HID usage above)
Keyboard (terminal only) demo
kb | kb2
MIDI
MIDI input
MIDI input with polophony
MIDI file reader / player!
MIDI output
Open Sound Control (OSC)
OSC message sender and receiver
OSC message dumper
Serial I/O
reading byte(s)
reading ascii/binary
writing
listing serial devices
Arduino INO file
Stereo / Multi-channel
Stereo noise (using Pan2)
Stereo powerup
Stereo => arrays of mono UGens
Stereo Stooges
Multi-channel demos
Live Sampling and Granular Synthesis Using LiSa
Basics of live sampling using LiSa
Live sampling simple looping
Granular sampling examples
Granular synthesis examples from Twilight (2013)
Loading an audio file into a LiSa
LiSa tracking mode examples
Input-driven LiSA trigger
String Utilities
String operations
String escape sequences
String input + tokenize (hacked; temporary)
(More) Unit Generators Examples
    > Filters
low pass filter
resonance low pass filter
high pass filter
resonance high pass filter
resonance filter with equal-gain zeros
band pass filter
band reject filter
    > STK ( Synthesis ToolKit ) demos
BandedWG (Banded Waveguide)
BlowBotl
BlowHole
Bowed
Brass
Clarinet
Flute
FrncHrn (requires chuck-1.4.1.0 or later)
HevyMetl => acoustic guitar (1.4.1.0 or later)
HevyMetl => trumpet (1.4.1.0 or later)
HnkyTonk (1.4.1.0 or later)
KrstlChr (1.4.1.0 or later)
Mandolin
ModalBar
Moog (r.i.p. bob)
Rhodey (Rhodes synth)
A lovely littel number made with Rhodey...
Saxofony
Shakers
Sitar
StifKarp
VoicForm
Wurley (Wurlitzer model)
Unit Analyzers
    > Transformations
FFT
IFFT
DCT
Windowing
Flip
auto-correlation-based pitch detection
cross-correlation delay detection
(really bad) spectral cross-synthesis
    > Feature Extractors
Centroid
Flux
RMS
RollOff
Feature Collector