mirror of
https://github.com/TomHarte/CLK.git
synced 2025-08-08 14:25:05 +00:00
Adjusts range of output, makes declaration of level
full owner of type information.
This commit is contained in:
@@ -38,10 +38,8 @@ int Channel::update(Operator *modulator, Operator *carrier, OperatorOverrides *m
|
|||||||
modulator->update(modulator_state_, key_on_, period_ << frequency_shift_, octave_, modulator_overrides);
|
modulator->update(modulator_state_, key_on_, period_ << frequency_shift_, octave_, modulator_overrides);
|
||||||
carrier->update(carrier_state_, key_on_, period_ << frequency_shift_, octave_, carrier_overrides);
|
carrier->update(carrier_state_, key_on_, period_ << frequency_shift_, octave_, carrier_overrides);
|
||||||
|
|
||||||
// TODO: almost everything. This is a quick test.
|
const auto modulator_level = level(modulator_state_);
|
||||||
// Specifically: use lookup tables.
|
return level(carrier_state_, modulator_level) << 2;
|
||||||
const auto modulator_level = level(modulator_state_, 0);
|
|
||||||
return level(carrier_state_, modulator_level);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Channel::is_audible(Operator *carrier, OperatorOverrides *carrier_overrides) {
|
bool Channel::is_audible(Operator *carrier, OperatorOverrides *carrier_overrides) {
|
||||||
|
@@ -46,7 +46,8 @@ class Channel {
|
|||||||
bool is_audible(Operator *carrier, OperatorOverrides *carrier_overrides = nullptr);
|
bool is_audible(Operator *carrier, OperatorOverrides *carrier_overrides = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int level(OperatorState &state, int modulator_level);
|
/// @returns The linear output level for the operator with state @c state and with an [optional] modulation input of @c modulator_level.
|
||||||
|
int level(OperatorState &state, int modulator_level = 0);
|
||||||
|
|
||||||
/// 'F-Num' in the spec; this plus the current octave determines channel frequency.
|
/// 'F-Num' in the spec; this plus the current octave determines channel frequency.
|
||||||
int period_ = 0;
|
int period_ = 0;
|
||||||
|
Reference in New Issue
Block a user