2  Quick Start

2.1  Setting up SND and Emacs

This is how I work. Perhaps you'll find this setup comfortable.

  1. Download and unpack the latest version of snd-ls from http://www.notam02.no/arkiv/src/snd/

  2. Compile and install it like this:


  3. Link a ``scheme'' executable so that it points to the snd-ls binary

        ln -s  `which snd-ls` ~/bin/scheme

  4. Start the jack server

  5. Start emacs

  6. Maximize Emacs so that it fills the whole screen

  7. Load the file called ``rt-examples.scm'' into Emacs.

  8. Split your window in two parts: C-x 2

  9. Move the cursor to lower part window: C-x o

  10. Run snd-ls: M-x run-scheme

  11. Hide the SND window behind the Emacs window. We don't need to look at SND.

  12. Move the cursor to the upper part window: C-x o

  13. Evaluate blocks of code by placing the cursor inside a block and press Ctrl+Alt+x

2.2  Two short examples


(let ((osc (make-oscil)))
  (<rt-play> 0 3
	   (lambda ()
	     (out (* 0.8
		     (oscil osc))))))

A sinus is/should be heard for three seconds.


(define-rt2 (fib n)
  (if (< n 2)
      (+ (fib (- n 1))
	 (fib (- n 2)))))

(fib 30)
-> 832040.0

(There are more examples in the file rt-examples.scm)