electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
go to the radio page Live at electro-music.com radio 1 Please visit the chat
  host / artist show at your time
today> Twyndyllyngs Chez Mosc
 Forum index » DIY Hardware and Software » ChucK programming language
ChucK Skool
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [6 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Fri May 21, 2010 12:21 am    Post subject: ChucK Skool
Subject description: A class for newbie ChucKists
Reply with quote  Mark this post and the followings unread

The topic of where to begin learning ChucK comes up so much that I thought we might have a bit of fun making a ChucK Skool. I'll begin with Lesson 1: The SinOsc. Here is the code:

Code:
SinOsc s => dac;
440 => s.freq;
day => now;


Which is posted as an attached file. Here we have a SinOsc Ugen going straight out the dac and therefore into your ears. It is set for a 440 Hz oscillation by the second line and we wait a day before the program ends to allow things to play basically indefinitely until we stop them.

I invite you to create other lessons for newbies and post them to this thread if you think it is worth doing. I will try to add more later.

Les


Lesson1.ck
 Description:
ChucK Skool Lesson 1

Download (listen)
 Filename:  Lesson1.ck
 Filesize:  43 Bytes
 Downloaded:  330 Time(s)


_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Fri May 21, 2010 1:43 am    Post subject: Reply with quote  Mark this post and the followings unread

This program makes a demonic vocoder applied to your voice. Here is the code:

Code:
adc => PitShift ps => dac;
ps => Gain fb => ps;
0.8 => ps.shift;
0.9 => fb.gain;
day => now;


Here the adc is the mic which goes into a pitch shifter ad out to the dac. A gain UGen provides feedback and the shift and gain parameters define the effect. A very simple program with a lot of potential for fun.

Les


Lesson2.ck
 Description:
Lesson 2 of ChucK Skool

Download (listen)
 Filename:  Lesson2.ck
 Filesize:  92 Bytes
 Downloaded:  311 Time(s)


_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Antimon



Joined: Jan 18, 2005
Posts: 4145
Location: Sweden
Audio files: 371
G2 patch files: 100

PostPosted: Fri May 21, 2010 4:01 am    Post subject: Reply with quote  Mark this post and the followings unread

Inventor wrote:
This program makes a demonic vocoder applied to your voice.
Les


Excuse my nitpicking, but I'd call that a demonic pitch shifter. Wink You might argue that this might be seen as a vocoder in a very broad sense of the word, but usually it refers to something that sets the pitch (rather than shift it) using an array of band-pass filters. I might be wrong, in which case you're free to squeeze my nose.

In any skool, it's very important to get the definitions right.

Anyway, cool idea for a thread!

/Stefan

_________________
Antimon's Window
@soundcloud @Flattr home - you can't explain music
Back to top
View user's profile Send private message Visit poster's website
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Fri May 21, 2010 10:36 am    Post subject: Reply with quote  Mark this post and the followings unread

Oh, well then I stand corrected, Stefan. I was not aware of that definition specifically.

Les

_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Antimon



Joined: Jan 18, 2005
Posts: 4145
Location: Sweden
Audio files: 371
G2 patch files: 100

PostPosted: Fri May 21, 2010 11:45 am    Post subject: Reply with quote  Mark this post and the followings unread

Inventor wrote:
Oh, well then I stand corrected, Stefan. I was not aware of that definition specifically.

Les


NP Les! I'd like to emphasize again that I think this is a really cool thread. :)

I should contribute something instead of just being annoying... one of my favourite ChucK things is sporking and Events:

Code:
Event bell;

fun void waiter1() {
   <<< "Waiter1 stands up" >>>;
   bell => now;
   <<< "Good evening, sir." >>>;
}

fun void waiter2() {
   <<< "Waiter2 stands up" >>>;
   bell => now;
   <<< "Can I get you anything?" >>>;
}

fun void waiter3() {
   <<< "Waiter3 stands up" >>>;
   bell => now;
   <<< "Shall I get your coat?" >>>;
}

spork ~ waiter1();
spork ~ waiter2();
spork ~ waiter3();

1::second => now;
bell.signal();
1::second => now;
bell.broadcast();
1::second => now;

spork ~ waiter2();
spork ~ waiter2();
1::second => now;
bell.broadcast();
1::second => now;


Note how signal() wakes one waiter and broadcast() wakes all who are waiting. The spork ~ lines starts the functions, causing the sporked waiters to wait for the bell. When the waiter functions reach their end, they finish and will not do anything more before being sporked again, which I do with waiter2 at the end. Note also that you can spork a method more than once.

A bit long, maybe...

/Stefan

_________________
Antimon's Window
@soundcloud @Flattr home - you can't explain music
Back to top
View user's profile Send private message Visit poster's website
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Fri May 21, 2010 12:00 pm    Post subject: Reply with quote  Mark this post and the followings unread

OK, Stefan, I've saved your code and tested it working fine. nice use of events and notice the different types of broadcasting. No sound out of this one, only text, and more of an intermediate lesson than a beginner one but that's all good. File posted below, who's up for Lesson 4?

Les


Lesson3.ck
 Description:
ChucK Skool Lesson 3

Download (listen)
 Filename:  Lesson3.ck
 Filesize:  611 Bytes
 Downloaded:  330 Time(s)


_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [6 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » ChucK programming language
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use