Author |
Message |
BobTheDog
Joined: Feb 28, 2005 Posts: 4044 Location: England
Audio files: 32
G2 patch files: 15
|
Posted: Wed Oct 15, 2008 6:47 am Post subject:
Chuck Versus SuperCollider |
|
|
Hi Guys,
Are there any advantages/disadvantages of Chuck compared to Supercollider.
I have done a little playing with Chuck on a PC and it seems very inefficient compared to Supercollider with very high cpu load, is this normal?
Cheers
Andy |
|
Back to top
|
|
|
Kassen
Janitor
Joined: Jul 06, 2004 Posts: 7678 Location: The Hague, NL
G2 patch files: 3
|
Posted: Wed Oct 15, 2008 10:17 am Post subject:
Re: Chuck Versus SuperCollider |
|
|
BobTheDog wrote: |
Are there any advantages/disadvantages of Chuck compared to Supercollider.
|
The main advantage over SC is that you don't have to hang out with SC users. I heard that people who use SC eat babies and support terrorism, don't trust them. ;¬)
(also; we have several topics now that go into this in more detail... more seriously as well)
Quote: |
I have done a little playing with Chuck on a PC and it seems very inefficient compared to Supercollider with very high cpu load, is this normal?
|
Yeah, it's normal. Aside from SC having had the time to place more emphasis on optimisation, the major difference is block processing. Block processing saves LOTS of cpu but the cost is that you can't straightforwardly use a feedback loop and expect it to only give the Z-1 sample in latency. ChucK will always be sample accurate, in fact it's quite a few orders of magnitude more accurate then that for signals that aren't audio signals.
This comes at a price, being a relatively high CPU cost. Ge is working on it; we'll have context-sensitive block processing that intelligently sorts out where to use block processing and where to go "a sample at a time", but this may take a while to get done.
Optimising ChucK code for CPU usage takes a bit of knowledge and experience but it's definitely possible. If you're running into CPU issues on your first few days it's more likely that we need to have a little look at your code... but then again; maybe you are trying additive synthesis, in that case there may be a real problem.
PS; I quite like my friends who use SC and I like to lurk at their list. _________________ Kassen |
|
Back to top
|
|
|
BobTheDog
Joined: Feb 28, 2005 Posts: 4044 Location: England
Audio files: 32
G2 patch files: 15
|
Posted: Wed Oct 15, 2008 10:42 am Post subject:
|
|
|
Well I wasn't doing much, a noise oscillator example was using 75% cpu on my little EeePc 1000, maybe it is a problem with Intel Atoms.
I was also using miniAudicle so maybe the issue was there, I will get the command line version and have a look at that. |
|
Back to top
|
|
|
Kassen
Janitor
Joined: Jul 06, 2004 Posts: 7678 Location: The Hague, NL
G2 patch files: 3
|
Posted: Wed Oct 15, 2008 10:50 am Post subject:
|
|
|
EeePc means Linux, right?
Get a Rt kernel if possible, it'll save a lot of CPU for ChucKing, I have no idea exactly why but it'll get you a lot more CPU headroom. _________________ Kassen |
|
Back to top
|
|
|
BobTheDog
Joined: Feb 28, 2005 Posts: 4044 Location: England
Audio files: 32
G2 patch files: 15
|
Posted: Thu Oct 16, 2008 7:51 am Post subject:
|
|
|
I gave up on linux and stuck XP on the thing as I wanted to run Max 5. |
|
Back to top
|
|
|
Kassen
Janitor
Joined: Jul 06, 2004 Posts: 7678 Location: The Hague, NL
G2 patch files: 3
|
Posted: Thu Oct 16, 2008 2:24 pm Post subject:
|
|
|
Ah, ok.
Well, that's a good reason then; Max won't run on Linux. XP on a EEE is a bit too specific for me to say anything about. XP, IMHO, needs stripping for audio usage but then the EEE is especially appealing for mobile internet usage and so disabling things like fire-walls and so on does seem to defeat the purpose of the device a little.
75% is still a lot, how many MHz are we talking here? Could I take a look at this osc? _________________ Kassen |
|
Back to top
|
|
|
dewdrop_world
Joined: Aug 28, 2006 Posts: 858 Location: Guangzhou, China
Audio files: 4
|
Posted: Thu Oct 16, 2008 4:41 pm Post subject:
Re: Chuck Versus SuperCollider |
|
|
Kassen wrote: | BobTheDog wrote: |
Are there any advantages/disadvantages of Chuck compared to Supercollider.
|
The main advantage over SC is that you don't have to hang out with SC users. I heard that people who use SC eat babies and support terrorism, don't trust them. ;¬) |
How did you find out? That's a carefully guarded secret.
Anyway, as a whole SC users are nicer than certain Ruby users...
James _________________ ddw online: http://www.dewdrop-world.net
sc3 online: http://supercollider.sourceforge.net |
|
Back to top
|
|
|
Kassen
Janitor
Joined: Jul 06, 2004 Posts: 7678 Location: The Hague, NL
G2 patch files: 3
|
Posted: Thu Oct 16, 2008 4:58 pm Post subject:
Re: Chuck Versus SuperCollider |
|
|
dewdrop_world wrote: |
How did you find out? That's a carefully guarded secret. |
Oh, I got Nescivi drunk, of course!
Quote: |
Anyway, as a whole SC users are nicer than certain Ruby users...
|
I saw that. I promptly proposed we turn that quote into a Tshirt, added it to the WiKi under "propaganda"... then when nobody else turned out to be as enthusiastic as I was I added it to my MySpace page.
I also wrote to the list that I wondered why we didn't, I mean; ChucK and me have been together for years, we spend many emotionally intimate night together... why not? I concluded that it might've been because I've been so critical of ChucK and how that never goes over well in relationships.
Again nobody shared my enthusiasm for Giles either but I hope he'll write more on this subject. _________________ Kassen |
|
Back to top
|
|
|
BobTheDog
Joined: Feb 28, 2005 Posts: 4044 Location: England
Audio files: 32
G2 patch files: 15
|
|
Back to top
|
|
|
kijjaz
Joined: Sep 20, 2004 Posts: 765 Location: bangkok, thailand
Audio files: 4
|
Posted: Fri Oct 17, 2008 11:36 am Post subject:
|
|
|
Maybe if we can replace Math.sin with some other mothods in there, it would improve a lot.
how about using a Sine Wave look-up table? |
|
Back to top
|
|
|
BobTheDog
Joined: Feb 28, 2005 Posts: 4044 Location: England
Audio files: 32
G2 patch files: 15
|
Posted: Fri Oct 17, 2008 12:57 pm Post subject:
|
|
|
A lookup table would improve performance I am sure.
I can run 10 of these on my MacBook and it only uses 10% cpu so i think there must be an issue with the EeePc audio drivers, I have been meaning to get a little usb sound adapter maybe now is the time.
Cheers
Andy |
|
Back to top
|
|
|
kijjaz
Joined: Sep 20, 2004 Posts: 765 Location: bangkok, thailand
Audio files: 4
|
Posted: Sat Oct 18, 2008 1:31 pm Post subject:
|
|
|
I'm very new to Supercollider now and I try to spend my free time before going to bed
(sometimes till 7am -_-'.. not good)
practicing Supercollider.
But it's like learning new language and adjusting my thinking style also.
It's my first time programming in very object-oriented and functional language.
I kinda like what I can do with data structures (array, list, set, ... and their methods)
It's also one thing I want to see more in ChucK also.
But I still can't think smoothly in SC.
I just need more time.
and I might be able to try what I have done in ChucK with SC.
Now I still feel that ChucK and SC are still quite different that..
learning both language is nice.
After many languages I have tried,
ChucK really changed how I think about audio programming.
It feels straight-forward for me.
But still, I'd like to combine that with features from other languages also.
Cheers to all. |
|
Back to top
|
|
|
Kassen
Janitor
Joined: Jul 06, 2004 Posts: 7678 Location: The Hague, NL
G2 patch files: 3
|
Posted: Sat Oct 18, 2008 2:05 pm Post subject:
|
|
|
BobTheDog wrote: | A lookup table would improve performance I am sure.
|
Are you sure? I'm not sure this is true any more on modern systems, especially as the table would be in RAM, not cache. A problem here is that benchmarking ChucK is quite hard as ChucK doesn't keep track of the time spend doing stuff. There are great reasons for that, and generally speaking it's a big strength but benchmarking is hard. You can do the same thing a million times and use a stopwatch, but that seems quite crude.
Still, it's indeed the sin() that looks most likely to be the issue to me in this code here. _________________ Kassen |
|
Back to top
|
|
|
Kassen
Janitor
Joined: Jul 06, 2004 Posts: 7678 Location: The Hague, NL
G2 patch files: 3
|
Posted: Sat Oct 18, 2008 4:12 pm Post subject:
|
|
|
kijjaz wrote: | I'm very new to Supercollider now and I try to spend my free time before going to bed
(sometimes till 7am -_-'.. not good)
practicing Supercollider.
But it's like learning new language and adjusting my thinking style also.
|
Kijjaz, could you keep us up to date here or perhaps point us to a blog feed or something? I'm interested in your project here and would like to hear more about it if/when you have news. _________________ Kassen |
|
Back to top
|
|
|
kijjaz
Joined: Sep 20, 2004 Posts: 765 Location: bangkok, thailand
Audio files: 4
|
Posted: Sat Oct 18, 2008 8:08 pm Post subject:
|
|
|
Hmm... yes. I should use my blog to collect some of my experiences while starting SC as a newbie.
will come and post again. |
|
Back to top
|
|
|
Inventor
Stream Operator
Joined: Oct 13, 2007 Posts: 6221 Location: near Austin, Tx, USA
Audio files: 267
|
Posted: Sat Oct 18, 2008 9:26 pm Post subject:
|
|
|
kijjaz, you always have interesting things to say, keep us posted on your SuperCollider adventures if you like.
Andy, why not use a SinOsc oscillator and access it with .last()? Something like this (untested code):
Code: | SinOsc osc => blackhole;
1 => osc.freq;
while (true) {
osc.last() => p.pan;
10::ms => now;
} |
Whenever you can code something with UGens it tends to be more efficient. _________________ "Let's make noise for peace." - Kijjaz |
|
Back to top
|
|
|
BobTheDog
Joined: Feb 28, 2005 Posts: 4044 Location: England
Audio files: 32
G2 patch files: 15
|
Posted: Sun Oct 19, 2008 2:13 am Post subject:
|
|
|
Well the code is just one of the examples that comes with the Chuck installation so I have not coded it up.
Just sending a sin osc to the output uses loads of cpu.
I tested supercollider on the EeePc and it runs with very low cpu, also Max 5 and Reaktor seem to run fine, very strange.
Andy |
|
Back to top
|
|
|
Kassen
Janitor
Joined: Jul 06, 2004 Posts: 7678 Location: The Hague, NL
G2 patch files: 3
|
Posted: Sun Oct 19, 2008 4:45 am Post subject:
|
|
|
Yeah, that's strange. ChucK simply *is* hard on the CPU (and what looks like a partial solution is in the pipeline) but this does sound like a bit much to me.
The examples, BTW, typically aren't optimised for efficiency. That dir is a great resource but here and there there are some bits that I frown on a bit. Some give errors, some leak memory, some have constructs that I'd call just plain weird. I think this is partially to blame on many of the examples being quite old. I wouldn't be surprised if this one was older then the .last() function which in this case is indeed preferable.
Maybe we should set up a small task-force and give the examples a good tuning up. _________________ Kassen |
|
Back to top
|
|
|
fabb
Joined: Dec 13, 2008 Posts: 7 Location: a small village in austria
|
|
Back to top
|
|
|
dewdrop_world
Joined: Aug 28, 2006 Posts: 858 Location: Guangzhou, China
Audio files: 4
|
Posted: Sun Feb 22, 2009 8:39 pm Post subject:
|
|
|
Thanks for bumping this thread. I had wanted to take a look at Giles's "revolutionary" talk and see what all the fuss was about, but never got around to it. I'll give him credit for style. Not sure how revolutionary it really is, although I'm generally sympathetic to the bottom-up model of entrepreneurship he advocates.
He's still a self-important twit some of which attitude might be there to cover up the potentially embarrassing fact that a good chunk of Archaeopteryx could be written in supercollider with a fraction of the code. "Probability matrix" sounds fancy, but with pattern-style lazy evaluation in SC, the probabilities can be rendered in just a couple of lines of code.
Code: | p = Pbind(
\probability, Pseq(probability_matrix_row_here, inf),
\freq, Pif(Pwhite(0.0, 1.0, inf) < Pkey(\probability), 1, \rest),
\delta, 0.25,
... other parameters
).play; |
And he's awfully proud of using lambdas for everything, but... get this... in SC, every Function is a lambda! I guess one of the perks of using Ruby for this is that he can go into a room full of people who don't know anything about computer music, and they think he's a genius or something. But kudos to him if he can sell it to DJs...
And I found here that James McCartney (author of supercollider) already took him down *LOL*:
Quote: | fnoise 3 points 4 months ago[-]
The probability matrix algorithm he talks about is very old hat. He is apparently ignorant of what has been done in the field of computer music and live coding, and when it is brought to his attention he is an asshole about it.
"The people who wrote ChucK got academic funding to work on a music software project. They didn't do it on their own dime, like me." Who fucking cares. I wrote SuperCollider on my own dime. It is available for free. Puredata is available for free. So is ChucK. So is Csound. So is Impromptu, etc..
Other people have done it first, and done it better. He's a noob. |
James _________________ ddw online: http://www.dewdrop-world.net
sc3 online: http://supercollider.sourceforge.net |
|
Back to top
|
|
|
kijjaz
Joined: Sep 20, 2004 Posts: 765 Location: bangkok, thailand
Audio files: 4
|
Posted: Sun Feb 22, 2009 10:58 pm Post subject:
|
|
|
wahahahaha |
|
Back to top
|
|
|
fabb
Joined: Dec 13, 2008 Posts: 7 Location: a small village in austria
|
Posted: Mon Feb 23, 2009 1:29 am Post subject:
|
|
|
anniway, i'm now getting interested into supercollider as well. i just played around in chuck a bit, but i sometimes miss the graphics overview from reactor-similar approaches (currently playing with synthmaker, which has a quite cool way of generating graphics interfaces modularly - but many limitations otherwise).
currently reading "microsound" from curtis roads where he stated he likes supercollider as it has graphical envelopes. is there a way to do that in chuck too? just code makes me wanna jump out of the window...
both chuck's and supercollider's code looks quite clean, i found this comparison wiki: http://wiki.cs.princeton.edu/forums.html/Parallel_code_examples_in_SuperCollider_and_ChucK
still can't decide which one to prefer. |
|
Back to top
|
|
|
Inventor
Stream Operator
Joined: Oct 13, 2007 Posts: 6221 Location: near Austin, Tx, USA
Audio files: 267
|
Posted: Mon Feb 23, 2009 3:23 am Post subject:
|
|
|
fabb, welcome to electro-music.com. There are some very limited ways to do graphics with ChucK. Currently only on Macs, ChucK has some GUI tools which include sliders, buttons, and LEDs. These are promised to become cross-platform to PC and Linux in the next release.
Using these GUI objects I have been able to create arrays of LEDs for crude oscilloscopes, spectrum analyzers, and music games. You can also make sliders move around in real time and I once even made a pong game by moving buttons around on the screen (this is not a supported use of the GUI but it kind of works).
One other approach that I tried successfully was to make ChucK send out text to the console monitor which was actually POV-Ray source code for creating animations. I then copied and pasted the console monitor into POV-Ray's editor and let it chew on the animation for a while, creating a .mov file. then I united the ChucK audio output from a .wav file with the .mov file using Apple's iMovie software. You can see these movies on my web page by clicking on the www link below.
There is also OSC, or Open Sound Control, which allows messaging between applications. I do not know much about OSC but you might be able to use it to link ChucK with some real-time graphics application.
Oh, you can also use Jack or Soundflower or a Y cable to route audio from ChucK to some software that listens to music such as a visualizer or a software oscilloscope.
So those are some possibilites, each with their own limitations. Gluck, which is Graphical ChucK will eventually become available or so they say, but it may be quite some time before that happens. Good luck and have fun. _________________ "Let's make noise for peace." - Kijjaz |
|
Back to top
|
|
|
kijjaz
Joined: Sep 20, 2004 Posts: 765 Location: bangkok, thailand
Audio files: 4
|
Posted: Mon Feb 23, 2009 6:32 am Post subject:
|
|
|
I'd like to see a modular GUI application that can link with ChucK easily through OSC.
Something that we can code in chuck fast and interact quickly on an interface. Maybe with some basic graphical tools.. hmm Sliders, Knobs, Toggles, Bang switches, Text areas, Patch cords, Output Text boxes, Plots.
Maybe with this we can develop many more ways we can interact with ChucK especially though network. Anyone working in this field already? I have the idea but still don't know how to develop this kind of thing. Maybe in Java or Processing or just GTK. lol. |
|
Back to top
|
|
|
dewdrop_world
Joined: Aug 28, 2006 Posts: 858 Location: Guangzhou, China
Audio files: 4
|
Posted: Mon Feb 23, 2009 7:12 am Post subject:
|
|
|
kijjaz wrote: | I'd like to see a modular GUI application that can link with ChucK easily through OSC. |
http://www.sciss.de/swingOSC/ - supports buttons, sliders, 2d sliders, multislider arrays, list boxes, popup menus, user-definable views, drag-n-drop views, scrolling containers, and (with Java Media Framework) a movie view. It is seriously dope. Attached are a couple of graphics - one with the SC class browser in Cocoa and the other, the same thing in Swing. Functionally identical.
You just need the ChucK classes to implement the OSC interfaces. That's a lot of work but would be well worth it - it would do more than MAUI and work on any Java-ready platform.
James
Description: |
|
Filesize: |
239.52 KB |
Viewed: |
171 Time(s) |
This image has been reduced to fit the page. Click on it to enlarge. |
|
Description: |
|
Filesize: |
79.85 KB |
Viewed: |
175 Time(s) |
This image has been reduced to fit the page. Click on it to enlarge. |
|
_________________ ddw online: http://www.dewdrop-world.net
sc3 online: http://supercollider.sourceforge.net |
|
Back to top
|
|
|
|