Vital
Loading...
Searching...
No Matches
value.h
Go to the documentation of this file.
1
10#pragma once
11
12#include "processor.h"
13
14namespace vital {
15
24 class Value : public Processor {
25 public:
26 enum {
29 };
30
36 Value(poly_float value = 0.0f, bool control_rate = false);
37
42 virtual Processor* clone() const override { return new Value(*this); }
43
48 virtual void process(int num_samples) override;
49
54 virtual void setOversampleAmount(int oversample) override;
55
60 force_inline mono_float value() const { return value_[0]; }
61
66 virtual void set(poly_float value);
67
68 protected:
70
71 JUCE_LEAK_DETECTOR(Value)
72 };
73
74 namespace cr {
82 class Value : public ::vital::Value {
83 public:
88 Value(poly_float value = 0.0f) : ::vital::Value(value, true) { }
89
94 virtual Processor* clone() const override { return new Value(*this); }
95
100 void process(int num_samples) override;
101 };
102 } // namespace cr
103} // namespace vital
Base class for all signal-processing units in Vital.
Definition processor.h:212
A Processor that maintains and outputs a constant poly_float value.
Definition value.h:24
@ kSet
Index of the "set value" trigger input.
Definition value.h:27
@ kNumInputs
Total number of inputs for this Processor.
Definition value.h:28
virtual void setOversampleAmount(int oversample) override
Updates the oversampling amount and ensures the output buffer matches the stored value.
Definition value.cpp:38
virtual void set(poly_float value)
Sets the internal value to a new poly_float.
Definition value.cpp:17
virtual void process(int num_samples) override
Processes a block of samples, writing the constant value to the output buffer.
Definition value.cpp:24
poly_float value_
The constant output value.
Definition value.h:69
Value(poly_float value=0.0f, bool control_rate=false)
Constructs a Value processor.
Definition value.cpp:11
force_inline mono_float value() const
Returns the current mono_float value of the first lane.
Definition value.h:60
virtual Processor * clone() const override
Creates a clone of this Value processor.
Definition value.h:42
A control-rate variant of the Value processor.
Definition value.h:82
void process(int num_samples) override
Processes one "control-rate" sample, updating the output if triggered.
Definition value.cpp:45
virtual Processor * clone() const override
Creates a clone of this control-rate Value processor.
Definition value.h:94
Value(poly_float value=0.0f)
Constructs a control-rate Value processor.
Definition value.h:88
#define force_inline
Definition common.h:23
Contains classes and functions used within the Vital synthesizer framework.
float mono_float
Definition common.h:33
Declares the Processor class and related structures for handling audio processing in a polyphonic con...
Represents a vector of floating-point values using SIMD instructions.
Definition poly_values.h:600