No More Comments, Sorry, Too Much Spam
Apparently the spammers have effective robots, I've been getting twenty or more spam letters/comments a day...so I've turned commnents off. Sorry, but I'm getting overwhelmed with noise mail...
ChucK is a music programming language (and compiler/synthesizer) written by a professor (Perry Cook) and his students at Princeton University. I'm learning how to use it; I thought that writing about how to use it would help...
Apparently the spammers have effective robots, I've been getting twenty or more spam letters/comments a day...so I've turned commnents off. Sorry, but I'm getting overwhelmed with noise mail...
Thanks to a link on Penny Arcade, today I found a site that offers free disk space for mp3's:
[chuck] version 1.2.0.3 released
[chuck] version 1.2.0.2 released
(sorry for the API changes)
- (API change) OSC_Send class name changed to 'OscSend'
(also): .startMesg(...) name changed to startMsg(...)
- (API change) OSC_Recv class name changed to 'OscRecv'
- (API change) OSC_Addr class name changed to 'OscEvent'
(also): .hasMesg() name changed to .hasMsg()
(also): .nextMesg() name changed to .nextMsg()
- (API change) STK Shakers.freq now expect Hz instead of MIDI number
- (moved) examples/event/opensound*.ck moved to examples/osc/OSC*.ck
(see OSC_send.ck and OSC_recv.ck for examples on OpenSoundControl)
- (moved) examples/event/polyfony*.ck to examples/midi/
- (added) 'loop(...){ }' control structure :
example: loop( 8 ) { ... } // executes body 8 times
example: loop( foo ) { ... } // executes body foo times
(foo is evaluated exactly once entering the loop, the
value at that time is used as a constant to control
loop iteration - even if foo is changed in the loop
body.)
- supports break and continue
- important: one fundamantal difference between the loop
semantic and for/while/until semantic is that the argument
expression 'exp' in loop( exp ) is evaluated exactly once
when the loop is first entered.
- (added) MidiIn and MidiOut member functions:
.good() : whether the thing is good to go (int)
.num() : the device number (int)
.name() : the device name (string)
.printerr( int ) : whether to auto print errors (default YES)
- (added) --version command line flag (Graham)
- (changed) chuck --status now prints shreds sorted by id
(previously it was the current shreduling order + blocked)
- (changed) a udp port may now be shared by many OSC_Recv (phil)
: the incoming messages are broadcast to all
- (changed) address/type string in OSC: comma now optional (phil)
- (fixed) events are now 0-sample synchronous (instead of 1)
- (fixed) startup audio stability for --callback mode
- (fixed) incorrect 'continue' behavior in for loops
- (fixed) improved OSC stability (phil)
- (fixed) OSC shreduling sanity check failed now resolved
- (fixed) math.round for negative numbers (win32)
- (fixed) std.mtof and std.ftom now internally double precision
- (fixed) removed extra console output in STK Flute
- (fixed) multiple delete/assertion failure on type rollback
- (fixed) chuck --kill now closes WvOut and MidiRW file handles
- (added) examples/midi/gomidi.ck : very useful sometimes
- (added) examples/midi/gomidi2.ck
- (added) examples/basic/rec-auto.ck (rec2.ck back in action)
- (added) examples/basic/fmsynth.ck (from v1)
- (added) examples/sitar.ck
- (fixed) examples/stk/*-o-matic.ck now uses array
---
1.2.0.0
SYNTAX and OPERATORS:
- (added) +=>, operator : 2 +=> i; (also) -=>, *=>, /=>, %=>
- (added) @=> for explicit assignment
this is the only way to make object reference assignments
- (added) implicit int to float casting
- (changed) cast now look like: 1.1 $ (int) => int i;
- (added) function call by chucking :
// call
(1,4) => math.rand2f => result;
// same as
math.rand2f(1,4) => result;
LANGUAGE:
- (fixed) type system for existing types
- (added) forward lookup of classes and functions (mutual recursion)
- (added) stack overflow detection for massive recursion
DOCUMENTATION:
- (added) language specification:
http://chuck.cs.princeton.edu/doc/language
COMMAND-LINE:
- (added) --probe prints all audio and MIDI devices
- (added) --log or --verbose logs compiler and virtual machine
- (added) --logN or --verboseN multi level logging
1 - least verbose
10 - most verbose
OBJECTS:
- (added) 'class' definitions : class X { int i; }
- (added) 'extends' keyword : class Y extends Event { int i; }
- (added) virtual/polymorphic inheritance
- (added) added pre-constructors - code at class level
gets run when object is instantiated
- (added) function overloading :
class X { fun void foo() { } fun void foo( int y ) { } }
- (added) base classes (can be extended):
Object, Event, UGen
see below
- (added) base classes (cannot be extended):
array, string
see below
- (added) member data
- (added) static data
- (added) member functions
- (added) static functions
EVENTS:
- (added) base Event class : Event e;
can be used directly
can be extended to custom events
(see one_event_many_shreds.ck)
- (added) waiting on event, chuck to now :
e => now; // wait on e
- (added) e.signal() wakes up 1 shred, if any
- (added) e.broadcast() wakes up all shreds waiting on e
- (added) class MidiEvent (see gomidi2.ck)
alternative to polling.
- (added) class OSCEvent
ARRAYS:
- (added) arrays : int a[10]; float b[20]; Event e[2];
- (added) multidimensional arrays : int a[2][2][2];
- (added) associative arrays : int a[10]; 0 => a["foo"];
all arrays are both int-indexed and associative
- (added) array initialization : [ 1, 2, 3 ] @=> int a[];
- (added) .cap() for array capacity
- (added) .find() test if item is associative array
- (added) .erase() erase item in associative array
UGENS:
- (added) class UGen
can be extended
- (changed) all ugen parameters are now also functions:
// set freq
440 => s.freq => val;
// same as...
s.freq( 440 ) => val;
- (changed) left-most parameters must now be called as functions
// no longer valid
f.freq => float val;
// valid
f.freq() => float val;
// still ok
440 => s.freq => float val;
SHREDS:
- (added) class Shred
- (added) .yield() .id()
STRINGS:
- (added) class string
AUDIO:
- (added) stereo
all stereo unit generators have .left, .right, .pan functions
- (changed) stereo ugen: dac (2 in, 2 out)
- (changed) stereo ugen: adc (0 in, 2 out)
- (added) stereo ugen: pan2 take mono or stereo input and pans
- (added) stereo ugen: mix2 mix stereo input into mono
RBF-soft. [producing] working with chuck
Chuck 1.2 - any date yet?