nstilt1 / mofo-repo

Repo for the Mofo Mojo
0 stars 0 forks source link

Unwanted artifacts prior to playing notes #1

Open nstilt1 opened 6 months ago

nstilt1 commented 6 months ago

Some static-like artifacts can occur under the following conditions:

1) the drive and/or its envelope are set pretty high 2) there is sound being fed into the plugin (it doesn't have to be loud, it could be very quiet) 3) no notes have been played thus far

The Cause

These artifacts are caused by the way that the envelope is computed. Currently, the envelope is made by comparing the volume of the input with the maximum volume of the input that has been measured so far. This allows the envelope to always be at a value between 0 and 1, and it also allows for a consistent sound once you start playing with an instrument that has a consistent attack volume.

Solutions

There are a few ways to fix this.

1) Set a threshold for when the envelope should modify the input. This could only be triggered once to prevent any unwanted noise cancellation in the middle of a song. a) figure out a hardcoded value for this threshold or b) add a knob for this

2) figure out what the maximum possible volume can be, then add a knob that boosts the input volume, like either a drive knob or a gain knob, and then clip the envelope and/or clip the volume