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..." Many of these examples are also linked from
the ChucK API Reference. Good luck and have fun!
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!
|
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 |
|
low-frequency oscillator |
|
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 |
|
|
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) |
|
karplus strong comb-filter bank chugraph |
|
say "ChucK" through synthesis |
|
Shepard Tone generator |
|
Super Mario Bros. theme, recreated in ChucK |
|
THX Deep Note emulator ( info) |
|
Reich's Clapping Music using glottal pulses |
|
|
variations on towers of hanoi sonification |
|
on-the-fly synchronization (concurrent) |
|
Can't decide? Flip a coin with maybe! |
|
Different shades of RNG |
|
Okay, not that fun, but really useful |
|
|
Survey of chuck's primitive types |
|
Object type (more later) |
|
The 'auto' type |
|
Polymorphism in ChucK |
|
Analysis-related type |
|
Working with the Type type |
|
Querying active types in the VM |
|
Vectors 3D + 4D |
|
Using vec3 as a slewing interpolator |
|
|
store and retrieve values |
|
appending to an array |
|
for-each in array |
|
for-each in array (with auto type) |
|
arrays are automatically resized (e.g., using append and popBack) |
|
erasing elements in an array |
|
array @=> assignment |
|
instantiating multidimensional arrays |
|
reassigning sub-arrays |
|
array as function argument |
|
multi-dimensional array instantiation |
|
mixed associative and linear array |
|
generating arrays containing ranges of values |
|
resizing arrays |
|
negative indexing of arrays |
|
reversing an array |
|
shuffling an array |
|
zeroing the elements an array |
|
|
operators for assignment |
|
logical operators |
|
pre/post increment |
|
arithmetic operators |
|
|
time and duration |
|
reasoning about time |
|
|
for loop |
|
for-each loop |
|
repeat |
|
until |
|
do-until |
|
while |
|
do-while |
|
break |
|
break w/ nesting |
|
continue w/ nested blocks |
|
Philip's sequencer |
|
|
function overloading |
|
recursive function calls |
|
objects as function arguments |
|
|
sporking shreds |
|
sporking many shreds |
|
Machine.add() .remove() .replace() |
|
Virtual Machine functions
|
evaluating string as code |
|
VM operations hodge-podge |
|
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.
|
Dinky instrument implemented as class |
|
class constructors and destructor |
|
class static variables |
|
learning about objects with .help() |
|
a file that used the class Dinky |
|
|
|
|
a more extensive example |
|
Extending ChucK Unit Generators
|
chugraph (rhymes with "u-graph") |
|
chugen (rhymes with "ugen") |
|
chugin (rhymes with "plugin") |
|
|
event broadcast method |
|
event signal method |
|
extending events (creating custom events) |
|
|
chout ("shout") and cherr ("Cher") |
|
file directory access |
|
file input: reading ints |
|
file input: reading floats |
|
file input: reading lines |
|
file input: reading tokens |
|
file input: reading strings |
|
file input (binary mode): reading bytes |
|
file input (binary mode): parsing a WAV file |
|
file output |
|
file output (binary mode): writing bytes |
|
HID Input (Joystick, Mouse, Keyboard)
|
Joystick demo |
|
Mouse demo |
|
Keyboard demo |
|
Gametrak demo |
|
"SMELT: Small Musically Expressive Laptop Toolkit" |
|
Keyboard (terminal only; see HID usage above) |
|
|
MIDI input |
|
MIDI input with polophony |
|
MIDI file reader / player! |
|
MIDI output |
|
|
OSC message sender and receiver |
|
OSC multiple message at different rate |
|
OSC one sender to many receivers |
|
OSC multicast (broadcast to local area hosts)
|
|
OSC message dumper |
|
|
reading byte(s) |
|
reading ascii/binary |
|
writing |
|
listing serial devices |
|
Arduino INO file |
|
|
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 |
|
LiSa2 stereo |
|
Granular sampling examples |
|
|
|
Granular synthesis example: Scream-o-Matic 2000 |
|
Loading an audio file into a LiSa |
|
LiSa tracking mode examples |
|
Input-driven LiSA trigger |
|
|
String operations |
|
String escape sequences |
|
String input + tokenize (hacked; temporary) |
|
(More) Unit Generators Examples
|
|
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 Tool Kit ) demos
|
BandedWG (Banded Waveguide) |
|
BlowBotl |
|
BlowHole |
|
Bowed |
|
Brass |
|
Clarinet |
|
Flute |
|
FrncHrn |
|
HevyMetl => acoustic guitar |
|
HevyMetl => power chords |
|
HevyMetl => trumpet |
|
HnkyTonk |
|
KrstlChr |
|
Mandolin |
|
ModalBar |
|
Moog (r.i.p. bob) |
|
Rhodey (Rhodes synth) |
|
A lovely littel number made with Rhodey... |
|
Saxofony |
|
Shakers |
|
Sitar |
|
StifKarp |
|
TubeBell |
|
VoicForm |
|
Wurley (Wurlitzer model) |
|
|
|
FFT |
|
IFFT |
|
DCT |
|
Windowing |
|
Flip / UnFlip |
|
auto-correlation-based pitch detection |
|
cross-correlation delay detection |
|
(really bad) spectral cross-synthesis |
|
|
Centroid |
|
Chroma |
|
Flux |
|
Kurtosis |
|
MFCC |
|
RMS |
|
RollOff |
|
SFM |
|
ZeroX |
|
Feature Collector |
|
Feature Collector (alt use) |
|
Feature-based Genre Classification (part of chai) |
|
see ChAI landing page and the AI Tools API reference for examples!
|