Skip to content

Commit

Permalink
use trigger/gate in modulator to output (rhythmical) clicks or gating…
Browse files Browse the repository at this point in the history
… signal with hold()
  • Loading branch information
tmhglnd committed Nov 1, 2023
1 parent 6e83f33 commit d44d4b2
Show file tree
Hide file tree
Showing 4 changed files with 1,023 additions and 82 deletions.
30 changes: 29 additions & 1 deletion docs/02-instrument.md
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ new input in4 gain(0.9) time(1/16) shape(1 100) fx(reverb) fx(distort)
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). It is also possible to send the modulation signal directly out to the connected soundcard on a specific channel. This can for example be used for cv modulations.

**arguments**
- {Name} -> waveform type: `sine`|`sin`, `sawUp`|`phasor`, `sawDown`|`saw`, `square`|`rect`, `triangle`|`tri`, `random`|`rand`, `randomLine`|`randL`
- {Name} -> waveform type: `sine`|`sin`, `sawUp`|`phasor`, `sawDown`|`saw`, `square`|`rect`, `triangle`|`tri`, `random`|`rand`, `randomLine`|`randL`, `trigger`|`gate`

```java
new modulator <waveform-type> name(<name>) range(<lo> <hi> <exp>) time(<division>) out(<channel>)
Expand Down Expand Up @@ -623,4 +623,32 @@ Set the output channel from your connected soundcard to send the modulation sign
```java
// send a sinewave modulator signal to DAC channel 3
new modulator sine range(-1 1) out(3)
```

## modulator trigger

When using the mode `trigger`/`gate` the modulator functions like the sequencer in the instruments. Meaning it is also possible to use `play()` to add a rhythm list, use `ratchet()` to add a list of timing subdivisions with probability, use `warp()` to add a list of time warpings.

**arguments**
- {Name} -> `trigger`/`gate` sets the intrument to use the stepsequencer

```java
// generate a euclidean rhythm and use it in the trigger
list rtm euclid(16 11)
new modulator trigger time(1/8) play(rtm) ratchet(0.1 2)
```

## modulator hold

The hold function transforms the `trigger` into a gate that goes open and closes after a certain amount of time. The time value can be either `ms` or a `division`. If the hold time is longer than the time interval between triggers the gate stays open. A hold of `0` results in the click from the default trigger.

**arguments**
- {Number+} -> hold time in ms or division (default=0)

```java
// trigger every 8th note, and leave the gate open for the length of 50ms
new modulator trigger time(1/8) hold(50)

// trigger every 8th note, and leave the gate open for the length of a 16th
new modulator trigger time(1/8) hold(1/16)
```
19 changes: 19 additions & 0 deletions mercury_ide/patchers/eventSequencer.maxpat
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@
"subpatcher_template" : "",
"assistshowspatchername" : 0,
"boxes" : [ {
"box" : {
"comment" : "(signal) trigger",
"id" : "obj-11",
"index" : 3,
"maxclass" : "outlet",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 378.0, 675.0, 30.0, 30.0 ]
}

}
, {
"box" : {
"id" : "obj-16",
"linecount" : 2,
Expand Down Expand Up @@ -1422,6 +1434,13 @@
"source" : [ "obj-29", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-11", 0 ],
"source" : [ "obj-3", 1 ]
}

}
, {
"patchline" : {
Expand Down
10 changes: 5 additions & 5 deletions mercury_ide/patchers/fxLFO.maxpat
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,9 @@
"randL" : 5,
"noise" : 6,
"rand" : 6,
"random" : 6
"random" : 6,
"trigger" : 7,
"gate" : 7
}
,
"id" : "obj-10",
Expand Down Expand Up @@ -1178,8 +1180,7 @@
}

}
],
"autosave" : 0
]
}
,
"patching_rect" : [ 211.0, 405.0, 78.0, 22.0 ],
Expand Down Expand Up @@ -1547,8 +1548,7 @@
}

}
],
"autosave" : 0
]
}
,
"patching_rect" : [ 211.0, 450.0, 197.5, 22.0 ],
Expand Down
Loading

0 comments on commit d44d4b2

Please sign in to comment.