Bruno Ruviaro edited Indentation and code blocks.tex  almost 10 years ago

Commit id: 2add0306117c618434f3922fb58f58ac5003e093

deletions | additions      

       

\subsection{Indentation and Code Blocks}  You may have noticed that the line of code above is quite long. In fact, it is so long that it wraps to a new line, even though it is technically a single statement. Long lines of code can be confusing to read. To avoid this, it is common practice to break the code into several indented lines; the goal is to make it as clear and intelligible as possible. The same \texttt{Pbind} above can be written like this: 

\bigskip  \begin{quote}  TIP: Don't mix pitch keywords in the same \texttt{Pbind}. For example, if you choose to use \texttt{\textbackslash freq}, don't specify a \texttt{\textbackslash degree}, \texttt{\textbackslash note}, or \texttt{\textbackslash midinote} line. Also, remember that each type of pitch specification will expect sensible values. A list of numbers like \texttt{[-1, 0, 1, 3]} makes sense for \texttt{\textbackslash degree} and \texttt{\textbackslash note}, but it doesn't make sense for \texttt{\textbackslash midinote} nor \texttt{\textbackslash freq}. The table below compares some values using the piano keyboard as a reference.  \end{quote}  \begin{tabular}{|l|c|c|c|c|c|}  \hline   & \textbf{A0 (lowest piano note)} & \textbf{C4} & \textbf{A4} & \textbf{C5} & \textbf{C8 (highest piano note)} \\