Skip to content

Commit

Permalink
drop max voice count to 20
Browse files Browse the repository at this point in the history
32 is an overkill even for *dreaming* #144
  • Loading branch information
anokta committed Nov 10, 2024
1 parent 6f967c3 commit dab112c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public bool HasChanged {
public double Gain = 1.0;

/// Number of voices.
[Range(1, 32)]
[Range(1, 20)]
public int VoiceCount = 8;

/// Oscillator shape.
Expand Down
2 changes: 1 addition & 1 deletion src/internal/instrument.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class Instrument {
// Array of controls.
ControlArray controls_ = {
Control(1.0, 0.0, 1.0), // kGain
Control(8, 1, 32), // kVoiceCount
Control(8, 1, 20), // kVoiceCount
Control(0, 0, static_cast<int>(BarelyOscillatorShape_kCount) - 1), // kOscillatorShape
Control(0, 0, static_cast<int>(BarelySamplePlaybackMode_kCount) - 1), // kSamplePlaybackMode
Control(0.0, 0.0, 60.0), // kAttack
Expand Down
2 changes: 1 addition & 1 deletion src/internal/instrument_processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace barely::internal {
namespace {

// Maximum number of voices allowed to be set.
constexpr int kMaxVoiceCount = 32;
constexpr int kMaxVoiceCount = 20;

// Returns the frequency ratio of a given `pitch`.
double FrequencyRatioFromPitch(double pitch) { return std::pow(2.0, pitch); }
Expand Down

0 comments on commit dab112c

Please sign in to comment.