Compare commits
3 Commits
feature/os
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
f0e2d98c12
|
|||
|
83fe94b34d
|
|||
| 8fc7fbfd30 |
@@ -35,4 +35,7 @@ for (n = 0; n < totalSamples; n++) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
We can replace the sin function with any periodic function that returns an amplitude for a given phase angle. Thus, this small piece of code can be used to produce a very wide range of sounds. Functionally, it is the software equivalent of an oscillator, the basic building block of almost all synthesizers.
|
We can replace the sin function with any periodic function that returns an amplitude for a given phase angle. Thus, this small piece of code can be used to produce a very wide range of sounds. Functionally, it is the software equivalent of an oscillator, the basic building block of almost all synthesizers.
|
||||||
|
|
||||||
|
|
||||||
|
https://ccrma.stanford.edu/software/stk/index.html
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "Filter.h"
|
|
||||||
|
|
||||||
class BandPassFilter : public Filter {
|
|
||||||
protected:
|
|
||||||
float GetSampleForFilterType() override;
|
|
||||||
|
|
||||||
public:
|
|
||||||
BandPassFilter();
|
|
||||||
BandPassFilter(Filter* filter);
|
|
||||||
BandPassFilter(float freq, float res, float q);
|
|
||||||
~BandPassFilter();
|
|
||||||
bool IsSameFilterType(FilterType type) override { return type == BandPass; };
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
36
inc/Filter.h
36
inc/Filter.h
@@ -34,3 +34,39 @@ class Filter : public IEffect {
|
|||||||
float GetPeakGain() { return m_drive; }
|
float GetPeakGain() { return m_drive; }
|
||||||
virtual bool IsSameFilterType(FilterType type) { return false; };
|
virtual bool IsSameFilterType(FilterType type) { return false; };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class BandPassFilter : public Filter {
|
||||||
|
protected:
|
||||||
|
float GetSampleForFilterType() override;
|
||||||
|
|
||||||
|
public:
|
||||||
|
BandPassFilter();
|
||||||
|
BandPassFilter(Filter* filter);
|
||||||
|
BandPassFilter(float freq, float res, float q);
|
||||||
|
~BandPassFilter();
|
||||||
|
bool IsSameFilterType(FilterType type) override { return type == BandPass; };
|
||||||
|
};
|
||||||
|
|
||||||
|
class HighPassFilter : public Filter {
|
||||||
|
protected:
|
||||||
|
float GetSampleForFilterType() override;
|
||||||
|
|
||||||
|
public:
|
||||||
|
HighPassFilter();
|
||||||
|
HighPassFilter(Filter* filter);
|
||||||
|
HighPassFilter(float freq, float res, float q);
|
||||||
|
~HighPassFilter();
|
||||||
|
bool IsSameFilterType(FilterType type) override { return type == HighPass; };
|
||||||
|
};
|
||||||
|
|
||||||
|
class LowPassFilter : public Filter {
|
||||||
|
protected:
|
||||||
|
float GetSampleForFilterType() override;
|
||||||
|
|
||||||
|
public:
|
||||||
|
LowPassFilter();
|
||||||
|
LowPassFilter(Filter* filter);
|
||||||
|
LowPassFilter(float freq, float res, float q);
|
||||||
|
~LowPassFilter();
|
||||||
|
bool IsSameFilterType(FilterType type) override { return type == LowPass; };
|
||||||
|
};
|
||||||
@@ -1,8 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Filter.h"
|
#include "Filter.h"
|
||||||
#include "LowPassFilter.h"
|
|
||||||
#include "BandPassFilter.h"
|
|
||||||
#include "HighPassFilter.h"
|
|
||||||
|
|
||||||
struct FilterFactory {
|
struct FilterFactory {
|
||||||
static Filter* CreateFilter(Filter* old_filter, FilterType new_type) {
|
static Filter* CreateFilter(Filter* old_filter, FilterType new_type) {
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "Filter.h"
|
|
||||||
|
|
||||||
class HighPassFilter : public Filter {
|
|
||||||
protected:
|
|
||||||
float GetSampleForFilterType() override;
|
|
||||||
|
|
||||||
public:
|
|
||||||
HighPassFilter();
|
|
||||||
HighPassFilter(Filter* filter);
|
|
||||||
HighPassFilter(float freq, float res, float q);
|
|
||||||
~HighPassFilter();
|
|
||||||
bool IsSameFilterType(FilterType type) override { return type == HighPass; };
|
|
||||||
};
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "Filter.h"
|
|
||||||
|
|
||||||
class LowPassFilter : public Filter {
|
|
||||||
protected:
|
|
||||||
float GetSampleForFilterType() override;
|
|
||||||
|
|
||||||
public:
|
|
||||||
LowPassFilter();
|
|
||||||
LowPassFilter(Filter* filter);
|
|
||||||
LowPassFilter(float freq, float res, float q);
|
|
||||||
~LowPassFilter();
|
|
||||||
bool IsSameFilterType(FilterType type) override { return type == LowPass; };
|
|
||||||
};
|
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "BandPassFilter.h"
|
#include "Filter.h"
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
|
|
||||||
BandPassFilter::BandPassFilter() {
|
BandPassFilter::BandPassFilter() {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "HighPassFilter.h"
|
#include "Filter.h"
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
|
|
||||||
HighPassFilter::HighPassFilter() {
|
HighPassFilter::HighPassFilter() {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "LowPassFilter.h"
|
#include "Filter.h"
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
|
|
||||||
LowPassFilter::LowPassFilter() {
|
LowPassFilter::LowPassFilter() {
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
#include "Logger.h"
|
#include "Logger.h"
|
||||||
#include "OscillatorType.h"
|
#include "OscillatorType.h"
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
#include "LowPassFilter.h"
|
|
||||||
|
|
||||||
Synth::Synth(/* args */) {
|
Synth::Synth(/* args */) {
|
||||||
m_lfo = new LFO();
|
m_lfo = new LFO();
|
||||||
|
|||||||
Reference in New Issue
Block a user