-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathError_messages.tex
23 lines (16 loc) · 1.71 KB
/
Error_messages.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
\section{Error messages}
No sound when you evaluated the last example? If so, your code probably had a typo: a wrong character, a missing comma or parenthesis, etc. When something goes wrong in your code, the Post window gives you an error message. Error messages can be long and cryptic, but don't panic: with time you will learn how to read them. A short error message could look like this:
\begin{verbatim}
ERROR: Class not defined.
in file 'selected text'
line 1 char 19:
{SinOsc.ar(LFNoiseO.kr(12).range(400, 1600), mul: 0.01)}.play;
-----------------------------------
nil
\end{verbatim}
This error message says, ``Class not defined,'' and points to the approximate location of the error (``line 1 char 19''). Classes in SC are those blue words that start with a capital letter (like \texttt{SinOsc} and \texttt{LFNoise0}). It turns out this error was due to the user typing LFNoiseO with a capital letter ``O'' at the end. The correct class is LFNoise0, with the number zero at the end. As you can see, attention to detail is crucial.
If you have an error in your code, proofread it, change as needed, and try again until it's fixed. If you had no error at first, try introducing one now so you can see how the error message would look like (for example, remove a comma).
\bigskip
\todo[inline, color=green!40]{
TIP: Learning SuperCollider is like learning another language like German, Portuguese, Japanese\dots \ just keep trying to speak it, work on expanding your vocabulary, pay attention to grammar and syntax, and learn from your mistakes. The worst it can happen here is to crash SuperCollider. Not nearly as bad as taking the wrong bus in São Paulo because of a mispronounced request for directions.
}