ChucK: audio programming language
|
View this Thread in Original format
MrJiveBoJingles |
http://chuck.cs.princeton.edu/
I recently downloaded ChucK, which runs on Windows, Linux, and Mac. ChucK is a programming language centered around audio synthesis, playback, manipulation. "Ugens" are your basic building blocks in the language: they include oscillators, filters, and effects, can do different kinds of synthesis, and you can modulate and sequence them in all kinds of ways. You can also manipulate ChucK with external controllers and events, although I haven't tried that yet.
It's kind of a fun experience, building things up from very raw elements and thinking of a sequence in abstract, mathematical terms rather than as keys on a keyboard or squares in a sequencer. ChucK is used alongside the other languages CSound and SuperCollider in universities for crazy sound experimentation, but since I just got it the other day I am still taking baby steps obviously. So far I've found it quite a bit easier to get into than CS or SC, the syntax is much easier to me and it was simple to get some basic sounds going and write them to a WAV file. It also has a ton of example files that are very helpful. And just like the other languages, it is free, no payment or registration needed whatsoever.
Here are a couple Tetris-ish sounds I have gotten so far. You can copy and paste this text into your own files and play them or edit as you like. :-)
PHP:
http://jbj.raceriv.com/sounds/ChucK/exponent.mp3
^ Pulse wave that descends from 440 Hz (A4) by semitones, then climbs back up in pitch and volume. The rate of descent speeds up twice (those two "ifs"). Width of the pulse is randomized by "Math.rand2f".
PHP:
http://jbj.raceriv.com/sounds/ChucK/fm.mp3
^ Basic FM synthesis, randomized modulating frequency and modulation intensity. Speed builds up gradually then suddenly slows and starts speeding up again, in a loop.
Here are some more links that might be helpful:
http://wiki.cs.princeton.edu/index....Install_and_Run (Windows installation)
http://chuck.cs.princeton.edu/doc/build/ (Mac + Linux instructions)
http://chuck.cs.princeton.edu/doc/learn/tutorial.html (bare basic tutorial)
http://chuck.cs.princeton.edu/doc/language/ (all about the language)
http://chuck.cs.princeton.edu/doc/program/ugen.html (guide to Ugens)
For editing code ".ck" files, it's useful to get a decent text editor like TextPad, which will ensure they display properly. Also you can display line numbers, very useful for when ChucK spits out an error message and a line number back at you because you messed up the syntax or something. :-) |
|
|
MrJiveBoJingles |
Oh, and just so you don't get too intimidated by looking at all that, here is the simplest possible program to start you out, with every step explained:
PHP:
Once you get ChucK installed, put that in a .ck file and run it. Now you've made a test tone. :-) |
|
|
atxbigballer1 |
Thanks for the cool info man! |
|
|
MrJiveBoJingles |
Found a useful tool. ChucK outputs in mono to a single WAV file by default, but this guy wrote a piece of code that outputs two mono files, one from the left channel and one from the right channel, so if you have a stereo effect all the panning and stuff can be preserved:
PHP:
Just tack this on to the beginning of any of your .ck files, then when you run the program type "filename.ck:left.wav:right.wav".
Here is an example with that piece of code added to a loop mangling program (link to code {not written by me}):
Original loop: http://jbj.raceriv.com/sounds/ChucK/loop1.wav
Mangled: http://jbj.raceriv.com/sounds/ChucK/stereo-loop.mp3 |
|
|
jupiterone |
thanks for bringing this to my attention! going to download this and play around with it tomorrow |
|
|
MrJiveBoJingles |
Something a bit more euphonic to play around with:
PHP:
Plays sin waves at intervals of a fifth in different octaves. Nice and stereo with a bit of reverb (denoted by "NRev" at the top). Speeds up, then slows suddenly and loops back around. Octaves are random so it sounds a bit different each loop. Listen:
http://jbj.raceriv.com/sounds/ChucK/beeps.mp3 |
|
|
hexadecimal |
can u giv me presets 4 it?
wear do u put sampols?
i nead a trants loop two |
|
|
MrJiveBoJingles |
quote: | Originally posted by hexadecimal
can u giv me presets 4 it? wear do u put sampols? i nead a trants loop two |
Nope, you're on your own.
As far as I know Vengeance hasn't coded stuff for ChucK that you can torrent yet. :-D |
|
|
MrJiveBoJingles |
I made a little video showing control of synth settings by mouse movement in ChucK:
http://www.youtube.com/watch?v=u0RhFYfiqak&fmt=18
The mouse's vertical movement controls the gain of a modulating oscillator (mod index) in an FM synth, while the horizontal movement controls the modulating oscillator's frequency. Depressing the mouse button turns the synth on, and releasing it turns it off again. The code used is just one of the example files that you get when you download the program ("examples\hid\mouse-fm.ck"). Incorporating the mouse into more interesting synths should be pretty fun. |
|
|
hexadecimal |
how do u make it sound like "wump wump wump wump", or "boom boom boom clap boom boom"? |
|
|
MrJiveBoJingles |
quote: | Originally posted by hexadecimal
how do u make it sound like "wump wump wump wump", or "boom boom boom clap boom boom"? |
You could always try a descending sine oscillator for the "booms" and a noise generator with envelope for the "clap." But it seems like using ChucK just to make standard dance tunes would be rather pointlessly complicated. :-P |
|
|
alanzo |
I looked briefly at CSound but I think I would like ChucK better because it's more like an actual programming language. |
|
|
|
|