this is for holding javascript data
Bruno Ruviaro edited Variables.tex
almost 10 years ago
Commit id: 157b0665cd6f70d738a08fb66a20c0e132351fad
deletions | additions
diff --git a/Variables.tex b/Variables.tex
index d0ae62a..399381b 100644
--- a/Variables.tex
+++ b/Variables.tex
...
Interesting tricks here: thanks to variables, we reuse the same list of scale degrees and durations for both \texttt{Pbind}s. We wanted the second scale to be descending and one octave above the first. To achieve this, we simply use the message \texttt{.reverse} to reverse the order of the list (type \texttt{$\sim$scale.reverse} on a new line and evaluate to see exactly what it does). Then we add 7 to transpose it one octave above (test it as well to see the result). We played two \texttt{Pbind}s at the same time by enclosing them within a single code block.
Exercise: create one additional \texttt{Pbind} inside the code block above, so that you hear three simultaneous voices. Use both variables
(\texttt{$\sim$scale} (\texttt{~scale} and
\texttt{$\sim$durs}) \texttt{~durs}) in some different way---for example, use them inside a different Pattern; change transposition amount; multiply durations by some factor; etc.