The Synthesis ToolKit in C++ (STK)

Home Information Classes Download Usage Mail List Requirements Links FAQ Tutorial

Sampler.h
1#ifndef STK_SAMPLER_H
2#define STK_SAMPLER_H
3
4#include "Instrmnt.h"
5#include "ADSR.h"
6#include "FileLoop.h"
7#include "OnePole.h"
8
9namespace stk {
10
11/***************************************************/
20/***************************************************/
21
22 class Sampler : public Instrmnt
23{
24 public:
26 Sampler( void );
27
29 virtual ~Sampler( void );
30
32 virtual void setFrequency( StkFloat frequency ) = 0;
33
35 void keyOn( void );
36
38 void keyOff( void );
39
41 virtual void noteOff( StkFloat amplitude );
42
44 virtual void controlChange( int number, StkFloat value ) = 0;
45
47 virtual StkFloat tick( unsigned int channel = 0 ) = 0;
48
50
57 virtual StkFrames& tick( StkFrames& frames, unsigned int channel = 0 ) = 0;
58
59 protected:
60
61 ADSR adsr_;
62 std::vector<FileWvIn *> attacks_;
63 std::vector<FileLoop *> loops_;
64 OnePole filter_;
65 StkFloat baseFrequency_;
66 std::vector<StkFloat> attackRatios_;
67 std::vector<StkFloat> loopRatios_;
68 StkFloat attackGain_;
69 StkFloat loopGain_;
70
71};
72
73} // stk namespace
74
75#endif
stk::ADSR
STK ADSR envelope class.
Definition ADSR.h:25
stk::Instrmnt
STK instrument abstract base class.
Definition Instrmnt.h:20
stk::OnePole
STK one-pole filter class.
Definition OnePole.h:21
stk::Sampler
STK sampling synthesis abstract base class.
Definition Sampler.h:23
stk::Sampler::tick
virtual StkFloat tick(unsigned int channel=0)=0
Compute and return one output sample.
stk::Sampler::noteOff
virtual void noteOff(StkFloat amplitude)
Stop a note with the given amplitude (speed of decay).
stk::Sampler::setFrequency
virtual void setFrequency(StkFloat frequency)=0
Set instrument parameters for a particular frequency.
stk::Sampler::keyOff
void keyOff(void)
Signal a key-off event to the envelopes.
stk::Sampler::~Sampler
virtual ~Sampler(void)
Class destructor.
stk::Sampler::Sampler
Sampler(void)
Default constructor.
stk::Sampler::tick
virtual StkFrames & tick(StkFrames &frames, unsigned int channel=0)=0
Fill a channel of the StkFrames object with computed outputs.
stk::Sampler::keyOn
void keyOn(void)
Initiate the envelopes with a key-on event and reset the attack waves.
stk::Sampler::controlChange
virtual void controlChange(int number, StkFloat value)=0
Perform the control change specified by number and value (0.0 - 128.0).
stk::StkFrames
An STK class to handle vectorized audio data.
Definition Stk.h:279
stk
The STK namespace.
Definition ADSR.h:6

The Synthesis ToolKit in C++ (STK)
©1995--2023 Perry R. Cook and Gary P. Scavone. All Rights Reserved.