Vital
Loading...
Searching...
No Matches
sample_module.h
Go to the documentation of this file.
1#pragma once
2
3#include "synth_module.h"
4#include "sample_source.h"
5
6namespace vital {
7
16 class SampleModule : public SynthModule {
17 public:
22 enum {
27 };
28
33 enum {
37 };
38
43
47 virtual ~SampleModule() { }
48
57 void process(int num_samples) override;
58
64 void init() override;
65
71 virtual Processor* clone() const override { return new SampleModule(*this); }
72
79
86
87 protected:
88 std::shared_ptr<bool> was_on_;
92 JUCE_LEAK_DETECTOR(SampleModule)
93 };
94} // namespace vital
Base class for all signal-processing units in Vital.
Definition processor.h:212
Holds and manages a single sampled waveform, including stereo or mono data and multiple band-limited ...
Definition sample_source.h:25
A module that plays back a sample (audio file) as part of the synthesis pipeline.
Definition sample_module.h:16
virtual ~SampleModule()
Destructor.
Definition sample_module.h:47
Value * on_
Definition sample_module.h:90
@ kMidi
Definition sample_module.h:24
@ kReset
Definition sample_module.h:23
@ kNumInputs
Definition sample_module.h:26
@ kNoteCount
Definition sample_module.h:25
force_inline Output * getPhaseOutput() const
Retrieves the phase output of the sampler.
Definition sample_module.h:85
Sample * getSample()
Gets the Sample object used by the sampler.
Definition sample_module.h:78
void process(int num_samples) override
Processes a block of samples for the given number of samples.
Definition sample_module.cpp:61
@ kNumOutputs
Definition sample_module.h:36
@ kLevelled
Definition sample_module.h:35
@ kRaw
Definition sample_module.h:34
SampleSource * sampler_
Definition sample_module.h:89
std::shared_ptr< bool > was_on_
Definition sample_module.h:88
virtual Processor * clone() const override
Creates a clone of this SampleModule.
Definition sample_module.h:71
void init() override
Initializes the sample module by creating controls and plugging them into the sampler.
Definition sample_module.cpp:20
SampleModule()
Constructs a SampleModule.
Definition sample_module.cpp:9
A Processor that reads from a Sample object, providing audio output with controls for looping,...
Definition sample_source.h:214
force_inline Output * getPhaseOutput() const
Retrieves an additional output that reflects the playback phase (in [0..1]) for debugging or usage.
Definition sample_source.h:285
Sample * getSample()
Provides access to the owned Sample object.
Definition sample_source.h:279
A ProcessorRouter that encapsulates a cohesive unit of functionality in the synthesizer.
Definition synth_module.h:129
A Processor that maintains and outputs a constant poly_float value.
Definition value.h:24
#define force_inline
Definition common.h:23
Contains classes and functions used within the Vital synthesizer framework.
Declares the Sample and SampleSource classes for loading, managing, and playing back audio samples in...
Holds and manages a buffer of samples (poly_float) for a Processor's output.
Definition processor.h:35
Defines the SynthModule class which extends ProcessorRouter to form a building block of the Vital syn...