44using InputRange = NamedType<Range, struct InputRangeTag>;
45using OutputRange = NamedType<Range, struct OutputRangeTag>;
51 : input(Range(nt::RangeLow(0.0), nt::RangeHigh(1.0)))
52 , output(Range(nt::RangeLow(0.0), nt::RangeHigh(1.0)))
56 explicit Scaler(
const nt::InputRange input,
const nt::OutputRange output)
58 , output(output.get())
62 explicit Scaler(
const nt::InputRange input)
63 : Scaler(input, nt::OutputRange(Range(nt::RangeLow(0.0), nt::RangeHigh(1.0))))
67 Scaler(
const Scaler &other) =
default;
68 Scaler &operator=(
const Scaler &other) =
default;
70 float operator()(
const float value)
const
77 return (normalize(value) * output.length()) + output.get_low().get();
81 float normalize(
const float value)
const {
return (value - input.get_low().get()) / input.length(); }
Type-safe wrapper utilities for the Deep Note synthesizer.
Range constraint and validation utilities for the Deep Note synthesizer.