mirror of
https://github.com/thestk/stk
synced 2026-01-19 07:31:52 +00:00
Version 4.2.0
This commit is contained in:
committed by
Stephen Sinclair
parent
cf06b7598b
commit
a6381b9d38
@@ -14,12 +14,12 @@
|
||||
use possibly subject to patents held by
|
||||
Stanford University, Yamaha, and others.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995 - 2004.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
#if !defined(__PLUCKTWO_H)
|
||||
#define __PLUCKTWO_H
|
||||
#ifndef STK_PLUCKTWO_H
|
||||
#define STK_PLUCKTWO_H
|
||||
|
||||
#include "Instrmnt.h"
|
||||
#include "DelayL.h"
|
||||
@@ -30,7 +30,7 @@ class PluckTwo : public Instrmnt
|
||||
{
|
||||
public:
|
||||
//! Class constructor, taking the lowest desired playing frequency.
|
||||
PluckTwo(MY_FLOAT lowestFrequency);
|
||||
PluckTwo(StkFloat lowestFrequency);
|
||||
|
||||
//! Class destructor.
|
||||
virtual ~PluckTwo();
|
||||
@@ -39,16 +39,16 @@ class PluckTwo : public Instrmnt
|
||||
void clear();
|
||||
|
||||
//! Set instrument parameters for a particular frequency.
|
||||
virtual void setFrequency(MY_FLOAT frequency);
|
||||
virtual void setFrequency(StkFloat frequency);
|
||||
|
||||
//! Detune the two strings by the given factor. A value of 1.0 produces unison strings.
|
||||
void setDetune(MY_FLOAT detune);
|
||||
void setDetune(StkFloat detune);
|
||||
|
||||
//! Efficient combined setting of frequency and detuning.
|
||||
void setFreqAndDetune(MY_FLOAT frequency, MY_FLOAT detune);
|
||||
void setFreqAndDetune(StkFloat frequency, StkFloat detune);
|
||||
|
||||
//! Set the pluck or "excitation" position along the string (0.0 - 1.0).
|
||||
void setPluckPosition(MY_FLOAT position);
|
||||
void setPluckPosition(StkFloat position);
|
||||
|
||||
//! Set the base loop gain.
|
||||
/*!
|
||||
@@ -56,28 +56,41 @@ class PluckTwo : public Instrmnt
|
||||
Because of high-frequency loop filter roll-off, higher
|
||||
frequency settings have greater loop gains.
|
||||
*/
|
||||
void setBaseLoopGain(MY_FLOAT aGain);
|
||||
void setBaseLoopGain(StkFloat aGain);
|
||||
|
||||
//! Stop a note with the given amplitude (speed of decay).
|
||||
virtual void noteOff(MY_FLOAT amplitude);
|
||||
virtual void noteOff(StkFloat amplitude);
|
||||
|
||||
//! Virtual (abstract) tick function is implemented by subclasses.
|
||||
virtual MY_FLOAT tick() = 0;
|
||||
virtual StkFloat tick() = 0;
|
||||
|
||||
protected:
|
||||
DelayA *delayLine;
|
||||
DelayA *delayLine2;
|
||||
DelayL *combDelay;
|
||||
OneZero *filter;
|
||||
OneZero *filter2;
|
||||
long length;
|
||||
MY_FLOAT loopGain;
|
||||
MY_FLOAT baseLoopGain;
|
||||
MY_FLOAT lastFrequency;
|
||||
MY_FLOAT lastLength;
|
||||
MY_FLOAT detuning;
|
||||
MY_FLOAT pluckAmplitude;
|
||||
MY_FLOAT pluckPosition;
|
||||
//! Computer \e vectorSize outputs and return them in \e vector.
|
||||
virtual StkFloat *tick(StkFloat *vector, unsigned int vectorSize) = 0;
|
||||
|
||||
//! Fill a channel of the StkFrames object with computed outputs.
|
||||
/*!
|
||||
The \c channel argument should be one or greater (the first
|
||||
channel is specified by 1). An StkError will be thrown if the \c
|
||||
channel argument is zero or it is greater than the number of
|
||||
channels in the StkFrames object.
|
||||
*/
|
||||
virtual StkFrames& tick( StkFrames& frames, unsigned int channel = 1 ) = 0;
|
||||
|
||||
protected:
|
||||
DelayA delayLine_;
|
||||
DelayA delayLine2_;
|
||||
DelayL combDelay_;
|
||||
OneZero filter_;
|
||||
OneZero filter2_;
|
||||
|
||||
unsigned long length_;
|
||||
StkFloat loopGain_;
|
||||
StkFloat baseLoopGain_;
|
||||
StkFloat lastFrequency_;
|
||||
StkFloat lastLength_;
|
||||
StkFloat detuning_;
|
||||
StkFloat pluckAmplitude_;
|
||||
StkFloat pluckPosition_;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user