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
poster
 Forum index » DIY Hardware and Software » ChucK programming language
One-Line ChucK Crazy
Post new topic   Reply to topic Moderators: Kassen
Page 2 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
Kassen
Janitor
Janitor


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

PostPosted: Tue Jun 19, 2007 4:35 pm    Post subject: Reply with quote  Mark this post and the followings unread

Chuckles; nearly everything can read .txt files, not just Windows. Plain text is by far the safest format to use if you have no idea what the other guy is using (but can't rule out Atari's, Amigas, etc). ChucK can run .txt files just fine too, no need to rename.

Kijjaz; I realy love what you are doing and I'd like to join in but one line is so very short. I tried but wasn't able to come up with anything post-worthy.

_________________
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: Wed Jun 27, 2007 9:50 am    Post subject: Reply with quote  Mark this post and the followings unread

Code:
// Space trip to 3n+1 planet
SinOsc s=>dac; for(int i;1;<<<i>>>) for(i=>int j;(j=>s.freq)>1;ms=>now) if(j%2==0) 4/=>j; else 3*j+1=>j;


Changing 3*j + 1 to 5*j + 1 yeilds very great sounding result. Embarassed
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: Fri Jun 29, 2007 3:14 pm    Post subject: Reply with quote  Mark this post and the followings unread

Play this (not too soft!), sit back, and relax..

Code:
// 15-minute nervous system massage session
Noise a => LPF b => ZeroX c => dac; b.set(4, 1); 15::minute => now;


err.. is this unhealthy for large speakers?
Let's use a headphone ^_^

hmm maybe also not healthy for ear -_-"
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
skwrKing



Joined: Jul 24, 2007
Posts: 16
Location: MI

PostPosted: Mon Aug 20, 2007 8:52 pm    Post subject: Reply with quote  Mark this post and the followings unread

The code is probably not too interesting as I'm still very new to ChucK, but I thought it sounded interesting enough to share.

Code:
SinOsc s => dac; 1 => int i; while(30::ms => now){(i%100)*9*(i%99) => s.freq;i--;}


Now I'm rather addicted to this one-line game, so I might be back with more.
Back to top
View user's profile Send private message
kijjaz



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

PostPosted: Thu Nov 08, 2007 10:28 pm    Post subject: Reply with quote  Mark this post and the followings unread

I'm back with more noises.
this feedback loop sounds good but different at different sample rates.
it generates some sequences of evolving sound apttern cycles all the time.

i'm listening to it at 44100 sample rate.
it kinda produces some silent gaps also. it sounds more complex then.

Code:
// kijjaz:I thought my jack was not well-connected
dac => Phasor a => SinOsc b => dac; a.phase(.5); a.gain(3000); 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: Mon Jun 30, 2008 5:03 am    Post subject: Reply with quote  Mark this post and the followings unread

I've decided to collect some more ideas,
maybe very simple, but fun to do, for the one-line chuck.
so here it goes:

feel free to join and make more cute noodles (patches).

Code:
// ZeroX Hi Hats
Noise a => ZeroX b => dac; Phasor c => b; 4 => c.freq; second => now;


Code:
// ZeroX PWM impulse synth
SawOsc a => ZeroX b => dac; TriOsc c => b; 110.1 => c.freq; hour => now;


Code:
// ZeroX PWM squarewave synth
SawOsc a => ZeroX b => Gain c => c => dac; TriOsc d => b; 110.1 => d.freq; hour => now;


Code:
// ZeroX frog (tried at 44.1khz, 48.0khz sample rate)
SinOsc a => ZeroX b => dac; while(4.51::samp => now) b.last()*b.last() - a.freq() => a.freq;


Code:
// modified from above, this can sing quite beautifull
SinOsc a => ZeroX b => dac; while(400.1::samp => now) b.last()*b.last()*311 - a.freq() => a.freq;


Code:
// Bossanova ZeroX
SinOsc a => ZeroX b => dac; while(20.1::samp => now) b.last()*b.last()*10000 - a.freq() => a.freq;
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: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Mon Jun 30, 2008 7:18 am    Post subject: Reply with quote  Mark this post and the followings unread

This one sounds like a motorcycle and varies its revving pattern over time:

Code:
Noise n => SinOsc a => SinOsc b => SinOsc c => dac; c => a; c => b; b => a;
a.gain(1.1); b.gain(125); c.gain(3); day => now;


Vroom! Vroom! Very Happy

_________________
"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 Jun 30, 2008 8:47 am    Post subject: Reply with quote  Mark this post and the followings unread

Code:
// someone dropped something?
Impulse a => Chorus b => b => Chorus c => c => dac; a.next(1); minute => now;


Code:
// Racing Car's Vibrato
SqrOsc a => SinOsc b => TriOsc c => a => dac; a.sync(2); b.gain(20); hour => now;


Code:
// Sorry... wrong number -_-
SinOsc a => dac; while(70::ms => now) now%second/ms * a.phase() - a.freq() => a.freq;


Code:
// PRESS SELECT
SawOsc a => dac; while(100::ms => now) now%second/ms * a.phase() - a.freq() => a.freq;


Code:
// how long is the reverb? (try with other kinds of reverb also)
Impulse a => NRev b => ZeroX c => dac; a.next(1); hour => now;


Code:
// Take Cover! ChucK fights back!!
Impulse a => LPF b => dac; a.next(1); b.set(-100000, 1000); hour => 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: Mon Jun 30, 2008 4:40 pm    Post subject: Reply with quote  Mark this post and the followings unread

I love how "press select" does something slightly different every time yet it all fits the name.

Last one is best for me, really old-school video game boss-explosion; Be attitude for gains!

Go Kijjaz!

_________________
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: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Mon Jun 30, 2008 6:21 pm    Post subject: Reply with quote  Mark this post and the followings unread

Here is a fun one, it's a musical instrument that goes "Boing" when you touch the microphone:

Code:
// touch the microphone to play the instrument (adjust volume to prevent feedback)
adc => BPF f => dac; f.freq (85); f.Q (50); f.gain (100); day => now;


Kijjaz is the master of one-liners, but I have some creativity also! haha!

_________________
"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: Mon Jun 30, 2008 6:26 pm    Post subject: Reply with quote  Mark this post and the followings unread

Here is a very simple one, it is just a SinOsc in a feedback loop with the speakers and mic. Very interactive.

Code:
// feedback, play with volume, touch microphone, whistle into microphone
adc => SinOsc s => dac; adc.gain(85); day => now;


Adjust microphone to medium and it will sing a sad song of woe.

_________________
"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: Mon Jun 30, 2008 6:54 pm    Post subject: Reply with quote  Mark this post and the followings unread

This one will sound like you are playing an arcade game from the 80's and will also vocode your voice (once you get the volume adjusted properly)

Code:
// ChucKtastic Vocoder inside of arcade game
adc => PitShift p => dac; adc.gain(10); p.mix (1); p.shift (1.2); day => now;


Try whistling or talking or just typing on the keyboard. Neato! I like this microphone feedback stuff!

_________________
"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: Mon Jun 30, 2008 7:29 pm    Post subject: Reply with quote  Mark this post and the followings unread

This one is just a change of the previous one, but it produces a very good demonic vocoder effect. Sounds like you're a demon or something. Spooky, I may use it in a song.

Code:
// Demonic Vocoder
adc => PitShift p => dac; adc.gain(10); 1 => p.mix; p.shift (0.8); day => now;

_________________
"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 Jun 30, 2008 8:23 pm    Post subject: Reply with quote  Mark this post and the followings unread

Kassen: Thanks! ^_^ I'm loving it hahaha..

Inventor: wow.. yes these ones you did is cool for dealing with acoustic feedback of its own patch ^_^..

i'd like to play more with this simple one:

Code:
// Big Boss and his Eyeballs
Impulse a => LPF b => dac; a.next(1); b.set(-10001, 1000); hour => now;


now i'm gonna change the b.set freq and Q value.
The sample rate used is 44100
b.set(-696969, 869); // a lone motorcycle with no owner
b.set(-15000, 1000); // charging.. (for final blow)
b.set(-5999, 9999); // final blow!!! ahh.. missed -_-"
b.set(-2000, 9999); // warping back to base station
b.set(-1100, 6000); // summoning the Legendary Sword
b.set(-999999, 99999); // using the Legendary Sword to chop an onion
b.set(-21000, 99999); // head-chopping
b.set(-12700, 100); // STOP COOKING! we've got company
b.set(-12900, 100); // running...
b.set(-11400, 200); // They've got a Tank!!
b.set(-11800, 200); // Planet's polyrhythmic military marching band
b.set(-11800, 200); // The Marching Band run for their lives (always)
b.set(-10200, 120); // the tank fires..
b.set(8000, -1); // i'm invincible!!
b.set(-12000, -1); // The Legendary sword is powerful!!
b.set(-6969, -1); // kill!
b.set(-1000000, -1); // a drop of blood
b.set(-100500, -1); // keep punching
b.set(-101400, -1); // Kung-fu punching
b.set(-5555, 3000); // enough for today -_-
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Rinko



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

PostPosted: Tue Jul 01, 2008 2:28 pm    Post subject: Reply with quote  Mark this post and the followings unread

this is really fun!

great idea and has intrduced me to some fundamentally different ways of using ChucK.

thank you!

p.s. hopefully will post something soon but my efforts so far have been poor
Back to top
View user's profile Send private message
Inventor
Stream Operator


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

PostPosted: Tue Jul 01, 2008 6:47 pm    Post subject: Reply with quote  Mark this post and the followings unread

Rinko, I have had some success with the following one-liner approach:

Code:
adc => some_ChucK_thing => dac; adc.gain(10); day => now;


It works with an audio feedback loop and produces interesting effects. Just change some_ChucK_thing into something creative and give it a try. Good luck!

_________________
"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: Thu Jul 03, 2008 1:46 pm    Post subject: Reply with quote  Mark this post and the followings unread

cheers Inventor, just having a play with that now!

if only I could ChucK all day instead of work...hmmm

still aiming for something postworthy!
Back to top
View user's profile Send private message
Yellow Onion



Joined: Jul 14, 2008
Posts: 7
Location: Christchurch, New Zealand

PostPosted: Wed Jul 23, 2008 9:53 am    Post subject: Reply with quote  Mark this post and the followings unread

I've synced the Frequency with the volume of the mic
try changing the g.gain value to adjust the frequency range
Code:
adc => Gain g => SinOsc s =>  dac; 2000 => g.gain;0 => s.sync;1::day => now;
Back to top
View user's profile Send private message
Inventor
Stream Operator


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

PostPosted: Wed Jul 23, 2008 1:32 pm    Post subject: Reply with quote  Mark this post and the followings unread

nice one, yellow onion, and welcome!
_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Yellow Onion



Joined: Jul 14, 2008
Posts: 7
Location: Christchurch, New Zealand

PostPosted: Wed Jul 23, 2008 10:00 pm    Post subject: Reply with quote  Mark this post and the followings unread

I've been wanting to grab the RMS value from a 10ms period (100Hz) and dynamically change it ever sample, maybe I don't need to do this part 10ms is probably short enough to not notice a difference
this way you can get more smoother sounds at higher frequencies
probably be dynamite on the CPU though,

I just realised a RMS calculator is in the analyse section, heh
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 Jul 23, 2008 10:25 pm    Post subject: Reply with quote  Mark this post and the followings unread

I was implementing the way to measure energy / loudness with this method:

(signal) => Gain g; (signal) => Gain dummy => g; 3 => g.op;
// to calculate signal ^ 2
Gain g => Gain sum => Gain sum_feedback => sum;
// to accumulate signal ^ 2
// and we can set sum_feedback.gain to change release ratio.
// normally, I calculate this ratio from 1.0-DecayRate/SampleRate

If we take square root of sum.last(), we'll have RMS right away.
but it might take too many characters for a one-line chuck.
so using the sum.last() right away is okay.
the DecayRate tells how long you want to accumulate from the (signal).
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: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Wed Jul 23, 2008 10:30 pm    Post subject: Reply with quote  Mark this post and the followings unread

Erased post, misunderstood kijjaz's code. It's OK the way it is. Bleh, what a slow week this is on the forum! We need a little excitement.
_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Yellow Onion



Joined: Jul 14, 2008
Posts: 7
Location: Christchurch, New Zealand

PostPosted: Thu Jul 24, 2008 2:34 am    Post subject: Reply with quote  Mark this post and the followings unread

Here's my one using the RMS analyser

Code:
adc => FFT fft =^ RMS rms => blackhole;SinOsc s => dac;256 => fft.size;Windowing.hann(256) => fft.window;while( true ){rms.upchuck() @=> UAnaBlob blob;blob.fval(0) * 400000 => s.freq;fft.size()::samp => now;}


don't ask why I need 400k but it works

maybe abit long for a one liner, but the original code actually had, a full rectifier and Reverb (and comments) in it, but I shrunk it down to fit in to one line

more readable form,
Code:
// our patch
adc => FFT fft =^ RMS rms => blackhole;
SinOsc s => dac;
// set parameters
256 => fft.size;
// set hann window
Windowing.hann(256) => fft.window;

// control loop
while( true )
{
    // upchuck: take fft then rms
    rms.upchuck() @=> UAnaBlob blob;
    blob.fval(0) * 400000 => s.freq;

    // advance time
    fft.size()::samp => now;
}
Back to top
View user's profile Send private message
Inventor
Stream Operator


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

PostPosted: Thu Jul 24, 2008 2:55 am    Post subject: Reply with quote  Mark this post and the followings unread

That was a cool one yellow onion. and it looks like it fits on two lines of 80 characters. so it's the big brother of one line ChucK, it is two line ChucK. haha. It makes an interesting sound that changes with volume and responds to voice, nice work.
_________________
"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: Thu Jul 24, 2008 10:17 am    Post subject: Reply with quote  Mark this post and the followings unread

That's why I had another topic in this forum: Two-Line ChucK Crazy - for use with unit analyzers.. hehhe.
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
Page 2 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


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