rsc3/oregano/Tutorial.md

118 lines
2.4 KiB
Markdown
Raw Normal View History

2014-05-05 17:39:05 +00:00
## Installing
2014-05-11 21:18:34 +00:00
You need to install SuperCollider and the Dr Racket package.
### 1. Installing SuperCollider
2014-05-05 17:39:05 +00:00
Go to https://supercollider.github.io/download.html and download the latest version (3.6.6 as of the time of writing.)
Then follow these instructions per operating system.
2014-05-11 21:18:34 +00:00
#### Linux
2014-05-05 17:39:05 +00:00
2014-05-05 17:42:03 +00:00
- install jack
2014-05-11 21:18:34 +00:00
#### Windows
2014-05-05 17:39:05 +00:00
2014-05-11 21:18:34 +00:00
#### Mac OS X
2014-05-05 17:39:05 +00:00
2014-05-11 21:18:34 +00:00
### 2. Installing oregano
2014-05-05 17:42:03 +00:00
This can be installed in two different ways:
- Either through the command line: `raco pkg install rsc3`
- Or through DrRacket: TODO
2014-05-05 17:39:05 +00:00
2014-05-11 21:18:34 +00:00
## Concepts
You can play notes from instruments on specific tracks.
The purpose of playing notes on different tracks is we can have different filters on different tracks. For example, the melody track can have a low pass filter, and and the drums track could have a delay filter.
- Instrument: This is equivalent to choosing what the note sounds like. There are default instruments (saw wave, piano, etc.) and you can also define your own using samples.
2014-05-11 21:22:54 +00:00
- Note: specifies a key from an instrument, and can be played on a track
- Track:
- Filters: can be added to a track. The order in which they are added matters.
2014-05-14 03:54:20 +00:00
## Examples
2014-05-11 21:22:54 +00:00
2014-05-12 00:24:29 +00:00
### 1. Creating an instrument
2014-05-12 00:13:27 +00:00
2014-05-12 00:24:29 +00:00
You can either use a preset instrument or define your own instrument
;; this uses the piano preset
(define my-piano (make-instrument 'piano))
;; create a custom instrument
;; can use oscilators and envelopes
2014-05-12 00:27:58 +00:00
(define my-instrument (make-instrument ... TODO))
2014-05-12 00:24:29 +00:00
;; add envelope to instrument
### 2. Playing a note
Now that we have an instrument, we can use it to play notes on a specific track.
;; this plays the key C#, octave 3 on track 2.
(note-on my-piano C#3 track2)
;; to stop playing
(note-off my-piano C#3 track2)
2014-05-12 00:13:27 +00:00
2014-05-12 00:27:58 +00:00
;; TODO - find a way to turn off a note, or make a note play for a specific time
2014-05-11 21:22:54 +00:00
2014-05-14 03:54:20 +00:00
### 3. Add filters to a track
You can add filters to a specific track.
(add-effect track3 (reverb 0.5 0.9))
## Functions
### mouse-x and mouse-y
You can parameters to filters and instruments using the mouse.
(mouse-x start-value end-value)
For example, if you want to control the cutoff frequency for a filter using the left-right position of the mouse.
(add-effect track3 (low-pass-filter resonance
(mouse-x kr 200 500)))
When the mouse is at the left of the screen, the frequency is 200, when the mouse is at the right, the frequency is 500.
---
(definst supersaw
(
2014-05-11 21:22:54 +00:00
2014-05-12 00:13:27 +00:00