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 
 Forum index » DIY Hardware and Software » ChucK programming language
ChucK, GUI and Processing
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [16 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
ilSignorCarlo



Joined: Sep 17, 2007
Posts: 28
Location: Bologna

PostPosted: Thu Jul 03, 2008 11:56 am    Post subject: ChucK, GUI and Processing Reply with quote  Mark this post and the followings unread

Hi,
is there any way to know if ChucK can work with a particular graphical environment?

I mean, I'd like to bind ChucK to a GUI, but I am not sure if it's gonna work. Are there requisites that a programming language or a GUI should have to be compatible with ChucK?

Or, in general, how should I test it?

I've found this environment: Processing.
It seems pretty cool and I think it would be great to use in combination with ChucK. Just not sure that it is possible.

What do you think?

_________________
Self-referential phrases, like this one, are not so funny or good for a forum signature.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Inventor
Stream Operator


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

PostPosted: Thu Jul 03, 2008 12:48 pm    Post subject: Reply with quote  Mark this post and the followings unread

Some people have attached GUI's to ChucK in the past, but as far as I can tell it's a true DIY thing because it is unlikely that others will go through your particular setup process to get your GUI working, especially when ChucK has a GUI that's due for arrival to the Linux and PC versions anytime now. We've been waiting some time for "anytime now" to roll around but it is on the next release, thankfully.

So although it may seem cool to add a GUI to ChucK, you must realize that the probability is that only you will ever use it. At least that's what happened in the past when others attempted this. So the best thing to do, IMHO, is wait for the ChucK GUI to finally arrive, sigh. Wish I could be more positive about it...

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

Processing makes perfect sense to me for this. As it's Java based the syntax isn't too different (less to learn!), it's also build as a educational intro to programming and graphics, it eats OSC, it's as cross-platform as ChucK...

As inventor points out; sharing your code (getting others to run it) will be harder but if you just need something for yourself I'd say "go!".

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



Joined: Sep 17, 2007
Posts: 28
Location: Bologna

PostPosted: Thu Jul 03, 2008 4:09 pm    Post subject: Reply with quote  Mark this post and the followings unread

Kassen wrote:

As inventor points out; sharing your code (getting others to run it) will be harder but if you just need something for yourself I'd say "go!".


Yes, I understand this. But for a project I have in mind I think I need a GUI. Anyway, in this moment I'm a newbie with ChucK.

What can I try to do just to test if a GUI works well with ChucK? How am I supposed to bind, for example, the creation of a graphical object to a ChucK object?

Sorry if the question sounds stupid.

_________________
Self-referential phrases, like this one, are not so funny or good for a forum signature.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Kassen
Janitor
Janitor


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

PostPosted: Thu Jul 03, 2008 5:25 pm    Post subject: Reply with quote  Mark this post and the followings unread

No problem, we were all newbies at one point; I myself hardly know anything about the details of Processing.

I think you should look into OSC (Open Sound Control). You could make objects (classes) in ChucK that would also send out a OSC message to Processing calling for the creation of a interface as they get initiated. From there on it would be messages back& forth. You'd have to design a little protocol that would depend on your needs but it sounds doable if advanced to me.

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

Don't let me discourage you, if you want a great ChucK GUI then I agree with Kassen, do whatever you want to! ChucK is designed to be flexible and friendly with other applications through things like OSC. I myself have not yet learned anything about OSC and it's a bit of a mystery so I can't help you, but I wish you the best of luck and look forward to some screenshots. I wish there was some decent ChucK-side documentation of OSC, but I haven't found any yet.
_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
ilSignorCarlo



Joined: Sep 17, 2007
Posts: 28
Location: Bologna

PostPosted: Fri Jul 04, 2008 1:36 am    Post subject: Reply with quote  Mark this post and the followings unread

ok, with some more search I've found that actually someone already used Processing with ChucK, using OSC to make them communicate.

Do you know if there exist a starting tutorial or something about OSC?

_________________
Self-referential phrases, like this one, are not so funny or good for a forum signature.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Inventor
Stream Operator


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

PostPosted: Fri Jul 04, 2008 3:29 am    Post subject: Reply with quote  Mark this post and the followings unread

Here is one:

http://opensoundcontrol.org/topic/151

I did a google search on "open sound control tutorial" and found several others. If you figure it out, come back and tell us how it works. I haven't invested the time to learn OSC because there is little documentation of it on the ChucK site.

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



Joined: Aug 28, 2006
Posts: 858
Location: Guangzhou, China
Audio files: 4

PostPosted: Fri Jul 04, 2008 8:19 am    Post subject: Reply with quote  Mark this post and the followings unread

If you're looking for the usual types of sliders, buttons, pop-up menus etc., another very good option is SwingOSC. It doesn't do everything processing can do, but it might save some effort because you would just have to implement the existing OSC protocol in ChucK -- no need to design your own brand-new protocol, and implement it in both ChucK and Processing.

The OSC protocol is documented here... the trickier thing is knowing which Java objects to instantiate and how to manipulate them. So I guess if you don't know swing classes, this might not be so much help.

Supercollider uses this for cross-platform GUI compatibility and it's working very well.

James

_________________
ddw online: http://www.dewdrop-world.net
sc3 online: http://supercollider.sourceforge.net
Back to top
View user's profile Send private message Visit poster's website AIM Address
ilSignorCarlo



Joined: Sep 17, 2007
Posts: 28
Location: Bologna

PostPosted: Fri Jul 04, 2008 9:40 am    Post subject: Reply with quote  Mark this post and the followings unread

dewdrop_world wrote:
If you're looking for the usual types of sliders, buttons, pop-up menus etc., another very good option is SwingOSC.


Mmm, I was searching something more flexible. I need to create objects, move them, connect objects to other objects...

Make them blink, faster or slower, depending on a metronome, for example. So I thought I could do all this with Processing.

Quote:
Supercollider uses this for cross-platform GUI compatibility and it's working very well.


Yes, I know Supercollider, but I think I prefer using ChucK.

_________________
Self-referential phrases, like this one, are not so funny or good for a forum signature.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
dewdrop_world



Joined: Aug 28, 2006
Posts: 858
Location: Guangzhou, China
Audio files: 4

PostPosted: Fri Jul 04, 2008 12:16 pm    Post subject: Reply with quote  Mark this post and the followings unread

OK, definitely Processing is a better fit for that.

(I wasn't trying to convince you to use SuperCollider btw... just pointing out an area where SwingOSC is being used successfully.)

James

_________________
ddw online: http://www.dewdrop-world.net
sc3 online: http://supercollider.sourceforge.net
Back to top
View user's profile Send private message Visit poster's website AIM Address
ilSignorCarlo



Joined: Sep 17, 2007
Posts: 28
Location: Bologna

PostPosted: Sat Jul 05, 2008 3:40 am    Post subject: Reply with quote  Mark this post and the followings unread

dewdrop_world wrote:
OK, definitely Processing is a better fit for that.

(I wasn't trying to convince you to use SuperCollider btw... just pointing out an area where SwingOSC is being used successfully.)

James


I was starting studying SuperCollider, but then someone pointed me to ChucK and it just seemed cooler to me Very Happy

Anyway, I've found this about ChucK and Processing:
http://visiblearea.com/blog/pub/VisibleArea/ProcessingandChucK/readme.txt

_________________
Self-referential phrases, like this one, are not so funny or good for a forum signature.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Kassen
Janitor
Janitor


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

PostPosted: Sat Jul 05, 2008 5:27 am    Post subject: Reply with quote  Mark this post and the followings unread

Considering that Swing OSC is a Java library, wouldn't you be able to load it in Processing anyway if you'd feel the need?
_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Antimon



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

PostPosted: Sat Jul 05, 2008 4:31 pm    Post subject: Reply with quote  Mark this post and the followings unread

Didn't see this thread until now. I'm actually tinkering with a Java GUI for arranging samples on the fly, that I intend to have communicate with a ChucK program using OSC. So the Java app does all the fancy graphics stuff and calculates times, and ChucK does the sharp timing. Most of the crucial stuff in the Java app is in place, and I have working OSC communication (using my own home-brewed UDP implementation). Now I only need to get the ChucK stuff in place.

The main reason for me doing it this way is because I wanted to try out SWT in Java and just generally experiment a bit. I might be able do this with MAUI instead. It would be interesting to try running the graphical frontend on a different computer than the sound generating one as well.

Anyway, if this sounds interesting in any way, I'll probably have something to share soon.

/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
Acoustic Interloper



Joined: Jul 07, 2007
Posts: 2067
Location: Berks County, PA
Audio files: 89

PostPosted: Mon Jul 14, 2008 6:05 pm    Post subject: Reply with quote  Mark this post and the followings unread

Antimon wrote:

The main reason for me doing it this way is because I wanted to try out SWT in Java and just generally experiment a bit. I might be able do this with MAUI instead. It would be interesting to try running the graphical frontend on a different computer than the sound generating one as well.

I've been writing a lot of SWT code this year for my job, extending Eclipse for a DSP toolset, just finishing up a grapher for run-time costs in an instruction simulator for a DSP. When it comes to GUI programming, I'd WAY rather use Tk with Python (a.k.a. Tkinter) or Tcl than use SWT. Tk lets you attach symbolic tags to graphical elements on a canvas or in a text widget and manipulate sets of elements together. I've used it for the Python-to-ChucK (or SC or Max/MSP) chess game GUI here. SWT, in contrast, is lower level, for example you have to prep a bunch of data structures for painting and then do the actual paint in your code whenever the window is exposed, resized, etc. Not that SWT is bad, just that it operates at a much lower level. The only issue with Tk is that its widget set is somewhat dated, e.g. no toolbars per se, but it's a lot handier to program, in my opinion.

EDIT: This program works on multiple machines on a LAN, although I think for best results the Python algorithmic generator should be on the same machine as ChucK; less latency and overhead that way, and the Python program does not eat much CPU.

The GUI chessboards, though, can be distributed across the LAN, so players can sit on different machines when playing their chess games.

_________________
When the stream is deep
my wild little dog frolics,
when shallow, she drinks.
Back to top
View user's profile Send private message Visit poster's website
Antimon



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

PostPosted: Tue Jul 15, 2008 1:50 am    Post subject: Reply with quote  Mark this post and the followings unread

Acoustic Interloper wrote:
Antimon wrote:

The main reason for me doing it this way is because I wanted to try out SWT in Java and just generally experiment a bit. I might be able do this with MAUI instead. It would be interesting to try running the graphical frontend on a different computer than the sound generating one as well.

I've been writing a lot of SWT code this year for my job, extending Eclipse for a DSP toolset, just finishing up a grapher for run-time costs in an instruction simulator for a DSP. When it comes to GUI programming, I'd WAY rather use Tk with Python (a.k.a. Tkinter) or Tcl than use SWT. Tk lets you attach symbolic tags to graphical elements on a canvas or in a text widget and manipulate sets of elements together. I've used it for the Python-to-ChucK (or SC or Max/MSP) chess game GUI here. SWT, in contrast, is lower level, for example you have to prep a bunch of data structures for painting and then do the actual paint in your code whenever the window is exposed, resized, etc. Not that SWT is bad, just that it operates at a much lower level. The only issue with Tk is that its widget set is somewhat dated, e.g. no toolbars per se, but it's a lot handier to program, in my opinion.


I've posted that project here: http://electro-music.com/forum/topic-27609.html

Moving from swing to SWT was enjoyable anyway. Everybody's talking about Python nowadays, so should probably check it out. I'm starting to become a bit set in my ways. Confused

/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
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [16 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