Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tmhglnd committed Oct 28, 2023
1 parent 90865c0 commit 78a366c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/02-instrument.md
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,9 @@ new voice Samantha speak("Hi Alex!") time(2 1)

The modulator allows you to send a modulation signal as an argument to parameters from functions of other instruments. These parameters are continuously modulated at a specific rate with a specific waveform. The modulation rate is independent from the instruments `time()` (in comparison when using a list as an argument).

**arguments**
- {Name} -> waveform type: `sine`, `sawUp`, `sawDown`, `square`, `triangle`

```java
new modulator <waveform-type> name(<name>) range(<lo> <hi> <exp>) time(<division>)
```
Expand All @@ -551,6 +554,9 @@ new modulator <waveform-type> name(<name>) range(<lo> <hi> <exp>) time(<division

Set the name for the modulator, this name can be used as argument in the functions of an instrument like `synth` and `sample`

**arguments**
- {Name} -> the modulator name for reference in other functions

```java
// set the name to myModulator
new modulator sine name(myModulator)
Expand All @@ -562,6 +568,10 @@ new synth saw gain(myModulator)

Set the modulation speed in division. The default is `1/1` (one period per bar).

**arguments**
- {Division} -> The time interval for one period of the modulation waveform (optional, default=1/1)
- {Division} -> The time offset for the modulation (optional, default=0)

```java
// modulate once per 4 bars
new modulator sine time(4/1)
Expand All @@ -571,6 +581,11 @@ new modulator sine time(4/1)

Set the modulation range between a low and high value with an option exponential value. The default range is 0 to 1.

**arguments**
- {Number} -> The low output range (optional, default=0)
- {Number} -> The high output range (optional, default=1)
- {Number} -> The scaling exponent (optional, default=1)

```java
// set the range from 200 to 5000, for example to modulate a filter cutoff
new modulator sine range(200 5000)
Expand Down

0 comments on commit 78a366c

Please sign in to comment.