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
Other OOP Languages
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 2 [35 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Goto page: 1, 2 Next
Author Message
telstarmagikistferrari



Joined: Jun 16, 2008
Posts: 276
Location: Indianapolis, Indiana
Audio files: 43

PostPosted: Thu Dec 18, 2008 12:54 pm    Post subject: Other OOP Languages
Subject description: what to learn?
Reply with quote  Mark this post and the followings unread

I'm looking to expand my knowledge of OOP in general and thought I might get some C++ basics down. I have some texts on it and it honestly seems approachable after ChucKing a bit.

My question is, would anyone suggest a different language to learn? I'm interested primarily in musical capability (max/msp externals eventually?) and I've been poking around on the web. People seem to be implementing everything from Ruby, Python, Java, etc. etc. in one form or another. I'm coming at this as a relative beginner, and I thought it might be interesting to start with one of the newer languages. What do you all think? Forgive my relative ignorance, I know I might sound a little over my head to begin with, but, that said, one has to start somewhere.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Antimon



Joined: Jan 18, 2005
Posts: 3744
Location: Sweden
Audio files: 277
G2 patch files: 97

PostPosted: Fri Dec 19, 2008 4:53 am    Post subject: Reply with quote  Mark this post and the followings unread

I'm afraid of putting a flame to a gas can here, so note that this is my personal opinion.

I don't think C++ is good for anything at all really. Especially not for learning object oriented programming, as it's littered with potholes in that respect. If you are an elitist programmer looking for an exercise in writing complex code that is bug-free before the first compilation, and you need a programming language where tracing bugs is as difficult as possible, then C++ is the language for you. [If, on the other hand, you want to implement something with strong control over low-level going ons, you're better off with C, possibly combined with some kinder high level language].

I'm a fan of Java, mostly due to the massive amount of very friendly documentation that you find at java.sun.com - it will teach you everything from basic "how do I program" lessons and upwards. Though everyone might not agree with me that Java is the best programming language there is, I think it's hard to come up with any serious criticism of those Java docs, or better free alternatives for other languages.

/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
Kassen
Janitor
Janitor


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

PostPosted: Fri Dec 19, 2008 6:54 am    Post subject: Reply with quote  Mark this post and the followings unread

Antimon wrote:

I don't think C++ is good for anything at all really.


Stefan, aren't you exaggerating ever so slightly here? If there is any clear common ground between Linux, OSX and Windows it must be that all of them are written in mostly C++. It must be good for *something*...

If you want anything that performs well under serious stress (and MSP externals will certainly fall in that category) that will basically mean plain C or C++, assuming we'd like to avoid doing the whole thing in ASM (and I think us mortals will...). I'm not saying languages like Ruby or Python don't have their place as they clearly do, they are supremely well suited to some tasks but I don't think realtime DSP is amongst those tasks.

If you do want OOP and no C++ then Java would probably be one of the safer bets (I'm sure James will disagree here but I'm not sure any of his favourites are suitable for DSP). I did a quick Google and it seems that Java can be used for MAX externals as well. Python seems supported but I'm not sure about the sanity of doing DSP in Python, Frostburn didn't seem at all pleased with his results, CPU-wise.

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



Joined: Jan 18, 2005
Posts: 3744
Location: Sweden
Audio files: 277
G2 patch files: 97

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

Kassen wrote:
Antimon wrote:

I don't think C++ is good for anything at all really.


Stefan, aren't you exaggerating ever so slightly here?


Anything to spark an argument Wink

Kassen wrote:
If there is any clear common ground between Linux, OSX and Windows it must be that all of them are written in mostly C++. It must be good for *something*...


What I mean is that, from what I've seen of C++, I can't find any qualities inherent in the language that should make anybody choose that language instead of others - I see no clear benefits, only issues, and there are plenty of good alternatives around. My objections are mostly about pedagogy; I think C++ is overtly difficult to understand, easy to make mistakes in and it's too difficult to locate and correct those mistakes. This is an issue for seasoned programmers and newbies alike.

I wouldn't convert everything I encounter from C++ to Java out of pure principle, and if C++ is what you do best, then you should use it. I don't think however that you should use C++ as your introduction into OO programming, and if possible I think you should use other languages for new projects.

A good introduction to C++ is Bjarne Stroustrups "The C++ Programming Language". It's good because it shows how unnecessarily complicated the language is.

It could be that there is some crucial point in programming that I don't get. Smile Or that I focus on the wrong things. I get confused when arguing about C++ the same way I get confused when arguing about ideologies or religion.

/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
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 20730
Location: The Netherlands, Enschede
Audio files: 158
G2 patch files: 318

PostPosted: Fri Dec 19, 2008 10:54 am    Post subject: Reply with quote  Mark this post and the followings unread

Antimon wrote:
A good introduction to C++ is Bjarne Stroustrups "The C++ Programming Language". It's good because it shows how unnecessarily complicated the language is.


I agree ... I don't program in C++ often but when I have to I take that book to constantly look up what the issues are with what I'm typing.

To go back to the question, an OOP language suitable for making music other than Chuck ... SC maybe? It seems to have quite a set of modern programming features although the notation is not really like what is mainstream these days ... so maybe that's not the most suitable language to learn when the objective is to learn about OOP ... maybe Smalltalk, it may still have the clearest view on OOP and it's the system programming language for the Capybara too.

_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
jksuperstar



Joined: Aug 20, 2004
Posts: 2492
Location: Denver
Audio files: 1
G2 patch files: 18

PostPosted: Fri Dec 19, 2008 10:56 am    Post subject: Reply with quote  Mark this post and the followings unread

Considering there's compilers like Gnu Compiler for Java (GCJ), which will take a language like Java and compile it into machine code rather than bytecode or some other intermediate language, and the requirement for C++ begins to diminish. I like Python as a high-level, clean, simple, object-oriented language, but Java has so much available to it, that it seems to me to be a very good choice.

I agree that C++ is used extensively, mostly because of it's derivations from and extensions to C. Without that relationship, though, I think most programmer's would avoid it, because it has some horrible memory management and efficiency, especially for real-time, embedded apps.
Back to top
View user's profile Send private message Visit poster's website
Kassen
Janitor
Janitor


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

PostPosted: Fri Dec 19, 2008 11:29 am    Post subject: Reply with quote  Mark this post and the followings unread

Antimon wrote:

What I mean is that, from what I've seen of C++, I can't find any qualities inherent in the language that should make anybody choose that language instead of others - I see no clear benefits, only issues, and there are plenty of good alternatives around.


So, you would've written something like ChucK in Java? I agree there are issues, it's clearly way too easy to write crap in C++, modern computers feel slower then the ones I used 15 years ago and a huge part of that is crappy C++, no doubt, but I'm not at all sure what would happen if we'd write OS's in Java. The "new" Amiga OS was done in Java but I never got to try it. If applets are anything to go by this would be a utter disaster.

Quote:

My objections are mostly about pedagogy; I think C++ is overtly difficult to understand, easy to make mistakes in and it's too difficult to locate and correct those mistakes. This is an issue for seasoned programmers and newbies alike.


Likely true, but is the Java VM written in Java? If it's just about a language to learn OOP in Java would be a good pick. There are plenty of exciting systems to work with as well; Processing is probably more fun then a pure dry textbook.


Quote:

I wouldn't convert everything I encounter from C++ to Java out of pure principle, and if C++ is what you do best, then you should use it. I don't think however that you should use C++ as your introduction into OO programming, and if possible I think you should use other languages for new projects.


Yes, I agree with that. I think there are situations where C++ has advantages over plain C but I'm not sure DSP is amongst them. I'm not even sure the original question, which was about a OOP language to learn to work towards creating MAX externals makes sense. Do we really need OOP for a application like that?


Quote:

A good introduction to C++ is Bjarne Stroustrups "The C++ Programming Language". It's good because it shows how unnecessarily complicated the language is.

It could be that there is some crucial point in programming that I don't get. Smile Or that I focus on the wrong things. I get confused when arguing about C++ the same way I get confused when arguing about ideologies or religion.


As I look at it C++ is mainly a way to make developing in C practical. If speed matters C does have a lot going for it but C++ can turn quite ugly, quite quickly, like a while ago when Steve accidentally build a version of ChucK for Windows that depended on the latest version of IE to run (!!??).

I think both Java and C++ are the same in that we mainly notice them when they have become a slow, bloated mess (see all major OS's at the moment and nearly all web applets). I think Java has more potential for introductory teaching and that C++ can potentially be over a order of magnitude (if not two) faster, if written well. Which seems to be rare.

Anyway, I'm not 100% convinced OOP was a good idea to begin with. I'm not sure we would've had the current mess without it. I'm still not convinced the GUI and the mouse were a good idea and I still think you fail if your OS doesn't fit on a 1.4MB floppy. It's been decades since DOS, everything after it should've been smaller, faster and more stable, I feel, and it's been none of those. Admittedly I couldn't write a OS in pure ASM but then again I'm not paid to develop OS's either.

(edit)
Sigh, there really was no need to go into that, I'm sorry. The dark days were getting to me a bit. Apologies.

_________________
Kassen

Last edited by Kassen on Fri Dec 19, 2008 1:14 pm; edited 1 time in total
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: Fri Dec 19, 2008 11:35 am    Post subject: Reply with quote  Mark this post and the followings unread

jksuperstar wrote:
Considering there's compilers like Gnu Compiler for Java (GCJ), which will take a language like Java and compile it into machine code rather than bytecode or some other intermediate language, and the requirement for C++ begins to diminish.


Oh! I didn't know that. That changes the question quite a bit. How fast is that?

_________________
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: Fri Dec 19, 2008 11:48 am    Post subject: Reply with quote  Mark this post and the followings unread

Blue Hell wrote:
maybe Smalltalk, it may still have the clearest view on OOP and it's the system programming language for the Capybara too.


Isn't smalltalk quite slow? I'd imagine that if Smalltalk were suitable for DSP there would be no need for SC to have a separation between the "language" and the "server" and all DSP could be done in Smalltalk directly.

For what I understand of it Capybara uses a Smalltalk dialect to connect modules in the Kyma, not to write actual modules, more or less like SC.

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 20730
Location: The Netherlands, Enschede
Audio files: 158
G2 patch files: 318

PostPosted: Fri Dec 19, 2008 1:59 pm    Post subject: Reply with quote  Mark this post and the followings unread

The Computer Language Benchmarks Game

I don't know actually how deep Smalltalk goes for the Capybara, I used to have a manual but can't find it and the website is not too helpful on the subject. There are some references to CapyTalk and microsounds, these seem to be used for programming as well, and there is some mumbling about DSP assembly at places, so it could very well be that Smalltalk is used as glue, but then the question becomes how finely grained can this system be.

In general when wanting to program for performance some selected bits of code will be hand optimized (or be translated into assembly code) for speed, but it is said that for some complex (multi) DSPs a good C compiler will outperform hand optimization.

Also in general flexible features in a programming language can be slow, so for code that has to run fast these features should be avoided (maybe using OOP for fast running DSP code is not the smartest thing to do). But I see no intrinsic reason for languages like Java or Smalltalk to result in slow programs. Traditionally a language like Pascal was compiled into p-code, a virtual machine, just like Java has it's byte code interpreter. Then one day Borland came with Turbo Pascal translating Pascal into native machine code instead, resulting in programs that ran much faster. Smalltalk uses a JIT compiler, just like Java does for the same reasons, speed things up. The cost being less portability.

So how slow is Pascal? And Java? The question then becomes for what platform and using what compiler I guess ...

Traditionally C compilers have had a good deal of attention to make them generate fast code (probably because compiler theory and the development of C was in the hands of more or less the same group of people). I'm sure Java will catch up as there is a lot of energy going into it currently. I'm sure Smalltalk won't catch up as there is not going much energy into it currently, but I have no idea how good the Symbolic Sound implementation is.

Oh BTW, Lisp seemed pretty fast in some benchmarks I saw Exclamation

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


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

PostPosted: Fri Dec 19, 2008 3:19 pm    Post subject: Reply with quote  Mark this post and the followings unread

Last week I saw David Zicarelli talk about MAX/MSP and he briefly argued that he saw no reason at all why graphical languages should be slower then more traditional text-based ones... and I have to agree; if you have a very good compiler there is no reason why not to. As I understand things it will take a very good ASM programmer to out-do a modern C compiler and that has been the situation for a few years now. David, for all his commendable daring, isn't there yet; I can still tell people are using MAX by the sound alone about 90% of the time because it glitches in some characteristic way.

I'm not sure what to make of the page you linked to; each language gets compared to something else. So; Scheme PLT seems generally faster then other dialects but how does it rank up against a good C compiler? This is unclear. Clearly fastest is ASM hand-tuned by a expert ASM programmer but those are rare and it's not at all clear which one we should pick to benchmark against. Instead I'd like to compare everything to -say- C compiled by GCC on Debian Linux on a Pentium. That should be quite fast, clearly that kind of setup is suitable for OS kernels. I'm not saying that's what everybody should write, I'm certainly not about to, but I would like to see what we are paying for what convenience.

I like how in this scene we have two rather extreme scenarios; there is livecoding where expressiveness is king and you need not care about CPU usage as long as it will fit in 2 or so GHz for the duration of your performance and then there is DSP where efficiency matters a lot as hundreds (if not more) users will be using multiple copies of whatever you wrote in addition to whatever else they are doing.

At least ChucK syntax is a lot like Java and if JKS is right Java should lead to some quite fast MSP externals so not all is lost by a long stretch. That actually sounds like a rather nice road to walk.

And yes, LISP is getting fast; it was about time! A x86 is still rooted in the idea of a Turing Machine and LISP has the exact same foundations. I would imagine it *should* be fast but I'm quite sure I'm glossing over several dozen details I have no hope of ever comprehending. Again. :¬)

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



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

PostPosted: Sat Dec 20, 2008 1:00 pm    Post subject: Reply with quote  Mark this post and the followings unread

Wow! How did I miss out on this thread?

Anyway, Smalltalk-ish (and, by extension, supercollider-ish) code is likely to be slower for computationally-intensive jobs because of runtime method dispatch. If you have 1 million floating-point samples to multiply by an amplitude scaling factor, the supercollider VM has to look up the responding method for '*' 1 million times. In c++, the compiler knows you're dealing with a float array or float pointer and can put the multiplication directly in the object code.

As a relatively "pure" form of OOP, Smalltalk/supercollider are committed to the idea that everything is an object, variables don't need types because they just refer to objects (and every object knows what kind of thing it is) and work is done by message sending. This has tremendous benefits for algorithmic composition but I wouldn't want to write DSP, or a database, that way.

But ultimately it is all about the compiler. A functional language like Haskell runs at an even higher level of abstraction than even Smalltalk and by all rights it should run like molasses, but current compilers for it are pretty good and I understand its performance is competitive with languages that are supposed to derive speed optimizations from strict typing etc. If James McCartney wanted to make the supercollider VM faster, he probably could but there isn't much call for it. In supercollider land, energy is going into making the language more flexible and expressive and compositionally useful.

Speaking of functional programming, Faust is a great example of a very high level of abstraction built specifically for DSP that writes super-efficient c++ for you.

Kassen wrote:
Anyway, I'm not 100% convinced OOP was a good idea to begin with. I'm not sure we would've had the current mess without it. I'm still not convinced the GUI and the mouse were a good idea and I still think you fail if your OS doesn't fit on a 1.4MB floppy. It's been decades since DOS, everything after it should've been smaller, faster and more stable, I feel, and it's been none of those. Admittedly I couldn't write a OS in pure ASM but then again I'm not paid to develop OS's either.


Speaking now as someone with a mild disability, if the only way to interact with computers were through a command line, I would not be able to work in this field, or many others. It's possible for me only because I have choice in input methods -- mouse, text and voice input. (I'm using MacSpeech Dictate to write this message.) Yes, operating systems are out of control and I'm not crazy about the fact that OSX is larded down with bells and whistles that are interesting to the average consumer but not relevant to me. But, I can actually get stuff done here whereas a pure UNIX system with only a commandline, I'd last for no more than an hour a day.

http://dreamsongs.com/ObjectsHaveFailedNarrative.html (take with a grain of salt, but I tend to agree with the author's characterization of Java and C++ compromising and corrupting the real innovations of OOP and squeezing the best ideas out of the market)

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
telstarmagikistferrari



Joined: Jun 16, 2008
Posts: 276
Location: Indianapolis, Indiana
Audio files: 43

PostPosted: Sat Dec 20, 2008 2:54 pm    Post subject: Reply with quote  Mark this post and the followings unread

Thank you ALL for your great responses/discussion. These are just the kinds of issues I was curious about. I may sidestep my initial plans, go the Supercollider route, or perhaps CSound. I'm having trouble (surprised?) getting OSC set up properly.
I love this forum.
Mark

Edit: I also meant to say "..and continue ChucKing."

Also, on a serious note, if any of you feel like I'm sort of polluting this forum with unrelated or ignorant questions I can ease up.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Kassen
Janitor
Janitor


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

PostPosted: Sat Dec 20, 2008 3:01 pm    Post subject: Reply with quote  Mark this post and the followings unread

dewdrop_world wrote:
Wow! How did I miss out on this thread?


I really don't know, I expected you sooner, in fact :¬).

Quote:

But ultimately it is all about the compiler. A functional language like Haskell runs at an even higher level of abstraction than even Smalltalk and by all rights it should run like molasses, but current compilers for it are pretty good and I understand its performance is competitive with languages that are supposed to derive speed optimizations from strict typing etc. If James McCartney wanted to make the supercollider VM faster, he probably could but there isn't much call for it. In supercollider land, energy is going into making the language more flexible and expressive and compositionally useful.


Yes, I agree. It's not like SC considered as a system is at all slow anyway, in fact it rightfully has a reputation for being fast. I think that here more complicated factors are playing; a compiler that optimises does more work then one that doesn't. This leads to clear gains in designing UGens as there it will only need to get done once but I think conflicts may arise when we want to have a compiler that optimises a lot on code that has to be compiled while other parts of the system are already running and so depending on the CPU as well. I'm not sure how much of a factor this is in practice.

Quote:

Speaking of functional programming, Faust is a great example of a very high level of abstraction built specifically for DSP that writes super-efficient c++ for you.


Yes! Look waht Steve made; http://www.music.mcgill.ca/~sinclair/content/blog/faust2ck_a_faust_wrapper-generator_for_chuck_ugens

Quote:

Speaking now as someone with a mild disability, if the only way to interact with computers were through a command line, I would not be able to work in this field, or many others. It's possible for me only because I have choice in input methods -- mouse, text and voice input. (I'm using MacSpeech Dictate to write this message.)


Ok, that's interesting. I heard the reverse as well; some people have tried ChucK because with ChucK you can make music based on only text. If you can't see or see very little this will be easier then dealing with regular programs (like synthesis plugins) where the interface may look good to the target audience but won't support text to speech programs that allow blind people to use computers. I thought that was very interesting, I'd be in favour of systems like SC and CK getting configured for and taught to blind people. Partially because I would like to hear what kind of music people to who sound is clearly even more important then it is to you or me would make.

Quote:

Yes, operating systems are out of control and I'm not crazy about the fact that OSX is larded down with bells and whistles that are interesting to the average consumer but not relevant to me. But, I can actually get stuff done here whereas a pure UNIX system with only a commandline, I'd last for no more than an hour a day.


I see. Personally I don't see at all why a terminal couldn't take voice input, especially not something like BASH which is completely open and quite standardised. To make matters worse; in my limited experience the people that have trouble typing also tend to be the ones with a specific need for a terminal! The Irony! I think that right now graphics cards have made a lot of effects possible that look flashy, making the various OS's try to compete on that yet it's not clear to me that those effects really serve any purpose. The shadows around window borders that OSX uses by default cause me some cognitive dissonance; the desktop is flat, height has very little meaning (and the human visual system is very good at recognising that planes are above what other planes based on lines that get broken) yet those shadows are a very dominant element. When I put the graphical effects on this Linux box all out windows will "wobble" like the are made out of jelly while you move them. To me that adds no extra value and it's just distracting after the first minute of going "wow, look at that!".

OOP has a tendency to "stack things on other things", this is a very good idea in formal reasoning (math is based on it...) and can be a joy to program but it does demand a appropriate granularity which I think is often missing. To me this links to these OS questions because I'm getting the impression that this gets applied to OS interface design. The border between the OS and the included applications is blurring, even in Linux, and I'm really not sure this benefits everybody. A PC (let's include Mac for a moment) is supposed to be a *personal* computer yet we are drifting towards them being more uniform products that are related more to the company that made them then to the individual user. To illustrate; I don't like chairs (probably because they typically aren't in my size) so I have none in my room, I prefer a oversized beanbag and a low table, it's my room, that's what I like so that's what I do.

Ok, maybe that relates to OOP only loosely :¬)

Quote:

http://dreamsongs.com/ObjectsHaveFailedNarrative.html (take with a grain of salt, but I tend to agree with the author's characterization of Java and C++ compromising and corrupting the real innovations of OOP and squeezing the best ideas out of the market)


Aside from the "conspiracy theory" that I sometimes think I detect in articles like the ones you have recently linked to I do think there is a lot of merit to that style of programming. I don't think it's being pushed out of the market, really, most languages are free anyway so everybody uses what suits him or her best, I'm not sure "the market" exists in that sense. I actually think that style of programming is on the rise as it seems well suited for corporate online applications that need to be able to update without downtime. In those applications raw CPU power isn't typically the bottleneck as data transfers are more limiting.

_________________
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: Sat Dec 20, 2008 3:08 pm    Post subject: Reply with quote  Mark this post and the followings unread

telstarmagikistferrari wrote:

Also, on a serious note, if any of you feel like I'm sort of polluting this forum with unrelated or ignorant questions I can ease up.


Absolutely not. I don't believe in rigidly sticking to one topic. I don't think ChucK (or SC or....) makes any sense if we consider it in a vacuum. It's the links to other things like music, interfaces, expression, aesthetics, etc, etc, etc that make it worthwhile to work with systems like this.

_________________
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: Sat Dec 20, 2008 3:33 pm    Post subject: Reply with quote  Mark this post and the followings unread

Shifting the topic slightly, I have a related question. What would be the best language for coding web-based music applications?

Specifically, I would like to create web-based applications that work by listening to a guitar and detecting the notes that are played. In ChucK I have created a guitar tuner and the Guitar Zero practice program, and I find these programs very useful in my guitar learning journey. However I would like to create such programs and have them run from a website.

I gather Java would work, though I am having some difficulty at first glance figuring out how to program Java. OS X supposedly comes with Java built-in, but I'm confused at all the development environment options. I'm old fashioned and would like to use a text editor instead of a development environment if possible (I know, primitive!).

So is Java a good choice for these guitar applications, and if so how should I get started programming Java?

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


Joined: Apr 03, 2004
Posts: 20730
Location: The Netherlands, Enschede
Audio files: 158
G2 patch files: 318

PostPosted: Sat Dec 20, 2008 3:46 pm    Post subject: Reply with quote  Mark this post and the followings unread

Kassen wrote:
I'm not sure "the market" exists in that sense.


There are market forces though ... an example ... I recently had to write a program and the customer wanted me to write that program in C# instead of using Delphi's object Pascal (the tool I'm using most fluently). The argument being used was that the tool producer for Delphi might not survive where Microsoft is seen to be a strong party that will not fall apart. Of course there is some validity in such arguments but the best way out of this may be using open source software, as in the end Microsoft may be strong but they do have some nasty examples of dropping support for development tools.

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


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

PostPosted: Sat Dec 20, 2008 5:06 pm    Post subject: Reply with quote  Mark this post and the followings unread

That's true, Jan, fashion does play a role.... but I have some faith in evolution.

If Intercal would be seen as fashionable people might start demanding everything be done in intercal-on-Rails, from web-site interfaces to device drivers. Still, there is such a thing as evolution. If you do your device drivers in Intercal-on-Rails and the competition does theirs (probably for the same standard chip-set with a vaguely different design....) in C we'll see where things are in five years.

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



Joined: Jul 07, 2007
Posts: 1663
Location: Berks County, PA
Audio files: 39

PostPosted: Mon Dec 29, 2008 3:24 pm    Post subject:
Subject description: Responsible programming
Reply with quote  Mark this post and the followings unread

If I wanted to learn OO concepts with a decent language that has good debugging support and run-time error diagnostics when something goes sour, I'd say Java. And set up the Eclipse IDE from eclipse.org while you are at it.

If you need speed and/or are doing device level interaction or need to get at memory mapped IO, C++ is fine. It's a mess of jumbled features, but you don't need to learn them all. I wouldn't pick this as a language for learning O-O, but I wouldn't write performance critical stuff in Java. I now officially teach both at university level -- Data Structures last semester in C++, 2 sections of Java programming in guess what? -- and every so often I tell my C++ students, "Now I am going to teach you about another tool that may cut off your finger, but you need to know how to use those tools correctly." Java takes some of those away from you, but if you don't need them, alls the better

I am interested in looking at the Java audio class libraries next semester. If there is a way to string together low-level threads of native code (i.e., compiled and optimized C or C++) DSP libraries from Java as a glue language, I'd use it. Otherwise I am interested in using Python for similar purposes.

I will be using Python as essentially a "high level assembly language" in two programming languages courses this spring, one undergrad and the other grad. Assembly language because there is no compile time type checking, making it all too easy to shoot yourself in the foot. Testing takes on whole new meaning when there is no compile-time type checking. High level because Python has O-O and LISP-like features and reflection and easy to use builtin data structures.

If you strictly want to generate sounds, your best bet may be SC as suggested. I personally am inclining away from special purpose languages and towards a general purpose language like Python, that I could use to glue together compiled DSP libraries running in their own threads. I am interested in this because I want to build a low-latency piece of hardware without any b.s. operating system to add latency, and I think cross-gluing libraries for it from Python may be the fastest was to get something running.

There was some examination of OSC between Python-ChucK and also Python-SC in this thread last spring and summer. Not too hard to do.

I just got gnuchess hooked up to that Python chess-to-music game, by the way, so you can play against the gnuchess AI. Got it working on Solaris and cygwin, and a friend did a linux port. Still got some things to be cleaned up, I'll post it whenever I get time to do that.

_________________
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
usw



Joined: Mar 22, 2007
Posts: 27
Location: valence france

PostPosted: Mon Dec 29, 2008 4:36 pm    Post subject: Reply with quote  Mark this post and the followings unread

DrScheme deserves my support here, it's an amazing project, with everything one can dream of.
it's virtually bug free, cross platform...and lisp derivatives (scheme especially) are so simple, pure and powerfull...
It isn't that slow either (I'm making all my audio synthesis experiments with it) !
Back to top
View user's profile Send private message
DrJustice



Joined: Sep 13, 2004
Posts: 2054
Location: Morokulien
Audio files: 3

PostPosted: Mon Dec 29, 2008 5:20 pm    Post subject: Reply with quote  Mark this post and the followings unread

telstarmagikistferrari, while investigating (OO) languages, you ought to have a look a Ada. A widely misunderstood and underrated language with many false myths floating around. It's easy to learn and easy to read. It's reasonably modern and efficient (most things are one or the other...). It can interface with other languages. And it has many other unique and interesting features. For all it's charm and usability, you'll probably not end up using it, so it's quite safe to have a look-see Wink

DJ
--
Back to top
View user's profile Send private message Visit poster's website
BananaPlug



Joined: Jul 04, 2007
Posts: 302
Location: Philly
Audio files: 5

PostPosted: Mon Dec 29, 2008 9:22 pm    Post subject: Reply with quote  Mark this post and the followings unread

Quote:
Shifting the topic slightly, I have a related question. What would be the best language for coding web-based music applications?

PHP is very versatile and soon jumps from version 5.2.x to 5.3 adding some features.
Back to top
View user's profile Send private message Visit poster's website
Inventor
Stream Operator


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

PostPosted: Mon Dec 29, 2008 11:22 pm    Post subject: Reply with quote  Mark this post and the followings unread

BananaPlug wrote:
Quote:
Shifting the topic slightly, I have a related question. What would be the best language for coding web-based music applications?

PHP is very versatile and soon jumps from version 5.2.x to 5.3 adding some features.


Thanks for that, BananaPlug - I'll look into 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: Tue Dec 30, 2008 8:25 am    Post subject: Reply with quote  Mark this post and the followings unread

Of course it depends on what you need; PHP is great for things like hooking web-pages to databases or generating pages and so on. Java can be nice as well and even Flash in the hands of a expert can do mind blowing things.

I think it's a bit like picking between a guitar, a MiniMoog and ChucK to make music; you can't say anything about which one would be best until you know what you want.

I don't think you'll regret getting into PHP as that could be very useful for a webpage like your own anyway but I'm not entirely sure how it'll link to music right now. It doesn't look hard at all to me either. This board is done in PHP, BTW.

Don't completely ignore Flash; Flash may be proprietary and making Flash applets will cost you for the development platform but it *is* nearly universal in compatibility, it *can* be very fast even if you wouldn't say that looking at the average attempt and it's internal programming language (action script) is quite capable. For example; here is a programming system developed in Flash; http://www.i2off.org/flaxus/ That's a bit different from your average obnoxious banner, eh?

I think I'd start by figuring out what I wanted.

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 20730
Location: The Netherlands, Enschede
Audio files: 158
G2 patch files: 318

PostPosted: Tue Dec 30, 2008 8:44 am    Post subject: Reply with quote  Mark this post and the followings unread

Re. Flash, parts of the system have been made public and there are open source tools to make flash "movies". Flash does have sound support, but I found the public documentation to be a bit sketchy (in general, not only for audio).

Anyway, have a look at haXe and related tools, I'd say (it has support for PHP as well BTW).

_________________
Jan
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 2 [35 Posts]
View unread posts
View new posts in the last week
Goto page: 1, 2 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