Skip to content

Commit

Permalink
Add: Sheep mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bloodbat committed Sep 24, 2024
1 parent e7decdc commit 140cd06
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
10 changes: 6 additions & 4 deletions alt_firmware/bumps/bumps_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -253,16 +253,15 @@ namespace bumps {

void Generator::FillBuffer() {
if (feature_mode_ == FEAT_MODE_FUNCTION) {
#ifndef WAVETABLE_HACK
//#ifndef WAVETABLE_HACK
if (range_ == GENERATOR_RANGE_HIGH) {
FillBufferAudioRate();
}
else {
FillBufferControlRate();
}
#else
FillBufferWavetable();
#endif
//#else
//#endif
}
else if (feature_mode_ == FEAT_MODE_HARMONIC) {
if (mode_ == GENERATOR_MODE_LOOPING)
Expand All @@ -275,6 +274,9 @@ namespace bumps {
else if (feature_mode_ == FEAT_MODE_RANDOM) {
FillBufferRandom();
}
else if (feature_mode_ == FEAT_MODE_SHEEP) {
FillBufferWavetable();
}
}

// There are to our knowledge three ways of generating an "asymmetric" ramp:
Expand Down
17 changes: 11 additions & 6 deletions alt_firmware/bumps/bumps_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
//
// Tidal generator.

// Modified by Bloodbat, 2024.

#ifndef BUMPS_GENERATOR_H_
#define BUMPS_GENERATOR_H_

Expand Down Expand Up @@ -124,12 +126,14 @@ class Generator {
}

void set_slope(int16_t slope) {
#ifndef WAVETABLE_HACK
if (range_ == GENERATOR_RANGE_HIGH &&
feature_mode_ != FEAT_MODE_HARMONIC) {
CONSTRAIN(slope, -32512, 32512);
}
#endif // WAVETABLE_HACK
//#ifndef WAVETABLE_HACK
if (feature_mode_ < FEAT_MODE_SHEEP) {
if (range_ == GENERATOR_RANGE_HIGH &&
feature_mode_ != FEAT_MODE_HARMONIC) {
CONSTRAIN(slope, -32512, 32512);
}
}
//#endif // WAVETABLE_HACK
slope_ = slope;
}

Expand Down Expand Up @@ -189,6 +193,7 @@ class Generator {
FEAT_MODE_FUNCTION,
FEAT_MODE_HARMONIC,
FEAT_MODE_RANDOM,
FEAT_MODE_SHEEP
};

FeatureMode feature_mode_;
Expand Down
8 changes: 5 additions & 3 deletions src/temulenti.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
static const std::vector<std::string> temulentiDisplayModels = {
"T",
"B",
"D"
"D",
"S"
};

static const std::vector<std::string> temulentiMenuLabels = {
"Tidal Modulator",
"Two Bumps - Harmonic oscillator",
"Two Drunks - Random walk"
"Two Drunks - Random walk",
"Sheep - Wavetable synthesizer"
};

static const std::vector<std::string> temulentiQuantizerLabels = {
Expand Down Expand Up @@ -100,7 +102,7 @@ struct Temulenti : SanguineModule {
configParam(PARAM_SLOPE, -1.0, 1.0, 0.0, "Slope");
configParam(PARAM_SMOOTHNESS, -1.0, 1.0, 0.0, "Smoothness");

configSwitch(PARAM_MODEL, 0.f, 2.f, 0.f, "Module model", temulentiMenuLabels);
configSwitch(PARAM_MODEL, 0.f, 3.f, 0.f, "Module model", temulentiMenuLabels);

configInput(INPUT_SHAPE, "Shape");
configInput(INPUT_SLOPE, "Slope");
Expand Down

0 comments on commit 140cd06

Please sign in to comment.