electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
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 
 Forum index » DIY Hardware and Software » ChucK programming language
One-Line ChucK Crazy
Post new topic   Reply to topic Moderators: Kassen
Page 4 of 5 [121 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Goto page: Previous 1, 2, 3, 4, 5 Next
Author Message
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Wed Sep 24, 2008 5:29 am    Post subject: Reply with quote  Mark this post and the followings unread

OK, that worked, thanks kijjaz. Here is the test code to try out the drum set:

Code:
// Kijjaz's drum set
Impulse trigL => LPF toneL => SinOsc driveL => dac; toneL.set(50, 30); 1 => driveL.sync;
Impulse trigL2 => LPF toneL2 => SinOsc driveL2 => dac; toneL2.set(160, 30); 1 => driveL2.sync;
Impulse trigB => BPF toneB => SinOsc driveB => dac; toneB.set(2000, 100); 1 => driveB.sync;
Impulse trigH => HPF toneH => SinOsc driveH => dac; toneH.set(2000, 100); 1 => driveH.sync;
while (true) {
    50 => trigL.next;
    second => now;
    50 => trigL2.next;
    second => now;
    50 => trigB.next;
    second => now;
    50 => trigH.next;
    second => now;
}

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



Joined: Jun 03, 2008
Posts: 38
Location: UK

PostPosted: Wed Sep 24, 2008 3:14 pm    Post subject: Reply with quote  Mark this post and the followings unread

hehe that's a wicked idea - tried to come up with a contribution to the kit. instead i got this. its not drum like at all but does start to sound like a merzbow track after a short while Wink

Code:
Impulse i => Noise n => SawOsc s => HPF f => dac; f.set (500, 200); s.sync ();
Back to top
View user's profile Send private message
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Wed Sep 24, 2008 4:16 pm    Post subject: Reply with quote  Mark this post and the followings unread

Rinko: i tried to simplify your patch above. it should build the same sound.

Code:
Noise n => SawOsc s => HPF f => dac; f.set (500, 200); day => now;

i made some modification just for fun:
Code:
Noise n => SawOsc s => s => HPF f => dac; f.set (400, 300); day => now;
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Wed Sep 24, 2008 4:25 pm    Post subject: Reply with quote  Mark this post and the followings unread

Code:
// still afraid of the dentist?
Step a => Phasor b => b => SinOsc c => b => dac; -200 => a.next; 250 => b.gain; day => now;
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Sat Mar 28, 2009 5:40 pm    Post subject: Reply with quote  Mark this post and the followings unread

Just dug up this cool thread for my ChucK internet radio show. Gonna go through it and collect the best ones. Any suggestions? Any favorites?
_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Mon Apr 06, 2009 9:35 am    Post subject: Reply with quote  Mark this post and the followings unread

Code:
//Crackling, no randomization!
Step s => dac; .5 => s.gain; float x; while(samp => now) Math.sin(x * 5.414369 + 1) => x => s.next;


Code:
// Crackling, more grounded.
Step s => dac; .5 => s.gain; float x; while((maybe*40+6)::samp => now) Math.sin(x * 5.414369 + 1.19972) => x => s.next;


Code:
// Crackling, sandy.
Step s => dac; .001 => s.gain; float x; while(samp => now) Math.tan(x * .09 + 1) => x => s.next;
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
sarigama



Joined: Mar 01, 2009
Posts: 3
Location: tokyo, japan

PostPosted: Tue Apr 07, 2009 6:57 am    Post subject: is there a way to play this one-line without any file
Subject description: | chuck or > chuck? something like that?
Reply with quote  Mark this post and the followings unread

some supercollider users are now twitting one-line and others can copy it from twitter and paste it his editor ... and listen ...
will chuck user always have to create a file first?
if it's one line
maybe there's a way to avoid creating a file?

_________________
podcasting:
http://sarigama.namaste.jp/podcast/rss.xml
Back to top
View user's profile Send private message Visit poster's website AIM Address
BobTheDog



Joined: Feb 28, 2005
Posts: 3844
Location: England
Audio files: 32
G2 patch files: 15

PostPosted: Tue Apr 07, 2009 7:32 am    Post subject: Reply with quote  Mark this post and the followings unread

welcome

Well I am not a chuck expert but you can do the same thing using Audicle.
Back to top
View user's profile Send private message
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Tue Apr 07, 2009 10:09 am    Post subject: Re: is there a way to play this one-line without any file
Subject description: | chuck or > chuck? something like that?
Reply with quote  Mark this post and the followings unread

sarigama wrote:
some supercollider users are now twitting one-line and others can copy it from twitter and paste it his editor ... and listen ...
will chuck user always have to create a file first?
if it's one line
maybe there's a way to avoid creating a file?


Welcome on board.

As the previous poster pointed out; we do have a editor with integrated VM that can run code from editor buffers.

Another option would be to type "chuck --shell" at your terminal. The idea of --shell is to be able to enter into a direct dialogue with the VM, this is still in a rather "alpha" stage but there you can enter simple code without the need for any external programs and indeed without a graphics server. I wouldn't recommend that as a very practical thing right now but you can if you really want to.

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Tue Apr 07, 2009 11:45 pm    Post subject: Reply with quote  Mark this post and the followings unread

Yes.. running a ChucK code especially a one-line in command line is quite comfortable. Just like Kassen said, just go into ChucK shell, then on ChucK prompt, open with a { then just code the thing in, then close with } and enter. You'll hear it running.
Normally it'd be shred (thread) number 1. Use this command "- 1" to remove shred number 1 in case you want to stop the running program.
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
sarigama



Joined: Mar 01, 2009
Posts: 3
Location: tokyo, japan

PostPosted: Thu Apr 09, 2009 3:57 am    Post subject: yes
Subject description: just will report that
Reply with quote  Mark this post and the followings unread

chuck %> {Noise a => BPF f => dac; for(1 => int x; x <360> now; }}
chuck %> [chuck](VM): sporking incoming shred: 1 (chuck_file.yodt1g)...

worked!! great! thax
i think i will dig this style
i once thought that this is good when you are doing things on x-less cui (vt) ..
but yes then .. no handy copy'n'paste
so most of the things has to be in your brain for sure ..

hmm .. maybe there's a way to | a line from vim to chuck --shell
directly from its editing mode .. ?
mean something like scvim ..

_________________
podcasting:
http://sarigama.namaste.jp/podcast/rss.xml
Back to top
View user's profile Send private message Visit poster's website AIM Address
sarigama



Joined: Mar 01, 2009
Posts: 3
Location: tokyo, japan

PostPosted: Thu Apr 09, 2009 5:15 am    Post subject: yes
Subject description: reporting that
Reply with quote  Mark this post and the followings unread

it worked on my intrepid

chuck %> {Noise a => BPF f => dac; for(1 => int x; x <360> now; }}
chuck %> [chuck](VM): sporking incoming shred: 1 (chuck_file.2hQP4S)...
^C[chuck]: cleaning up...

then there might be a way to | a line directly from vim's edit mode .. just like scvim?

_________________
podcasting:
http://sarigama.namaste.jp/podcast/rss.xml
Back to top
View user's profile Send private message Visit poster's website AIM Address
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Thu Apr 09, 2009 5:53 am    Post subject: Reply with quote  Mark this post and the followings unread

hmm.. that'd be interesting, so you can make other program generate chuck code also. i never tried that before. Shocked

oh, by the way, i'd like to post some one-line codes on Twitter sometimes. what tag should I use? #chuck seems too common. how about #chucklang ?

if you all are on twitter, follow me at @kijjaz
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Sun Apr 12, 2009 1:28 pm    Post subject: Reply with quote  Mark this post and the followings unread

This is one is quite long.. too long actually,
but it sounds so nice for me i wanted to post it here.

Code:
// Digital Major Thingy
Step s => dac; float x; while(samp => now) { ((x * 7 + (now / 125::ms) $ int % 64) % 30000 => x) / 15000 - 1 => s.next; }


Code:
// Glistering Thingy
Step s => dac; float x; while(samp => now) { ((x * 99 + (now / 125::ms) $ int % 64) % 30000 => x) / 15000 - 1 => s.next; }


Code:
// Rotating Robotic Thingy
Step s => dac; float x; while(samp => now) { ((x * 501 + (now / 125::ms) $ int % 64) % 30000 => x) / 15000 - 1 => s.next; }


Code:
// Another Must-post Thingy
Step s => dac; int x; while(samp => now) { ((x * 49 + (now / 50::ms) $ int % 64) % 30000 => x) / 15000 - 1 => s.next; }


Chaotic Duo!

Code:
// Chaotic Duo!
Step s => dac; float x, y; while(samp => now) { (((x * pi => Math.cos) + y => y => Math.cos) + x => x) * y => s.next; }


Code:
// Visualizing the Chaotic Duo.
SinOsc s => dac; float x, y; while(samp => now) { (((x * pi => Math.cos) + y => y => Math.cos) + x => x) * y => s.freq; }


Another duo..
Code:
// Modulo together..
SinOsc s => dac; float x, y; while(20::ms => now) { (x * 19 + y) % 256 => x; (y * 7 + 1) % 64 => y; x * y => s.freq; }
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
cebec



Joined: Apr 19, 2004
Posts: 1064
Location: Virginia
Audio files: 3
G2 patch files: 31

PostPosted: Sun Apr 12, 2009 4:38 pm    Post subject: Reply with quote  Mark this post and the followings unread

Brutal kijjaz, I like it!
Back to top
View user's profile Send private message
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Mon Apr 13, 2009 10:42 am    Post subject: Reply with quote  Mark this post and the followings unread

Ahhh!! Thanks a lot cebec.
I've got another chick to post tonight:

Code:
// Egg Factory
Step a => dac; int x; while(samp => now) (a.last() * 40000 / (x % 7500/1000 + 1) + x++) % 20000 / 10000 - 1 => a.next;


Code:
// Accidentally Hatched
Step a => dac; int x; while(samp => now) (a.last() * 8001 / (x % 3750/1000 + 1) + x++) % 20000 / 10000 - 1 => a.next;


Code:
// Phone Ring
Step a => dac; int x; while(samp => now) (a.last() * 80000 / (x % 3000/1000 + 1) + x++) % 20000 / 10000 - 1 => a.next;


Code:
// Egg Factory Error
Step a => dac; int x; while(samp => now) (a.last() * 80000 / (x % 11000/4000 + 1) + x++) % 20000 / 10000 - 1 => a.next;

Last edited by kijjaz on Mon Apr 13, 2009 12:11 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Mon Apr 13, 2009 11:29 am    Post subject: Reply with quote  Mark this post and the followings unread

I'm going to play a few of these one-liners on The ChucK Show this Friday at 23:00 - 00:00 GMT.
_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
cebec



Joined: Apr 19, 2004
Posts: 1064
Location: Virginia
Audio files: 3
G2 patch files: 31

PostPosted: Mon Apr 13, 2009 11:46 am    Post subject: Reply with quote  Mark this post and the followings unread

I like these, too! Rhythmic, mechanical and harsh. Cool
_________________
http://www.soundcloud.com/cebec
Back to top
View user's profile Send private message
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Sun May 24, 2009 6:05 am    Post subject: Reply with quote  Mark this post and the followings unread

At Jan's suggestion, we decided to make the theme of next week's ChucK Show be one-liners. I went through and tried basically all of them. Some didn't work because of html tags and some were too harsh sounding for my taste, however I did get 41 one liners to use in the show. That should pretty much do the job! Cheers!

Les

p.s. thanks for the thread kijjaz and all!

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



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Sun May 31, 2009 5:29 pm    Post subject: Reply with quote  Mark this post and the followings unread

Another of my favourite. Very simple, and cute.

Code:
// what a bird .. (successfully at sample rate = 44100)
SqrOsc s1 => Gain g => g => SinOsc s2 => g; s2 => dac; 20 => s1.freq; day => now;


Code:
// super 8-bit bouncing ball
SinOsc s1 => Gain g => g => SqrOsc s2 => g; s2 => dac; -.01 => s1.freq; day => now;
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Tue Jul 14, 2009 10:20 am    Post subject: Reply with quote  Mark this post and the followings unread

Not such a interesting sound but the technique is quite cool, I think, and stereo signals can be squeezed into 80 characters (barely).

Code:
Noise n=>dac.left;Noise m=>dac.right;int i;while(++i){0=>Std.srand;i*samp=>now;}

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Tue Jul 14, 2009 10:59 am    Post subject: Reply with quote  Mark this post and the followings unread

Purring waves.

Code:
SubNoise s=>dac;int n;while(++n%241+1=>s.rate){(n%83)*ms+ms=>now;5=>Std.srand;}


I like Std.srand()

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Tue Jul 14, 2009 11:04 am    Post subject: Reply with quote  Mark this post and the followings unread

Kas, that one gets my vote for One-Liner-of-the-Year! Wow! It's like a Star Trek Phasor or something. Most excellent. Will appear on the next ChucK Show for sure.
_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Tue Jul 14, 2009 11:10 am    Post subject: Reply with quote  Mark this post and the followings unread

I'm loving this one as well, and I really like this technique now. Do you get how it works? It's funny, I'm not spoiling the game while some people might still be trying to figure it out.

Edit; this is what that last one looked like before I cut it down to line-size. It's a bit more "musical". Warning; severe syntax abuse ahead....
Code:

SubNoise n => dac;

while(1)
    {
    ((now/2::second)$int)%8 + 2 => n.rate;
    now%250::ms+ms=>now;
    5 => Std.srand;
    }

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Tue Jul 14, 2009 11:42 am    Post subject: Reply with quote  Mark this post and the followings unread

Now you're getting too crazy for me - I like the first one better. I don't get the technique, but let's let someone else figure it out, a little game shall we say? I mean, you posted your code openly so the secret is out yet I cannot fathom it. Well done Kas!

Les

_________________
"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 4 of 5 [121 Posts]
View unread posts
View new posts in the last week
Goto page: Previous 1, 2, 3, 4, 5 Next
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
e-m mkii

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


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