<?
PulseOsc p 
=> dac;
0.3 => p.gain;
0.3 => float g;
440 => p.freq;
55 => int f;

int e;
int t;
float b;
36 => e;
170 => t;
1.0 => b;

while ( 
e>)
{

<<< 
>>>;
1.05946309 => b;
t::ms => now;
=> e;

if ( 
e==24 ) { 130 => t; }
if ( 
e==12 ) { 50 => t; }

Math.rand2f (0.10.99) => p.width;
440 => p.freq;

}

while ( 
5000 )
{
10 => f;
f=> p.freq;
10::ms => now;
0.0014 => g;
=> p.gain;

}
?>
<?
SinOsc m
=>SinOsc c =>dac;
2=>c.sync;
int t;
while(
1)
{
if(
t<5){300=>t;}
t::ms=>now;
Math.rand2f(99,999)=>m.gain;
Math.rand2(99,300)=>m.freq;
t-3=>t;
}
?>
<?
SinOsc s
=> dac;        // connect sin oscillator to output
440 => s.freq;        // make sin osc play at 440 Hz
while(1)        // generate infinite loop
{            // open infinite loop
1::ms=>now;        // increment time so sound will play
}            // close infinite loop
?>
<?
if (me.args() > 1) {
    
dac.chan(0) => Gain g0 => WvOut w0 => blackhole;
    
dac.chan(1) => Gain g1 => WvOut w1 => blackhole;
    
0.5 => g0.gain;
    
0.5 => g1.gain;
    
me.arg(0) => w0.wavFilename;
    
me.arg(1) => w1.wavFilename;
    <<< 
"writing stereo output to files"me.arg(0), me.arg(1) >>>;
} else if (
me.args() > 0) {
    
dac => Gain g => WvOut w => blackhole;
    
0.5 => g.gain;
    
me.arg(0) => w.wavFilename;
    <<< 
"writing mono output to file"me.arg(0) >>>;
}
?>
<?
SinOsc s 
=> NRev verb => dac.left;
SinOsc t => NRev verb2 => dac.right;

.3=>s.gain;        // set sin osc levels
.3=>t.gain;
.1=>verb.mix;        // set reverb levels
.1=>verb2.mix;
int q;
int r;
300=>int time;        // set timing variable

while(1)
{

Math.rand2(1,6)=>q;    // generate random integer
330=>t.freq;        
220*q=>s.freq;        // multiply osc freq by random int to get new octave
time::ms=>now;


Math.rand2(1,6)=>r;    // generate random integer
220*r=>t.freq;        // multiply osc freq by random int to get new octave
70::ms=>now;        // delay right channel a bit
330=>s.freq;
time::ms=>now;

time-5=>time;        // speed it up
if(time<40){300=>time;}    // reset speed to slow if really fast
}
?>
ChucK: audio programming language - TranceAddict Forums

Become a part of the TranceAddict community!Frequently Asked Questions - Please read this if you haven'tSearch the forums
TranceAddict Forums > DJing / Production / Promotion > Production Studio > ChucK: audio programming language
Pages (2): [1] 2 »   Last Thread   Next Thread
Share
Author
Thread    Post A Reply
MrJiveBoJingles
Supreme tranceaddict



Registered: Jun 2004
Location: U.S.
Smile ChucK: audio programming language

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. :-)

Last edited by MrJiveBoJingles on Oct-28-2009 at 04:31

Old Post Oct-28-2009 04:03  United States
Click Here to See the Profile for MrJiveBoJingles Click here to Send MrJiveBoJingles a Private Message Add MrJiveBoJingles to your buddy list Report this Post Reply w/Quote Edit/Delete Message
MrJiveBoJingles
Supreme tranceaddict



Registered: Jun 2004
Location: U.S.

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. :-)

Old Post Oct-28-2009 04:12  United States
Click Here to See the Profile for MrJiveBoJingles Click here to Send MrJiveBoJingles a Private Message Add MrJiveBoJingles to your buddy list Report this Post Reply w/Quote Edit/Delete Message
atxbigballer1
Supreme tranceaddict



Registered: Dec 2006
Location: Austin,Texas

Thanks for the cool info man!


___________________
Trance Addict 4 LIFE!
quote:
Dr.DRE
"It's not the equipment....it's the muthaf@#%r running it"
quote:
Originally posted by Pagan-za
Fighting online is like winning the special Olympics. Even if you win, you're still retarded.

Old Post Oct-28-2009 04:17  United States
Click Here to See the Profile for atxbigballer1 Click here to Send atxbigballer1 a Private Message Add atxbigballer1 to your buddy list Report this Post Reply w/Quote Edit/Delete Message
MrJiveBoJingles
Supreme tranceaddict



Registered: Jun 2004
Location: U.S.

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

Last edited by MrJiveBoJingles on Oct-28-2009 at 06:55

Old Post Oct-28-2009 04:58  United States
Click Here to See the Profile for MrJiveBoJingles Click here to Send MrJiveBoJingles a Private Message Add MrJiveBoJingles to your buddy list Report this Post Reply w/Quote Edit/Delete Message
jupiterone
housin' guide



Registered: Dec 2004
Location: los angeles

thanks for bringing this to my attention! going to download this and play around with it tomorrow

Old Post Oct-28-2009 05:49  Poland
Click Here to See the Profile for jupiterone Click here to Send jupiterone a Private Message Add jupiterone to your buddy list Report this Post Reply w/Quote Edit/Delete Message
MrJiveBoJingles
Supreme tranceaddict



Registered: Jun 2004
Location: U.S.

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

Old Post Oct-28-2009 15:37  United States
Click Here to See the Profile for MrJiveBoJingles Click here to Send MrJiveBoJingles a Private Message Add MrJiveBoJingles to your buddy list Report this Post Reply w/Quote Edit/Delete Message
hexadecimal
Supreme tranceaddict



Registered: Mar 2004
Location: Chicago, IL

can u giv me presets 4 it?

wear do u put sampols?

i nead a trants loop two

Old Post Oct-28-2009 15:51  United States
Click Here to See the Profile for hexadecimal Click here to Send hexadecimal a Private Message Add hexadecimal to your buddy list Report this Post Reply w/Quote Edit/Delete Message
MrJiveBoJingles
Supreme tranceaddict



Registered: Jun 2004
Location: U.S.

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

Old Post Oct-28-2009 16:00  United States
Click Here to See the Profile for MrJiveBoJingles Click here to Send MrJiveBoJingles a Private Message Add MrJiveBoJingles to your buddy list Report this Post Reply w/Quote Edit/Delete Message
MrJiveBoJingles
Supreme tranceaddict



Registered: Jun 2004
Location: U.S.

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.

Old Post Oct-28-2009 16:46  United States
Click Here to See the Profile for MrJiveBoJingles Click here to Send MrJiveBoJingles a Private Message Add MrJiveBoJingles to your buddy list Report this Post Reply w/Quote Edit/Delete Message
hexadecimal
Supreme tranceaddict



Registered: Mar 2004
Location: Chicago, IL

how do u make it sound like "wump wump wump wump", or "boom boom boom clap boom boom"?

Old Post Oct-28-2009 16:46  United States
Click Here to See the Profile for hexadecimal Click here to Send hexadecimal a Private Message Add hexadecimal to your buddy list Report this Post Reply w/Quote Edit/Delete Message
MrJiveBoJingles
Supreme tranceaddict



Registered: Jun 2004
Location: U.S.

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

Old Post Oct-28-2009 16:55  United States
Click Here to See the Profile for MrJiveBoJingles Click here to Send MrJiveBoJingles a Private Message Add MrJiveBoJingles to your buddy list Report this Post Reply w/Quote Edit/Delete Message
alanzo
The Equalizer Womanizer



Registered: Sep 2003
Location: Boston, MA

I looked briefly at CSound but I think I would like ChucK better because it's more like an actual programming language.


___________________
Youtube || Soundcloud || Synth Patch Banks

Old Post Oct-29-2009 22:43  United States
Click Here to See the Profile for alanzo Click here to Send alanzo a Private Message Visit alanzo's homepage! Add alanzo to your buddy list Report this Post Reply w/Quote Edit/Delete Message

TranceAddict Forums > DJing / Production / Promotion > Production Studio > ChucK: audio programming language
Post New Thread    Post A Reply

Pages (2): [1] 2 »  
Last Thread   Next Thread
Click here to listen to the sample!Pause playbackPROG_played by burridge @ venue, athens [2003] [1]

Click here to listen to the sample!Pause playbackCarrisa Mondavi - Solid Ground (Fade Vocal Mix) [2002]

Show Printable Version | Subscribe to this Thread
Forum Jump:

All times are GMT. The time now is 23:20.

Forum Rules:
You may not post new threads
You may not post replies
You may not edit your posts
HTML code is ON
vB code is ON
[IMG] code is ON
 
Search this Thread:

 
Contact Us - return to tranceaddict

Powered by: Trance Music & vBulletin Forums
Copyright ©2000-2026, Jelsoft Enterprises Ltd.
Privacy Statement / DMCA
Support TA!