update stuff
This commit is contained in:
parent
ea1762eb10
commit
72dd6033b9
1 changed files with 30 additions and 9 deletions
|
@ -42,13 +42,32 @@ The purpose of playing notes on different tracks is we can have different filter
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
|
### 2. Playing a note using a preset instrument
|
||||||
|
|
||||||
|
|
||||||
|
```scheme
|
||||||
|
|
||||||
|
;; this plays the key
|
||||||
|
(define my-note (play-note "sin-inst" 440))
|
||||||
|
(sleep 1)
|
||||||
|
;; stop playing note
|
||||||
|
(note-off my-note)
|
||||||
|
```
|
||||||
|
|
||||||
|
Or you can create a note object then play it.
|
||||||
|
|
||||||
|
(define my-note2 (note "sin-inst" 880))
|
||||||
|
|
||||||
|
(note-on my-note2)
|
||||||
|
(sleep 1)
|
||||||
|
(note-off my-note2)
|
||||||
|
|
||||||
|
|
||||||
### 1. Creating an instrument
|
### 1. Creating an instrument
|
||||||
|
|
||||||
You can either use a preset instrument or define your own instrument
|
You can either use a preset instrument or define your own instrument
|
||||||
|
|
||||||
```scheme
|
```scheme
|
||||||
;; 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
|
||||||
|
@ -60,17 +79,19 @@ You can either use a preset instrument or define your own instrument
|
||||||
(envelope A S D R))
|
(envelope A S D R))
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2. Playing a note
|
### 2. Playing a note using a custom instrument
|
||||||
|
|
||||||
Now that we have an instrument, we can use it to play notes on a specific track.
|
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.
|
```scheme
|
||||||
(note-on my-piano C#3 track2)
|
;; this plays the key C#, octave 3 on track 2.
|
||||||
|
(note-on my-piano C#3 track2)
|
||||||
|
|
||||||
;; to stop playing
|
;; to stop playing
|
||||||
(note-off my-piano C#3 track2)
|
(note-off my-piano C#3 track2)
|
||||||
|
|
||||||
;; TODO - find a way to turn off a note, or make a note play for a specific time
|
;; TODO - find a way to turn off a note, or make a note play for a specific time
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
### 3. Add filters to a track
|
### 3. Add filters to a track
|
||||||
|
|
Loading…
Reference in a new issue