Skip to content

Commit

Permalink
Clamped Benjolin osc freq to approximately 0.3 Hz - 12.5 kHz
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveBenham committed Apr 12, 2024
1 parent 44de502 commit 1b14104
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ The oscillators are digital with triangle and pulse outputs. They are intentiona

### OSC1 (Oscillator 1)
#### FREQ1 knob
Sets the base frequency of oscillator one. Fully counterclockwise is roughly 0.03 Hz (30 seconds per cycle). The oscillator cannot be modulated below this minimum frequency. The oscillator remains in LFO territory up through noon at about 15 Hz. A bit above that and it transitions to audio rates, with a maximum fully clockwise frequency of around 7.8 kHz. The oscillator can be modulated above the knob maximum.
Sets the base frequency of oscillator one. Fully counterclockwise is roughly 0.03 Hz (30 seconds per cycle). The oscillator cannot be modulated below this minimum frequency. The oscillator remains in LFO territory up through noon at about 15 Hz. A bit above that and it transitions to audio rates, with a maximum fully clockwise frequency of around 7.8 kHz without any modulation. With modulation the oscillator maximum frequency is about 12.5 kHz.

#### RUNG1 (Rungler 1) knob
Controls how much the rungler signal modulates oscillator 1 frequency. The knob is a bipolar attenuverter ranging from -1 (100% inverted) to 1 (100%), with the default noon value of 0 (no modulation).
Expand All @@ -169,7 +169,7 @@ Pulse waveform bipolar output for oscillator one, ranging from -5 to 5 volts.

### OSC2 (Oscillator 2)
#### FREQ2 (Oscillator 2 Frequency) knob
Sets the base frequency of oscillator two. Fully counterclockwise is roughly 0.03 Hz (around 30 seconds per cycle). The oscillator cannot be modulated below this minimum frequency. The oscillator remains in LFO territory up through noon at about 15 Hz. A bit above that and it transitions to audio rates, with a maximum fully clockwise frequency of around 7.8 kHz. The oscillator can be modulated above the knob maximum.
Sets the base frequency of oscillator two. Fully counterclockwise is roughly 0.03 Hz (around 30 seconds per cycle). The oscillator cannot be modulated below this minimum frequency. The oscillator remains in LFO territory up through noon at about 15 Hz. A bit above that and it transitions to audio rates, with a maximum fully clockwise frequency of around 7.8 kHz without any modulation. With modulation the oscillator maximum frequency is about 12.5 kHz.

#### RUNG2 (Rungler 2) knob
Controls how much the rungler signal modulates oscillator 2 frequency. The knob is a bipolar attenuverter ranging from -1 (100% inverted) to 1 (100%), with the default noon value of 0 (no modulation).
Expand Down
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
- Mono input cloned to match selected channel count

### Bug Fixes
- Benjolin
- Clamped the oscillator frequency to between ~0.03 Hz and ~12.5 kHz to prevent loss of output.
- Mix Fade and Mix Fade 2
- Fixed range of level output to 0-10 V. Was erroneously 0-1 V.

Expand Down
2 changes: 1 addition & 1 deletion src/BenjolinOsc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ struct BenjolinOsc : VenomModule {
params[FREQ2_PARAM].getValue() + (cv2Connected ? *cv2In : *tri1*normScale) * 0.9f * params[CV2_PARAM].getValue() + rung * 0.9f * params[RUNG2_PARAM].getValue(),
0.f,0.f
};
simd::ifelse(freq<-9.3f, -9.3f, freq);
freq = simd::clamp(freq, -9.3f, 9.7f);
osc += simd::pow(2.f, freq) * k * dir;
if (*tri1 > 1.f || *tri1 < -1.f) {
*tri1 = *dir1 + *dir1 - *tri1;
Expand Down

0 comments on commit 1b14104

Please sign in to comment.