-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSinOsc.h
More file actions
33 lines (25 loc) · 734 Bytes
/
SinOsc.h
File metadata and controls
33 lines (25 loc) · 734 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//
// SinOsc.h
// DSPLibrary
//
// Created by Mayank on 9/11/12.
// Copyright (c) 2012 Mayank Sanganeria. All rights reserved.
//
#ifndef __DSPLibrary__SinOsc__
#define __DSPLibrary__SinOsc__
#include <iostream>
#include <math.h>
class SinOsc {
protected:
double sampleRate, phase, centerFrequency, frequency, amplitude, range;
public:
SinOsc();
void setSampleRate(double withSampleRate);
void reset();
void setCenterFrequency(float newFrequency);
void setFrequency(float input);// set the instantaneous frequency based on an
void setAmplitude(float withAmplitude);
void setRange(double withRange);
void process (float& output);
};
#endif /* defined(__DSPLibrary__SinOsc__) */