; A SAL program consists of comments and expressions. Comments start ; with a semi-colon last until the end of the line. You are reading a ; comment block. An expression is anything that you execute to ; accomplish a task. To execute an expression put your cursor just ; after the end of its text and press COMMAND-Enter. On the Mac the ; COMMAND key is the APPLE key, on Windows and Linux it's the CONTROL ; key. Look in the Console window to see the results of executing the ; command. Do it: print("Hello, world!") ; Many expressions involve math. In math expressions operators MUST be ; delimited by spaces. If you don't use parentheses then normal ; operator precedence applies: 1 + 2 * 3 ; You can use parentheses to group and nest terms as you like: ((1 + 2) * 3) ; Command and function arguments are separated by commas. Execute this ; command several times to see what it does: print("my key number: ", between(60, 90)) ; You can read help about commands and functions by placing your ; cursor on the word you want to look up and pressing COMMAND-D. Try ; this on the symbols 'print' and 'between' in the previous example. ; Errors: when you execute somethin that contains a mistake you will ; see an error message printed in the Console window. Sometimes this ; message is helpful, sometimes its not so useful. Such is life. Many ; mistakes involve syntax errors or undefined terms as shown in these ; two examples: (1 + 2 * 3 foo ; Expressions can become quite complex and often span more than one ; line. Here is an example of a moderately complex command. To ; execute it, place your cursor just after the word 'end' and press ; COMMAND-Enter several times to see what it does: begin with root = between(60, 90), third = root + pick(3,4) , fifth = root + 7 print("My random chord: ", note( list( root, third, fifth))) end ; many expressions you write in this course will make sound! Here is ; a version of the preceding algorithm that sends the note data out ; the midi port. Press COMMAND-Enter several times to hear what it ; does: begin with root = between(60, 90), third = root + pick(3,4) , fifth = root + 7 send("mp:midi", key: root) send("mp:midi", key: third) send("mp:midi", key: fifth) end