Merge branch 'master' of github.com:quakehead/rsc3
This commit is contained in:
commit
e410336ccd
1 changed files with 12 additions and 10 deletions
|
@ -46,17 +46,19 @@ The purpose of playing notes on different tracks is we can have different filter
|
||||||
|
|
||||||
You can either use a preset instrument or define your own instrument
|
You can either use a preset instrument or define your own instrument
|
||||||
|
|
||||||
;; this uses the piano preset
|
```clj
|
||||||
(define my-piano (preset-instrument 'piano))
|
;; this uses the piano preset
|
||||||
|
(define my-piano (preset-instrument 'piano))
|
||||||
|
|
||||||
;; create a custom instrument
|
;; create a custom instrument
|
||||||
;; can use oscilators and envelopes
|
;; can use oscilators and envelopes
|
||||||
;; "freq" is the frequency parameter
|
;; "freq" is the frequency parameter
|
||||||
(define-instrument my-custom-inst (mul (sin 20) (sin "freq")))
|
(define-instrument my-custom-inst (mul (sin 20) (sin "freq")))
|
||||||
|
|
||||||
;; add envelope to instrument
|
;; add envelope to instrument
|
||||||
(define my-inst (preset-instrument "sine"
|
(define my-inst (preset-instrument "sine"
|
||||||
(envelope A S D R))
|
(envelope A S D R))
|
||||||
|
```
|
||||||
|
|
||||||
### 2. Playing a note
|
### 2. Playing a note
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue