summaryrefslogtreecommitdiff
path: root/demos/rhythm_tutorial.htm
diff options
context:
space:
mode:
Diffstat (limited to 'demos/rhythm_tutorial.htm')
-rw-r--r--demos/rhythm_tutorial.htm2
1 files changed, 2 insertions, 0 deletions
diff --git a/demos/rhythm_tutorial.htm b/demos/rhythm_tutorial.htm
new file mode 100644
index 0000000..d6c6313
--- /dev/null
+++ b/demos/rhythm_tutorial.htm
@@ -0,0 +1,2 @@
+<html>
+ <head> <meta name="GENERATOR" content="Microsoft FrontPage 3.0"> <title>Rhythmic Pattern Tutorial</title> </head> <body> <h1>Rhythmic Pattern Tutorial</h1> <p>This example illustrates a very simple percussion sound created with noise and using the sound to generate a rhythm.</p> <p>The sound is created by filtering noise. The filter is controlled using the piece-wise linear function (<code>pwl</code>):</p> <pre>(defun pulse (dur) (stretch dur (hp (noise) (pwl 0 15 0.2 6000 0.6 15000 0.75 7))))</pre> <p>A sequence of sounds is constructed and repeated in the following code. Notice that each time through the pattern,<br> the scale factor is increased by 0.1, giving the whole sequence a crescendo:</p> <pre>(defun pulsepat (&amp;optional (rep 16)) (seqrep (i rep) (stretch 0.2 (scale (* i 0.1) (seq (pulse 1) (pulse 1) (pulse 2) (pulse 2)))))) (play (pulsepat 17))</pre> <h2>Pitched Patterns</h2> <p>This example uses the <code>ring</code> function from the <a href="scratch_tutorial.htm">Vinal Scratch Tutorial</a>. When the pitch parameter is increased, we hear a kind of electronic bass sound. Try this:</p> <pre>(play (ring 0.4 30 1.2))</pre> <p>These notes can be combined to create a pattern. The <code>techno</code> function creates a short pattern of 3 notes repeated any number of times:</p> <pre>(defun techno (rep) (seqrep (i rep) (scale 0.8 (sim (scale 0.8 (at 0.0 (ring 0.4 30 1.2))) (scale 0.6 (at 0.2 (ring 0.2 30 0.9))) (scale 0.7 (at 0.3 (ring 0.1 30 1.1))) ))))</pre> <p>Try this:</p> <pre>(play (techno 3))</pre> <p>The following combines and transposes rhythmic segments to create a bass line:</p> <pre>(play (seqrep (i 2) (seq (techno 2) (transpose 5 (techno 2)) (transpose -2 (techno 1)) (transpose 3 (techno 1)) (techno 2))))</pre> <h3>Layers for Richer Texture</h3> <p>Sounds can often be combined with time and pitch offsets to create richer textures. The following layers two sequences based on the same <code>techno</code> function:</p> <pre>(play (sim (scale 0.4 (at 0.0 (seqrep (i 2) (seq (techno 2) (transpose 5 (techno 2)) (transpose -2 (techno 1)) (transpose 3 (techno 1)) (techno 2))))) (scale 0.2 (at 0.1 (seqrep (i 2) (seq (transpose 2 (techno 2)) (transpose 7 (techno 2)) (transpose -4 (techno 1)) (transpose 5 (techno 1)) (transpose -2 (techno 2)))) ))))</pre> <p>Note that the second layer is almost but not exactly a transposition of the first layer. If it were an exact transposition, it would make sense to encapsulate the first layer in a function and call it twice. The following variation is much more concise, but it does not compute exactly the same sound:</p> <pre>(defun bass-line () (seqrep (i 2) (seq (techno 2) (transpose 5 (techno 2)) (transpose -2 (techno 1)) (transpose 3 (techno 1)) (techno 2))))</pre> <pre>(play (sim (scale 0.4 (bass-line)) (scale 0.2 (at 0.1 (transpose 2 (bass-line))))))</pre> <h2>Another Example</h2> <p>This example also uses the <code>ring</code> function from the <a href="scratch_tutorial.htm">Vinal Scratch Tutorial</a>. </p> <pre>(play (seqrep (i 17) (lp (scale (+ (* i 0.05 ) 0.3) (seq (transpose -4 (ring 0.1 32 0.6)) (transpose -5 (ring 0.05 20 0.2)) (transpose (* 2 i) (ring 0.1 27 0.5)) (transpose -3 (ring 0.05 22 0.1)) (transpose (* i 3) (ring 0.1 28 0.4)) (ring 0.05 31 0.7))) (* 100 i))))</pre> <p>This play 17 repetitions of a sound. Each time, the sound is a bit louder, the low-pass frequency is raised by 100 Hz, and two of the transpositions are increased. This creates a rhythmic and evolving sound.</p> <p><br> </p> <p>&nbsp;</p> </body> </html>