<?
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>0 )
{
<<< b >>>;
b / 1.05946309 => b;
t::ms => now;
e - 1 => e;
if ( e==24 ) { 130 => t; }
if ( e==12 ) { 50 => t; }
Math.rand2f (0.1, 0.99) => p.width;
440 * b => p.freq;
}
while ( f < 5000 )
{
f + 10 => f;
f=> p.freq;
10::ms => now;
g + 0.0014 => g;
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
}
?>
TranceAddict Forums (www.tranceaddict.com/forums)
- Production Studio
-- ChucK: audio programming language
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:
PHP:
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:
Thanks for the cool info man!
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:
thanks for bringing this to my attention! going to download this and play around with it tomorrow
Something a bit more euphonic to play around with:
PHP:
can u giv me presets 4 it?
wear do u put sampols?
i nead a trants loop two
| quote: |
| Originally posted by hexadecimal can u giv me presets 4 it? wear do u put sampols? i nead a trants loop two |
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.
how do u make it sound like "wump wump wump wump", or "boom boom boom clap boom boom"?
| quote: |
| Originally posted by hexadecimal how do u make it sound like "wump wump wump wump", or "boom boom boom clap boom boom"? |
I looked briefly at CSound but I think I would like ChucK better because it's more like an actual programming language.
Yeah it will look familiar if you have programmed before. CSound seemed so awkward to me. But since CSound is the oldest of the three (SC, CS, and CK) I think it has the most extensive library of functions and sound generators, which is the main reason many still use it.
so what is this, a vst of some sorts?
| quote: |
| Originally posted by LoveHate so what is this, a vst of some sorts? |
Powered by: vBulletin
Copyright © 2000-2021, Jelsoft Enterprises Ltd.