What programming language to learn to prepare for SClang?


#1

About 4 months ago I worked with SuperCollider and I realize that starting SuperCollider without programming basics is complicated.

Of course, I do it by pecking here and there in the various tutorials and by asking questions in this forum, but I am often blocked by lack of experience in programming … and there are no systematic courses of programming language in SClang.

What would you recommend to me as a programming language that is sufficiently close to SClang, with consequent teaching resources?

Thank you :slight_smile:


#2

You could try learning Ruby ! It’s pretty close in a lot of areas, and a nice little language to learn.


#3

Take my advice with a grain of salt, because I am not a good programmer.

I started out with python, which isn’t syntactically close to sclang at all, but I learned some object-oriented concepts nonetheless that helped me out with sc. I used the book “learn python the hard way” by Zed Shaw. Once I finished that, I worked through some of project Euler (https://projecteuler.net), which helped with thinking about programming problems.

If you go with something like Ruby, Zed Shaw also has “learn ruby the hard way.” And project Euler is language agnostic.


#4

my advice is to focus on making music/sound with the skills you have and not worry about whether you’re on the ideal pedagogical track. if something is too challenging, then it’s okay to shelve it and try something less ambitious, and come back to it when you’re more experienced. we’re also a beginner-friendly environment here, and we’d be happy to help with any obstacles you run into.

but i get if you want to learn a more mainstream language. i recommend Python and JavaScript, both excellent beginner languages that are popular and very practical to know. (similarity to SC is not as big of a deal as you might think.)


#5

IMO it’s definitely possible to start with SC as a first programming language, some of our students are doing so. Though it’s good to know other programming languages as well (and you probably will at some point) I don’t think it’s necessary to learn them in order to learn SC.

Programming is something that you learn primarily by doing. Start with basic building blocks: loops, conditionals (help file ‘Control Structures’), arrays etc. Then pose yourself simple questions, where you can write the solution via a short Function (e.g. list all numbers between a and b that fullfil a certain numerical condition, etc.; start with easy tasks and extend them step by step)

Snoop the SCClassLibrary: many SC methods are written in SC itself, the source files Array, Collection, SequenceableCollection etc. contain many such methods. Read them and try to understand every step (e.g. ‘sputter’, ‘removeAllSuchThat’, ‘fib’ …). Methods are very much like Functions, the difference in syntax is minimal (see the help file ‘Writing Classes’).


#6

Thank you for your opinion, I will think a little :slight_smile:


#7

I’d give a +1 for learning SuperCollider itself, rather than coming at it from another language. I’m a musician, not a programmer, and the only way I’ve made any progress at all in learing to code is by having something to work on that gives me musical results. (In another forum, I’m on the cusp of beginning to learn how to write my own convenience methods… so progress has been made!)


#8

Just my (late) 2c - SuperCollider was my first programming language, almost 9 years ago. I’ve been a professional programmer in C++ for the last 5 years. SuperCollider is a wonderful language to learn with. And don’t be fooled - although it’s geared towards sound it’s a very capable general purpose language too.

Admittedly there aren’t as many tutorials out there online as something like Python. But that’s compensated by the fact you’ll be doing projects and experimentation in a subject that actually excites you (sound & music), and that is worth its weight in gold. You will get frustrated, you will want to quit. But you’ve got a much better chance of persevering through a topic that fascinates you than if you’re doing arbitrary example projects or challenges that you’re not genuinely interested in.


#9

For me it only make sense to learn a programming languange if you know exactly which of your problems it will solve. Learning Python, Ruby or Javascript just because they are trend is quite useless if you are not going to work a lot with them. If dont work, you forget.

If you want to become an artist instead of a programmer/developer/data scientist/ engineer than you should definetively consider learning Arduino (which is basically C++) and Processing( which is basically Java). This will improve both your programming skills as well as your digital art skills (sensors, controlers, hacking, circuit bending, working with video, etc). Processing also have a Javascript sub languange, which is an awesome introduction to web programming, digital art and Javascript itself.

After this intro with Arduino and Processing, you will feel more confortable to try out Phyton or Javascript because you will know where you want go by learning them.


#10

Thank you all for your suggestions and feelings :slight_smile:

I think attracting musicians to supercollider is a good thing. I have seen messages that say that we need tutorials where we quickly make music, otherwise it is discouraging for a beginner. But I, what seems to me the most difficult, is, once past the period where we have already done some simple introductory tutorials, it is to be faced with a mass of information (the documentation of SuperCollider) without pedagogical order.

I would be really happy to find a structured course and - why not - with exercises and answers and also a follow-up by a teacher. It would not stop me from continuing to learn according to what I need in my musical projects, but I think it would be very complementary: On the one hand the experimentation, on the other build a solid foundation.

But I suppose that this kind of thing (courses) is hardly possible for a language as confidential as SClang.

In any case, with or without course, fortunately this forum exists and you are there!

Thank you!


#11

What do you mean by confidential?
I used to teach computer music at UW Seattle and have older course materials I made that I’m happy to share, but they do rely on a rather idiomatic approach that avoids things like Patterns. That being said, if you are interested let me know and I’ll aend them your way.


#12

@josh - I just wanted to say that this is a language that is primarily for people interested in sound and music (unlike Python or Java are more general …). So, a small public … and it’s far from being a criticism.

Do you think it is possible to approach your courses with little programming basics? I have no university degree and am completely self-taught. If so, it may interest me.


#13

ah - makes sense. And it’s funny you say that - my first year learning SC, I wound up using it to do my taxes (and I even made a simple GUI for the other grad students to use for theirs!).
There is some programming basics in there… message me your email address, and I’ll send the notes your way.


#14

Thank you very much, Josh


#15

Yes, this was very much my experience as well, and I think it’s a really important point. One of the biggest hurdles I encountered when I started learning SC seriously a couple years ago (as a musician with 10+ years of experience with Max but barely any computer science or software development fundamentals) was the gap between “didactic/example code” (what might get you through an undergraduate course, say) and “production code” (what you might actually use as a touring musician or integrate into an already-existing compositional practice).

SC absolutely does scale to those use cases but in order to get there it helps to be able to draw on cs and development knowledge and learn best practices that are not SC-specific. In my opinion the fact that above a certain level of complexity your problems look more like generic software development problems (for which there are orders of magnitude more resources available than there are for sclang or any other particular computer music platform) is one of the greatest strengths of SC.

Having said that, I agree that it’s not the greatest idea to learn sclang by learning a contemporary “vocational” language like Python or JS, but I did feel that there was lots of value for me in learning a bit about the “common ancestors” of all of these languages, the fundamental concepts that underlie their design, and the history of those concepts, even if that doesn’t entail mastering other languages per se.

Toward that end, I personally got quite a lot out of working through bits and pieces of a few classic programming books, especially Abelson & Sussman’s “Structure and Interpretation of Computer Programs”, which is freely available online. I’d also recommend Kernighan & Ritchie’s “The C Programming Language” for a look at the opposite side of the proverbial coin, and the “Gang of Four” Design Patterns book is also a fascinating read and much more directly related to the actual milieu that sclang comes out of.

Finally, I think that the best advice in this thread is:

It was a huge revelation for me when I got into the habit of reading the source code while trying to figure things out. (Also, you’d be surprised at how much of sclang is undocumented!)

In all of these cases, no need to destroy yourself sweating every detail. Every little bit helps, and even if things don’t make sense initially, you’ll get a feel for them over time!

Also:

So this is a super interesting thread all around and has been a pleasure to read, but this is definitely the high point so far for me! Might have to give this a shot this year…


#16

(I should note - this was SC 2 - so when it crashed while doing your taxes, it locked your whole computer up)


#17

I haven’t seen anyone mention Smalltalk… That was one of the parent languages for SCLang, and it shows.
Unless you’re really into today sort of thing, I wouldn’t recommend it as a practical precursor but it does explain some of the idiosyncrasies. (5.reciprocal, for example)