Thursday, October 1, 2009

How To Make A Dune Buggy Street Legal

ChucK Manual of Electronic Music 1 - Hello Wolrd!

With this post we start the actual programming with ChucK.

we start the jack server by opening the program JACK Control (Applications> Sound & Video> JACK Control) and press the start button.

Open a terminal and an editor write these lines of code:

SinOsc Neum => dac;
440 => neum.freq;
4:: second => now;

save helloworld.ck with the file name, open another terminal and execute the file by typing

chuck helloworld.ck

that we feel is a sine wave with a frequency of 440 Hz lasting 4 seconds.

What we did in detail?

the first line of code we create an instance of Ugen SinOsc , connecting it to another Ugen dac, which is the abstraction of the audio output. The UGens, ie generator units are modules that process the audio. The Ugen SinOsc produces sine waves and the first line of code we have created, assigning the instance to the variable reference Neum.

Ugen The two were connected with the chuck operator =>, ie the operator chuck connection that we will find literally countless times. Each

Ugen has control parameters that are proper and which are set out through the => operator.

Line

440 => neum.freq

tells us that the frequency of the instance of SinOsc Neum is set to 400 cycles per second.

If we wanted to set the gain of the oscillator to 0.5 we could write

.5 => neum.gain

The third and last line of code, very expressive, tells us that the oscillator will be put in Action 4 seconds from now ( now) , that since to run the code. We will return later on keyword now.

But what happens when we invoke the command in the terminal chuck to run our file?

Basically we start the compiler and Virtual Machine, which will allow the compiled code to be executed and concrete process the audio. The VM is active for the time required to program at the end of which will turn off automatically unless you have been ordered to remain active, but this is a matter we will discuss later.

Before concluding this post I will say that, as in the style of C and C + +, the code can be annotated with the bar we have to (/ /) For individual rows or

/ *

this is a comment
* /

for blocks of text.

enclose this post a video which shows in this first Live Coding and simple tutorial.






Neum

0 comments:

Post a Comment