The first line, 'Hello there, I'm SuperCollider!' would not have printed if we didn't have the explicit postln.
![supercollider tutorial supercollider tutorial](https://i.ytimg.com/vi/wNGmFOi7mJ8/maxresdefault.jpg)
"Hello there, I'm SuperCollider!".postln Select both lines of text by clicking and dragging over them, and then execute, i.e. So in this case we didn't really need the postln bit. So it first prints because we explicitly told it to print, and then it prints the result of this operation, which happens to be the same in this case.
SUPERCOLLIDER TUTORIAL CODE
Why did it print twice? Well, when you execute code in SC, it always posts the result of the last bit of code (the last statement). This can be very handy when tracking down bugs in your code. You can apply it to almost anything in SC and get something meaningful back. postln, says 'print me (or a meaningful description of me) to the post window.' Remember postln, it's your friend. More about that later, but for now just understand that a String is a way of representing a bit of text.
![supercollider tutorial supercollider tutorial](https://i.ytimg.com/vi/JJ329Z8MsCk/maxresdefault.jpg)
An object is basically just a way of representing something in the computer, for instance a bit of text, or an oscillator, that allows you to control it and send messages to it. The first bit, "Hello World!", is a kind of Object, called a String. Now let's take a closer look at the code. Hello World!Īlternatively you can also first select the code you wish to execute (by clicking and dragging over the text until it is highlighted) and then press Ctrl-Enter (Cmd-Return on macOS). If all went well, you should see this in the post window. To execute it, simply click to place the cursor somewhere on the same line as the code and then press Shift-Enter (Shift-Return on macOS).
![supercollider tutorial supercollider tutorial](https://i.pinimg.com/originals/32/0d/7c/320d7c7faddd5e1578896a61873e30b7.png)
It's also where we'll get the result of our Hello World program, which you can see below: "Hello World!".postln The post window is the one that opened up when you first started SC, and a bunch of stuff was printed there which looks something like this: init_OSCĬompiling dir: '/Applications/SC3/SCClassLibrary'ĭon't worry too much about what all that means just now, just keep in mind that this is where SC will send you information. In SC that's a place called the post window. This just makes the program print the text 'Hello World!' to well, wherever it prints text. It is traditional when learning a new programming language to start with a simple program called 'Hello World'. See the helpfile Keyboard Shortcuts for key commands when using other tools such as SC enhanced editors, e.g. menu commands, are platform specific, but the principles extend to all platforms. NOTE: This document is written so that it can be used on all supported systems, though having first of all macOS in mind using the application SuperCollider.app (SCapp).