Skip to content

Commit

Permalink
experimental first version of new modulator
Browse files Browse the repository at this point in the history
  • Loading branch information
tmhglnd committed Oct 28, 2023
1 parent 86ca899 commit 90865c0
Show file tree
Hide file tree
Showing 7 changed files with 1,721 additions and 319 deletions.
4 changes: 2 additions & 2 deletions docs/00-general.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

## new

Create a new instance of an instrument or external output. This can be a `sample`, a `synth`, a `loop`, a `polySynth`, `midi` or an `emitter` for osc followed by the name of the sample, the name of the waveshape to use for the synth, the emitter type (currently only supports `osc`) or the midi device name. After that use functions to set parameters for the object.
Create a new instance of an instrument or external output. This can be a `sample`, a `synth`, a `loop`, a `polySynth`, `midi`, `modulator` or an `emitter` for osc followed by the name of the sample, the name of the waveshape to use for the synth, the emitter type (currently only supports `osc`) or the midi device name. After that use functions to set parameters for the object.

**arguments**
- {Instrument} -> the instrument type (sample, synth, loop, polySynth, emitter)
- {Instrument} -> the instrument type (sample, synth, loop, polySynth, midi, modulator)
- {Type} -> selected sample or synth waveform (based on loaded files)
- {Functions+} -> instrument methods seperated by spaces (optional)

Expand Down
40 changes: 39 additions & 1 deletion docs/02-instrument.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ For instrument specific functions see below:
- [Synth / polySynth](#synth-and-polysynth-only)
- [Sample / Loop](#sample-and-loop-only)
- [Midi](#midi)
- [Modulator](#modulator) *Mercury for Max8 Only!*
<!-- - text to speech -->

## name
Expand Down Expand Up @@ -536,4 +537,41 @@ An experimental text-to-speech instrument is added. Using the Mac terminal speec
new voice Alex speak("Hello world!") time(2)
new voice Samantha speak("Hi Alex!") time(2 1)
``` -->
``` -->

# Modulator

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).

```java
new modulator <waveform-type> name(<name>) range(<lo> <hi> <exp>) time(<division>)
```

## name

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

```java
// set the name to myModulator
new modulator sine name(myModulator)
// the synth uses the modulator in the gain function
new synth saw gain(myModulator)
```

## time

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

```java
// modulate once per 4 bars
new modulator sine time(4/1)
```

## range

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

```java
// set the range from 200 to 5000, for example to modulate a filter cutoff
new modulator sine range(200 5000)
```
111 changes: 10 additions & 101 deletions mercury_ide/patchers/_mercury_main.maxpat
Original file line number Diff line number Diff line change
Expand Up @@ -6614,30 +6614,6 @@
"text" : "r render"
}

}
, {
"box" : {
"id" : "obj-380",
"maxclass" : "newobj",
"numinlets" : 1,
"numoutlets" : 1,
"outlettype" : [ "clear" ],
"patching_rect" : [ 2162.333333333333485, 195.0, 41.0, 22.0 ],
"text" : "t clear"
}

}
, {
"box" : {
"id" : "obj-319",
"maxclass" : "newobj",
"numinlets" : 1,
"numoutlets" : 3,
"outlettype" : [ "", "", "int" ],
"patching_rect" : [ 2162.333333333333485, 226.0, 50.0, 22.0 ],
"text" : "console"
}

}
, {
"box" : {
Expand Down Expand Up @@ -11833,7 +11809,7 @@
}
,
"classnamespace" : "box",
"rect" : [ 102.0, 326.0, 640.0, 480.0 ],
"rect" : [ 371.0, 210.0, 640.0, 480.0 ],
"bglocked" : 0,
"openinpresentation" : 0,
"default_fontsize" : 12.0,
Expand Down Expand Up @@ -47518,7 +47494,7 @@
}
,
"classnamespace" : "box",
"rect" : [ 950.0, 261.0, 640.0, 480.0 ],
"rect" : [ 822.0, 261.0, 640.0, 480.0 ],
"bglocked" : 0,
"openinpresentation" : 0,
"default_fontsize" : 12.0,
Expand Down Expand Up @@ -49549,7 +49525,7 @@
"maxclass" : "newobj",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 2186.0, 135.0, 86.0, 22.0 ],
"patching_rect" : [ 2162.33333333333394, 135.0, 86.0, 22.0 ],
"text" : "s priorityLoad"
}

Expand Down Expand Up @@ -49712,7 +49688,7 @@
}
,
"classnamespace" : "box",
"rect" : [ 764.0, 96.0, 652.0, 783.0 ],
"rect" : [ 782.0, 96.0, 680.0, 837.0 ],
"bglocked" : 0,
"openinpresentation" : 0,
"default_fontsize" : 12.0,
Expand Down Expand Up @@ -61939,7 +61915,7 @@
"maxclass" : "newobj",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 585.0, 196.0, 33.0, 22.0 ],
"patching_rect" : [ 585.0, 186.0, 33.0, 22.0 ],
"text" : "s init"
}

Expand All @@ -61949,10 +61925,10 @@
"id" : "obj-274",
"maxclass" : "newobj",
"numinlets" : 1,
"numoutlets" : 4,
"outlettype" : [ "bang", "bang", "bang", "bang" ],
"patching_rect" : [ 585.0, 120.0, 105.0, 22.0 ],
"text" : "t b b b b"
"numoutlets" : 3,
"outlettype" : [ "bang", "bang", "bang" ],
"patching_rect" : [ 585.0, 120.0, 76.333333333333144, 22.0 ],
"text" : "t b b b"
}

}
Expand All @@ -61976,47 +61952,10 @@
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 642.333333333333371, 196.0, 115.0, 35.0 ],
"patching_rect" : [ 642.333333333333371, 186.0, 115.0, 35.0 ],
"text" : ";\rmax maxinwmenu 0"
}

}
, {
"box" : {
"id" : "obj-226",
"maxclass" : "message",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 776.0, 199.0, 83.0, 22.0 ],
"text" : "macintosh"
}

}
, {
"box" : {
"id" : "obj-200",
"maxclass" : "newobj",
"numinlets" : 0,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 840.0, 80.0, 65.0, 22.0 ],
"text" : "r SYSTEM"
}

}
, {
"box" : {
"id" : "obj-197",
"linecount" : 2,
"maxclass" : "message",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 671.0, 150.0, 142.0, 35.0 ],
"text" : ";\rmax getsystem SYSTEM"
}

}
, {
"box" : {
Expand Down Expand Up @@ -74072,13 +74011,6 @@
"source" : [ "obj-195", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-226", 1 ],
"source" : [ "obj-200", 0 ]
}

}
, {
"patchline" : {
Expand Down Expand Up @@ -74149,19 +74081,10 @@
"source" : [ "obj-211", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-380", 0 ],
"order" : 1,
"source" : [ "obj-211", 3 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-5", 0 ],
"order" : 0,
"source" : [ "obj-211", 3 ]
}

Expand Down Expand Up @@ -74630,13 +74553,6 @@
"source" : [ "obj-273", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-197", 0 ],
"source" : [ "obj-274", 3 ]
}

}
, {
"patchline" : {
Expand Down Expand Up @@ -75518,13 +75434,6 @@
"source" : [ "obj-379", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-319", 0 ],
"source" : [ "obj-380", 0 ]
}

}
, {
"patchline" : {
Expand Down
17 changes: 9 additions & 8 deletions mercury_ide/patchers/argListLookup.maxpat
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"fileversion" : 1,
"appversion" : {
"major" : 8,
"minor" : 0,
"revision" : 8,
"minor" : 5,
"revision" : 6,
"architecture" : "x64",
"modernui" : 1
}
,
"classnamespace" : "box",
"rect" : [ 352.0, 176.0, 697.0, 589.0 ],
"rect" : [ 224.0, 216.0, 697.0, 589.0 ],
"bglocked" : 0,
"openinpresentation" : 0,
"default_fontsize" : 12.0,
Expand All @@ -37,6 +37,7 @@
"tags" : "",
"style" : "",
"subpatcher_template" : "",
"assistshowspatchername" : 0,
"boxes" : [ {
"box" : {
"id" : "obj-21",
Expand Down Expand Up @@ -189,8 +190,8 @@
"maxclass" : "inlet",
"numinlets" : 0,
"numoutlets" : 1,
"outlettype" : [ "int" ],
"patching_rect" : [ 330.0, 32.0, 30.0, 30.0 ]
"outlettype" : [ "" ],
"patching_rect" : [ 330.0, 30.0, 30.0, 30.0 ]
}

}
Expand All @@ -202,7 +203,7 @@
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 433.0, 201.0, 175.0, 74.0 ],
"text" : "if more than 1 value output list for note count.\n\nElse through put the single value"
"text" : "If more than 1 value output list for note count.\n\nElse through put the single value"
}

}
Expand Down Expand Up @@ -249,7 +250,7 @@
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 315.0, 202.0, 34.0, 22.0 ],
"patching_rect" : [ 315.0, 200.0, 34.0, 22.0 ],
"text" : "gate"
}

Expand Down Expand Up @@ -355,7 +356,7 @@
"lines" : [ {
"patchline" : {
"destination" : [ "obj-2", 0 ],
"midpoints" : [ 174.5, 348.0, 280.0, 348.0, 280.0, 189.0, 324.5, 189.0 ],
"midpoints" : [ 174.5, 348.0, 284.0, 348.0, 284.0, 189.0, 324.5, 189.0 ],
"order" : 0,
"source" : [ "obj-1", 0 ]
}
Expand Down
12 changes: 6 additions & 6 deletions mercury_ide/patchers/eventSequencer.maxpat
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"appversion" : {
"major" : 8,
"minor" : 5,
"revision" : 4,
"revision" : 6,
"architecture" : "x64",
"modernui" : 1
}
Expand Down Expand Up @@ -74,7 +74,7 @@
"appversion" : {
"major" : 8,
"minor" : 5,
"revision" : 4,
"revision" : 6,
"architecture" : "x64",
"modernui" : 1
}
Expand Down Expand Up @@ -375,7 +375,7 @@
"appversion" : {
"major" : 8,
"minor" : 5,
"revision" : 4,
"revision" : 6,
"architecture" : "x64",
"modernui" : 1
}
Expand Down Expand Up @@ -698,7 +698,7 @@
"appversion" : {
"major" : 8,
"minor" : 5,
"revision" : 4,
"revision" : 6,
"architecture" : "x64",
"modernui" : 1
}
Expand Down Expand Up @@ -877,7 +877,7 @@
"appversion" : {
"major" : 8,
"minor" : 5,
"revision" : 4,
"revision" : 6,
"architecture" : "x64",
"modernui" : 1
}
Expand Down Expand Up @@ -1256,7 +1256,7 @@
"numoutlets" : 4,
"outlettype" : [ "bang", "signal", "int", "signal" ],
"patching_rect" : [ 227.400000000000006, 615.0, 158.0, 22.0 ],
"text" : "th.clockwarp~ @thresh 0.99"
"text" : "th.clockwarp~ @thresh 0.95"
}

}
Expand Down
Loading

0 comments on commit 90865c0

Please sign in to comment.